summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2018-11-23 15:19:51 +0100
committerArno <arno@disconnect.de>2018-11-23 15:19:51 +0100
commit819d643782e951284d06b88a3c30adf9a6260d17 (patch)
treef0f4a1b6522b41be834e8b9bf39cb5cd30ed511e
parent38bf0f461f394fbed795c21dcf70e953bb160a9e (diff)
downloadSheMov-819d643782e951284d06b88a3c30adf9a6260d17.tar.gz
SheMov-819d643782e951284d06b88a3c30adf9a6260d17.tar.bz2
SheMov-819d643782e951284d06b88a3c30adf9a6260d17.zip
Fix consistencycheck.cpp
Convert one connect to type-safe connect and fix 2 uninitialzed warnings.
-rw-r--r--consistencycheck.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/consistencycheck.cpp b/consistencycheck.cpp
index 52427a2..24d128c 100644
--- a/consistencycheck.cpp
+++ b/consistencycheck.cpp
@@ -28,7 +28,7 @@
#include "consistencycheck.h"
#include "helper.h"
-ConsistencyCheck::ConsistencyCheck(QWidget *parent, Qt::WindowFlags f) : SmDialog(parent, f), mChecker(0){
+ConsistencyCheck::ConsistencyCheck(QWidget *parent, Qt::WindowFlags f) : SmDialog(parent, f), mChecker(nullptr){
// setup widget
// OK
QGroupBox *okBox = new QGroupBox(tr("Ok"));
@@ -64,7 +64,7 @@ ConsistencyCheck::ConsistencyCheck(QWidget *parent, Qt::WindowFlags f) : SmDialo
mCheckFs = new QPushButton(tr("Check Filesystem"));
connect(mCheckFs, &QPushButton::clicked, [=] { startChecker(ConsistencyCheck::FsCheck); });
mCleanup = new QPushButton(tr("Cleanup..."));
- connect(mCleanup, SIGNAL(clicked()), this, SLOT(cleanup()));
+ connect(mCleanup, &QPushButton::clicked, this, &ConsistencyCheck::cleanup);
mCleanup->setEnabled(false);
QHBoxLayout *buttonLayout = new QHBoxLayout;
buttonLayout->addWidget(mCheckDb);
@@ -374,12 +374,12 @@ void ConsistencyChecker::dbCheck(){
mStrayPicIds.clear();
mStrayPicsIdMutex.unlock();
QSqlQuery numFilesQ("SELECT COUNT(*) FROM files", mDb);
- int numFiles;
+ int numFiles = 0;
while(numFilesQ.next()){
numFiles = numFilesQ.value(0).toInt();
}
QSqlQuery numPicsQ("SELECT COUNT(*) FROM pics", mDb);
- int numPics;
+ int numPics = 0;
while(numPicsQ.next()){
numPics = numPicsQ.value(0).toInt();
}