numberprocessorproxy.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef NUMBERPROCESSORPROXY_H
  2. #define NUMBERPROCESSORPROXY_H
  3. #include <QtCore>
  4. #include "snccore.h"
  5. #include "numberlistmodel.h"
  6. #include "numberreg.h"
  7. #include "SNCCore_global.h"
  8. class SNCCORESHARED_EXPORT NumberProcessorProxy : public QThread
  9. {
  10. Q_OBJECT
  11. public:
  12. NumberProcessorProxy(NumberListModel *oldModel);
  13. ~NumberProcessorProxy();
  14. void setProcessType(NumberProcessType processType);
  15. void setBlackList(NumberListModel *blackListModel);
  16. void abort();
  17. signals:
  18. void progressMaxUpdated(int max);
  19. void progressUpdated(int i);
  20. void numberProcessed(NumberListModel *newModel);
  21. private:
  22. void sort();
  23. void removeDuplicate();
  24. void removeNotPhone();
  25. void removeBlackList();
  26. QStringList filterNumbers(QStringList source,QStringList filter);
  27. protected:
  28. void run();
  29. private:
  30. int counter;
  31. int optimizeMaxProgress;
  32. int step1Progress;
  33. int step2Progress;
  34. bool stop;
  35. NumberProcessType processType;
  36. QStringList segments;
  37. QList<QStringList> numbers;
  38. NumberListModel *oldModel;
  39. NumberListModel *newModel;
  40. NumberListModel *blackListModel;
  41. QMutex *mutex2;
  42. public slots:
  43. void onOptimizeProgressMaxUpdated(int max);
  44. void onOptimizeProgressCurrentUpdated(int current);
  45. };
  46. #endif // NUMBERPROCESSORPROXY_H