X-Git-Url: https://vaikene.ee/gitweb/pswgen11.html?a=blobdiff_plain;ds=sidebyside;f=src%2Fapps%2FPswGen%2FStorage%2Fmodule.h;h=68416f0034143a9feb7b06013359e2e7b094a3e0;hb=refs%2Fheads%2Fmaster;hp=49c7e6a2f02a836198aee8c2b73cb1002ff86e71;hpb=36bd93cf4263b118366b3db2d26e8efb1ac1b690;p=evaf
diff --git a/src/apps/PswGen/Storage/module.h b/src/apps/PswGen/Storage/module.h
index 49c7e6a..68416f0 100644
--- a/src/apps/PswGen/Storage/module.h
+++ b/src/apps/PswGen/Storage/module.h
@@ -3,7 +3,7 @@
* @brief Implementation of the iStorage interface
* @author Enar Vaikene
*
- * Copyright (c) 2011-2012 Enar Vaikene
+ * Copyright (c) 2011-2019 Enar Vaikene
*
* This file is part of the eVaf C++ cross-platform application development framework.
*
@@ -29,8 +29,8 @@
#include
#include
#include
-#include
+class QSqlDatabase;
namespace eVaf {
namespace PswGen {
@@ -113,7 +113,7 @@ public:
QAbstractListModel methods
*/
- virtual int rowCount(QModelIndex const & parent) const { return mData.count(); }
+ virtual int rowCount(QModelIndex const &) const { return mData.count(); }
virtual QVariant data(QModelIndex const & index, int role = Qt::DisplayRole) const;
@@ -126,9 +126,6 @@ private: // Members
/// Name of the database file without path
static char const * const DbName;
- /// Database connection
- QSqlDatabase mDb;
-
/// List of name/data pairs
QMap > mData;
@@ -139,7 +136,7 @@ private: // Methods
* Creates database tables if necessary
* @return True if ok; false if failed
*/
- bool createTables();
+ bool createTables(QSqlDatabase & db);
/**
* Upgrades database tables if necessary
@@ -149,13 +146,13 @@ private: // Methods
* performs the upgrade without a loss of data if possible.
* Returns false if upgrade is not possible or fails.
*/
- bool upgradeTables();
+ bool upgradeTables(QSqlDatabase & db);
/**
* Loads data from the database
* @return True if ok; false if failed
*/
- bool loadData();
+ bool loadData(QSqlDatabase & db);
};