Mercurial > hg > syntilista
diff src/main.h @ 174:636a24c76232
Rename some classes to add a SL prefix to their names.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 20 Sep 2017 09:43:11 +0300 |
parents | 1c2f9d09e87b |
children | 76afbf6508c8 |
line wrap: on
line diff
--- a/src/main.h Tue Sep 19 13:54:46 2017 +0300 +++ b/src/main.h Wed Sep 20 09:43:11 2017 +0300 @@ -48,12 +48,12 @@ // // Person information record // -class PersonInfo : public QObject +class SLPersonInfo : public QObject { Q_OBJECT public: - explicit PersonInfo() + explicit SLPersonInfo() { id = -1; firstName = ""; @@ -62,7 +62,7 @@ balance = 0; } - ~PersonInfo() + ~SLPersonInfo() { } @@ -88,39 +88,39 @@ int slErrorMsg(QString title, QString msg); bool slCheckAndReportSQLError(const QString where, const QSqlError &err, bool report = false); -void slGetPersonInfoRec(QSqlQuery &query, PersonInfo &info); +void slGetPersonInfoRec(QSqlQuery &query, SLPersonInfo &info); // // Custom SQL models // -class PersonSQLModel : public QSqlQueryModel +class SLPersonSQLModel : public QSqlQueryModel { Q_OBJECT private: public: - PersonSQLModel(QObject *parent = 0); + SLPersonSQLModel(QObject *parent = 0); QVariant data(const QModelIndex &item, int role) const Q_DECL_OVERRIDE; - int updatePerson(const PersonInfo &person); - qint64 addPerson(const PersonInfo &person); + int updatePerson(const SLPersonInfo &person); + qint64 addPerson(const SLPersonInfo &person); int deletePerson(qint64 id); void updateModel(); }; -class TransactionSQLModel : public QSqlQueryModel +class SLTransactionSQLModel : public QSqlQueryModel { Q_OBJECT private: public: - TransactionSQLModel(QObject *parent = 0); + SLTransactionSQLModel(QObject *parent = 0); QVariant data(const QModelIndex &item, int role) const Q_DECL_OVERRIDE; @@ -159,7 +159,7 @@ void readSettings(); void saveSettings(); void setActivePerson(qint64 id); - int addTransaction(qint64 id, double value, PersonInfo &info); + int addTransaction(qint64 id, double value, SLPersonInfo &info); int addTransactionGUI(qint64 id, bool debt, double value); void updatePersonList(); void updateMiscValues(); @@ -167,7 +167,7 @@ bool printDocumentPage(const bool getPageInfo, const int page, QPainter *pt, QPrinter *printer); - PersonSQLModel *model_People; + SLPersonSQLModel *model_People; public slots: void focusDebtEdit(); @@ -218,14 +218,17 @@ QNetworkReply *httpBackupReply; #endif - TransactionSQLModel *model_Latest; - PersonInfo currPerson; + SLTransactionSQLModel *model_Latest; + SLPersonInfo currPerson; int peopleSortIndex; Qt::SortOrder peopleSortOrder; QString peopleFilter; SLPageInfo pinfo; + + int totalPeople; + double totalBalance; }; @@ -260,8 +263,8 @@ private: Ui::EditPerson *ui; - PersonInfo selPerson; - TransactionSQLModel *model_Transactions; + SLPersonInfo selPerson; + SLTransactionSQLModel *model_Transactions; };