diff options
| author | 2014-12-06 17:33:25 -0500 | |
|---|---|---|
| committer | 2014-12-06 17:33:25 -0500 | |
| commit | 7167ce41b61d2ba2cdb526777a4233eb84a3b66a (patch) | |
| tree | a35c14143716e1f2c98f808c81f89426045a946f /SQLiteStudio3/coreSQLiteStudio/services/populatemanager.h | |
Imported Upstream version 2.99.6upstream/2.99.6
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/services/populatemanager.h')
| -rw-r--r-- | SQLiteStudio3/coreSQLiteStudio/services/populatemanager.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/services/populatemanager.h b/SQLiteStudio3/coreSQLiteStudio/services/populatemanager.h new file mode 100644 index 0000000..05b1f82 --- /dev/null +++ b/SQLiteStudio3/coreSQLiteStudio/services/populatemanager.h @@ -0,0 +1,48 @@ +#ifndef POPULATEMANAGER_H +#define POPULATEMANAGER_H + +#include "pluginservicebase.h" +#include "sqlitestudio.h" +#include <QObject> +#include <QHash> +#include <QStringList> + +class PopulatePlugin; +class PopulateEngine; +class Db; + +class API_EXPORT PopulateManager : public PluginServiceBase +{ + Q_OBJECT + + public: + explicit PopulateManager(QObject *parent = 0); + + void populate(Db* db, const QString& table, const QHash<QString, PopulateEngine*>& engines, qint64 rows); + + private: + void error(); + void deleteEngines(const QList<PopulateEngine*>& engines); + + bool workInProgress = false; + Db* db = nullptr; + QString table; + QStringList columns; + QList<PopulateEngine*> engineList; + + public slots: + void interrupt(); + + private slots: + void finalizePopulating(bool result); + + signals: + void populatingFinished(); + void populatingSuccessful(); + void populatingFailed(); + void orderWorkerToInterrupt(); +}; + +#define POPULATE_MANAGER SQLITESTUDIO->getPopulateManager() + +#endif // POPULATEMANAGER_H |
