summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnne Jan Brouwer <annejan@noprotocol.com>2015-06-11 00:29:20 +0200
committerAnne Jan Brouwer <annejan@noprotocol.com>2015-06-11 00:29:20 +0200
commitccda0323fdf150a70c619c5782fee3ff7c6e08c9 (patch)
tree74e8f9693d4d46d817a7e694eb015cbaa824a556
parent183f5afb2c6339e78b67d2021af8b0b2b01a8b96 (diff)
fixes after static analysis
-rw-r--r--dialog.cpp4
-rw-r--r--main.cpp11
-rw-r--r--mainwindow.cpp5
-rw-r--r--qtpass.pro2
-rw-r--r--storemodel.cpp17
-rw-r--r--usersdialog.cpp1
6 files changed, 21 insertions, 19 deletions
diff --git a/dialog.cpp b/dialog.cpp
index 4b7de9a7..721840ed 100644
--- a/dialog.cpp
+++ b/dialog.cpp
@@ -510,7 +510,9 @@ void Dialog::wizard()
//qDebug() << names;
if (QFile(gpg).exists() && names.empty()) {
KeygenDialog d(this);
- d.exec();
+ if (!d.exec()) {
+ return;
+ }
}
QString passStore = ui->storePath->text();
diff --git a/main.cpp b/main.cpp
index 9def9777..8f397ab8 100644
--- a/main.cpp
+++ b/main.cpp
@@ -41,12 +41,7 @@ int main(int argc, char *argv[])
app.setActiveWindow(&w);
app.setWindowIcon(QIcon(":artwork/icon.png"));
w.setApp(&app);
- if (w.checkConfig()) {
- w.setText(text);
- w.show();
- return app.exec();
- } else {
- // canceled out of wizard
- return 0;
- }
+ w.setText(text);
+ w.show();
+ return app.exec();
}
diff --git a/mainwindow.cpp b/mainwindow.cpp
index c106c09a..6b6a6745 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -38,6 +38,11 @@ MainWindow::MainWindow(QWidget *parent) :
ui->statusBar->showMessage(tr("Welcome to QtPass %1").arg(VERSION), 2000);
firstRun = true;
startupPhase = true;
+ if (!checkConfig()) {
+ // no working config
+ QApplication::quit();
+ }
+ QtPass = NULL;
}
/**
diff --git a/qtpass.pro b/qtpass.pro
index e9f668aa..57e08b3f 100644
--- a/qtpass.pro
+++ b/qtpass.pro
@@ -20,7 +20,7 @@ macx {
}
TEMPLATE = app
-VERSION = 0.8.3
+VERSION = 0.8.4
SOURCES += main.cpp\
mainwindow.cpp \
diff --git a/storemodel.cpp b/storemodel.cpp
index 213ba8c3..3738236f 100644
--- a/storemodel.cpp
+++ b/storemodel.cpp
@@ -6,6 +6,7 @@
*/
StoreModel::StoreModel()
{
+ fs = NULL;
}
/**
@@ -29,14 +30,19 @@ bool StoreModel::filterAcceptsRow(int sourceRow,
bool StoreModel::ShowThis(const QModelIndex index) const
{
bool retVal = false;
+ if (fs == NULL) {
+ return retVal;
+ }
//Gives you the info for number of childs with a parent
if ( sourceModel()->rowCount(index) > 0 )
{
for( int nChild = 0; nChild < sourceModel()->rowCount(index); nChild++)
{
QModelIndex childIndex = sourceModel()->index(nChild,0,index);
- if ( ! childIndex.isValid() )
+ if (!childIndex.isValid())
+ {
break;
+ }
retVal = ShowThis(childIndex);
if (retVal)
{
@@ -50,14 +56,7 @@ bool StoreModel::ShowThis(const QModelIndex index) const
QString path = fs->filePath(useIndex);
path.replace(QRegExp("\\.gpg$"), "");
path.replace(QRegExp("^" + store), "");
- if ( ! path.contains(filterRegExp()))
- {
- retVal = false;
- }
- else
- {
- retVal = true;
- }
+ retVal = path.contains(filterRegExp());
}
return retVal;
}
diff --git a/usersdialog.cpp b/usersdialog.cpp
index 189fd1b8..dd0b6517 100644
--- a/usersdialog.cpp
+++ b/usersdialog.cpp
@@ -10,6 +10,7 @@ UsersDialog::UsersDialog(QWidget *parent) :
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(ui->listWidget, SIGNAL(itemChanged(QListWidgetItem *)), this, SLOT(itemChange(QListWidgetItem *)));
+ userList = NULL;
}
UsersDialog::~UsersDialog()