]> vaikene.ee Git - evaf/blobdiff - src/apps/PswGen/Storage/module.cpp
Ported to Qt5
[evaf] / src / apps / PswGen / Storage / module.cpp
index 12fda4213118132b30768af23720beb78cfbd5bd..3c18b9a7cf64b3870eefa0b1aa9d0a16e357a623 100644 (file)
@@ -18,7 +18,6 @@
  */
 
 #include "module.h"
-#include "version.h"
 
 #include <Common/Globals>
 #include <Common/iLogger>
@@ -29,7 +28,6 @@
 #include <QtSql/QtSql>
 
 VER_EXPORT_VERSION_INFO()
-Q_EXPORT_PLUGIN2(VER_MODULE_NAME_STR, eVaf::PswGen::Storage::Module)
 
 using namespace eVaf;
 using namespace eVaf::PswGen;
@@ -170,10 +168,10 @@ bool StorageImpl::save(QString const & name, QExplicitlySharedDataPointer<Storag
         }
 
         // Store also into the local hash
+        beginResetModel();
         mData.insert(name, data);
+        endResetModel();
 
-        // Reset the model
-        reset();
     }
 
     data->reset();
@@ -253,14 +251,14 @@ bool StorageImpl::loadData()
         return false;
     }
 
+    beginResetModel();
     while (q.next()) {
         QString name = q.value(0).toString();
         QExplicitlySharedDataPointer<Storage::Data> data(
                     new Storage::Data(name, q.value(1).toString(), q.value(2).toInt(), uint(q.value(3).toInt())));
         mData.insert(name, data);
     }
-
-    reset();
+    endResetModel();
 
     return true;
 }