[PATCH 2 of 3] Rename settings and certlist and add accessors

Wald Commits scm-commit at wald.intevation.org
Wed Apr 23 12:36:34 CEST 2014


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1398249296 0
# Node ID 6dec8101793c3dfc4096061d4ec5ad2c1b3b34b1
# Parent  f8b480b08532d85d804869811f73127053803d91
Rename settings and certlist and add accessors

diff -r f8b480b08532 -r 6dec8101793c ui/administratorwindow.cpp
--- a/ui/administratorwindow.cpp	Wed Apr 23 10:33:40 2014 +0000
+++ b/ui/administratorwindow.cpp	Wed Apr 23 10:34:56 2014 +0000
@@ -33,7 +33,7 @@
     setWindowTitle(tr("TrustBridge Administration"));
     QString path = QStandardPaths::locate(
         QStandardPaths::DataLocation, QString("certlist_last.txt"));
-    certList.readList(path.toLocal8Bit());
+    mCertList.readList(path.toLocal8Bit());
     createActions();
     createMenuBar();
     createContent();
@@ -143,8 +143,8 @@
     QString certFile = QFileDialog::getOpenFileName(
         this, tr("Select certificate list file"), path, "*.txt");
     qDebug() << "selected: " + certFile;
-    certList.readList(certFile.toLocal8Bit().constData());
-    if (!certList.isValid()) {
+    mCertList.readList(certFile.toLocal8Bit().constData());
+    if (!mCertList.isValid()) {
         qDebug() << "Not a valid list.";
     }
     else {
@@ -181,7 +181,7 @@
 }
 
 void AdministratorWindow::loadCertificateTable() {
-    foreach(const Certificate &cert, certList.getCertificates()) {
+    foreach(const Certificate &cert, mCertList.getCertificates()) {
         certificateModel->addCertificate(cert, true);
     }
     certificateView->resizeColumnsToContents();
diff -r f8b480b08532 -r 6dec8101793c ui/administratorwindow.h
--- a/ui/administratorwindow.h	Wed Apr 23 10:33:40 2014 +0000
+++ b/ui/administratorwindow.h	Wed Apr 23 10:34:56 2014 +0000
@@ -32,6 +32,16 @@
 public:
     AdministratorWindow();
 
+    /** @brief obtain a const reference to the certificate List
+     * @returns the current certificatelist
+     */
+    const CertificateList& certList() const {return mCertList;}
+
+    /** @brief get the settings for this application
+     * @returns a reference the applications settings object
+     */
+    QSettings* settings() {return &mSettings;}
+
 private slots:
     void createInstaller();
     void showAbout();
@@ -48,12 +58,12 @@
     void loadCertificateTable();
     void addToCertificateTable(const QList<Certificate> &certs);
 
-    QSettings settings;
+    QSettings mSettings;
 
     QMenuBar *menuBar;
 
     QTableView *certificateView;
-    CertificateList certList;
+    CertificateList mCertList;
     CertificateTabelModel *certificateModel;
     QPushButton *saveButton;
     QPushButton *loadButton;


More information about the Trustbridge-commits mailing list