diff options
author | Arno <arno@disconnect.de> | 2016-08-20 18:29:52 +0200 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2016-08-20 18:29:52 +0200 |
commit | 32afa2c28aabe862bfca44dba24083ffd7db6721 (patch) | |
tree | 131e14e7bfb579a09275c1aa7d12d0113c343ab7 /torrentwidget.cpp | |
parent | 96c798d4e9ca91cade25aa6d38176714979685bc (diff) | |
download | ShemovCleaner-32afa2c28aabe862bfca44dba24083ffd7db6721.tar.gz ShemovCleaner-32afa2c28aabe862bfca44dba24083ffd7db6721.tar.bz2 ShemovCleaner-32afa2c28aabe862bfca44dba24083ffd7db6721.zip |
Added configration dialog
Database connection options are now configurable. Hopefully it doesn't
end up in an infinite loop if the credentials are not corrent...
Diffstat (limited to 'torrentwidget.cpp')
-rw-r--r-- | torrentwidget.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/torrentwidget.cpp b/torrentwidget.cpp index f184324..656870e 100644 --- a/torrentwidget.cpp +++ b/torrentwidget.cpp @@ -28,15 +28,6 @@ #include "torrentdisplay.h" TorrentWidget::TorrentWidget(QWidget *parent) : QWidget(parent), mExt("*.torrent") { - QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL", "shemovdb"); - db.setHostName("hadante.d-tor.org"); - db.setUserName("shemov"); - db.setPassword("shemov"); - db.setDatabaseName("shemov2"); - if(!db.open()){ - QMessageBox::critical(0, tr("Error"), tr("Could not open database!")); - } - setupGui(); gatherData(); } @@ -97,6 +88,9 @@ void TorrentWidget::setupGui(){ void TorrentWidget::gatherData(){ QSqlDatabase db = QSqlDatabase::database("shemovdb"); + if(!db.isOpen()){ + db.open(); + } QSqlQuery q(db); q.prepare("SELECT COUNT(*) FROM metadata WHERE tsubject = :fn"); QDir d(mDir->text()); |