Import progress is shown while import.
This commit is contained in:
+16
-1
@@ -4,6 +4,8 @@
|
||||
#include <QList>
|
||||
#include <QSharedPointer>
|
||||
#include <QString>
|
||||
#include <QEventLoop>
|
||||
#include <QApplication>
|
||||
|
||||
#include <odb/core.hxx>
|
||||
#include <odb/transaction.hxx>
|
||||
@@ -15,6 +17,7 @@
|
||||
#include "iservice.h"
|
||||
#include "permissionevaluator.h"
|
||||
#include "iimporter.h"
|
||||
#include "iimportprogress.h"
|
||||
|
||||
#include "transaction.h"
|
||||
|
||||
@@ -179,7 +182,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
bool importData(IImporter *importer) {
|
||||
bool importData(IImporter *importer, IImportProgress *progress = NULL) {
|
||||
int count = importer->recordCount();
|
||||
|
||||
if (importer->isError()) {
|
||||
@@ -201,6 +204,18 @@ public:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
qApp->processEvents();
|
||||
|
||||
if (progress != NULL && progress->terminate())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (progress != NULL)
|
||||
{
|
||||
progress->updateProgress(i * 100 / count);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user