From c5123180ad0aa57fbf5f931163a2cc9f5977da15 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 24 Jul 2010 14:27:50 +0200 Subject: Fix database configuration Remove default database from SheMov. Now open named database in SmModelSingleton and use configured settings. --- shemov.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'shemov.cpp') diff --git a/shemov.cpp b/shemov.cpp index 5cda0c1..b8fb5fe 100644 --- a/shemov.cpp +++ b/shemov.cpp @@ -44,22 +44,9 @@ #include "filestreewidget.h" SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, flags), mOpenWithGroupFS(0), mOpenWithGroupAV(0) { + //application icon qApp->setWindowIcon(QIcon(":/shemov.png")); - QSettings s; - QString dbhost = s.value("database/hostname").toString(); - QString dbname = s.value("database/dbname").toString(); - QString dbuser = s.value("database/dbuser").toString(); - QString dbpass = s.value("database/dbpass").toString(); - QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL"); - db.setHostName(dbhost); - db.setDatabaseName(dbname); - db.setUserName(dbuser); - db.setPassword(dbpass); - if(!db.open()){ - QMessageBox::critical(this, tr("Error"), tr("Could not open database. Please configure the database and restart the program")); - } - //FileSystemWidget + TabWidget mFSWidget = new FilesystemWidget; setWindowTitle(mFSWidget->windowTitle()); @@ -68,7 +55,7 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla //ArchiveTreeView mATree = new ArchiveTreeView; - mTab->addTab(mATree, "Tree"); + mTab->addTab(mATree, "Archive"); connect(mATree->filesWidget(), SIGNAL(statusMessage(QString)), this, SLOT(statusbarMessage(QString))); connect(mATree->filesWidget(), SIGNAL(sizeChanged(qint64)), this, SLOT(setSize(qint64))); connect(mATree, SIGNAL(needWindowTitleChange(QString)), this, SLOT(setWindowTitle(QString))); -- cgit v1.2.3-70-g09d2