Add Common::databasePath which also allows overriding it
This commit is contained in:
@ -16,13 +16,15 @@
|
||||
#include "clicklabel.h"
|
||||
#include "../shared/sqlitesearch.h"
|
||||
#include "../shared/qssgeneralexception.h"
|
||||
#include "../shared/common.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QSettings settings;
|
||||
|
||||
db = QSqlDatabase::addDatabase("QSQLITE");
|
||||
db.setDatabaseName(settings.value("dbpath").toString());
|
||||
db.setDatabaseName(Common::databasePath());
|
||||
if(!db.open())
|
||||
{
|
||||
qDebug() << "failed to open database";
|
||||
|
مرجع در شماره جدید
Block a user