numbermoveproxy.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef NUMBERMOVEPROXY_H
  2. #define NUMBERMOVEPROXY_H
  3. #include <QtCore>
  4. #include "numberlistmodel.h"
  5. #include "numbermove.h"
  6. #include "snccore.h"
  7. #include "SNCCore_global.h"
  8. class SNCCORESHARED_EXPORT NumberMoveProxy : public QThread
  9. {
  10. Q_OBJECT
  11. public:
  12. NumberMoveProxy(NumberListModel *oldSourceModel,NumberListModel *oldDestModel);
  13. ~NumberMoveProxy();
  14. void setMoveType(NumberMoveType moveType );
  15. void setRange(QString range1,QString range2);
  16. void setRegexpList(QList<QRegExp> regexpList);
  17. void setBatchSize(int batchSize);
  18. void abort();
  19. signals:
  20. void numberMoved(NumberListModel *newSourceModel,NumberListModel *newDestModel);
  21. void progressMaxUpdated(int max);
  22. void progressUpdated(int i);
  23. protected:
  24. void run();
  25. private:
  26. void appendModel();
  27. void importBlackList();
  28. void updateProgress();
  29. private:
  30. int counter;
  31. int progress;
  32. int batchSize;
  33. bool stop;
  34. QMutex mutex;
  35. QStringList sourceSegments;
  36. QList<QStringList> sourceNumbers;
  37. QStringList destSegments;
  38. QList<QStringList> destNumbers;
  39. NumberListModel *oldSourceModel;
  40. NumberListModel *oldDestModel;
  41. NumberListModel *newSourceModel;
  42. NumberListModel *newDestModel;
  43. NumberMoveType moveType;
  44. QString range1;
  45. QString range2;
  46. int step1Progress;
  47. int step2Progress;
  48. int groups;
  49. bool threadCreated;
  50. QList<QRegExp> regexpList;
  51. public slots:
  52. void onChildTaskFinished(QStringList sourceSegments,QList<QStringList> sourceNumbers,
  53. QStringList destSegments,QList<QStringList> destNumbers);
  54. };
  55. #endif // NUMBERMOVEPROXY_H