aboutsummaryrefslogtreecommitdiff
path: root/client/dbconnector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'client/dbconnector.cpp')
-rw-r--r--client/dbconnector.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/client/dbconnector.cpp b/client/dbconnector.cpp
index 5ed1efc..e925851 100644
--- a/client/dbconnector.cpp
+++ b/client/dbconnector.cpp
@@ -26,19 +26,16 @@ void dbConnector::on_pushButton_login_clicked()
QString hostname = ui->lineEdit_adress->text();
QString username = ui->lineEdit_username->text();
QString password = ui->lineEdit_password->text();
- QString databaseName = "thecrapbox";
+ QString databaseName = ui->lineEdit_database->text();
-// QSqlDatabase db = MainWindow.loginDb(adress, username, password);
-
-// QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
-// return;
dbRef.setHostName(hostname);
dbRef.setUserName(username);
dbRef.setPassword(password);
- dbRef.setDatabaseName("thecrapbox");
+ dbRef.setDatabaseName(databaseName);
if(dbRef.open()){
QMessageBox::information(this, "Connection", "GREAT SUCCES!");
+ dbConnector::~dbConnector();
} else {
QMessageBox::warning(this, "No connection", "Failed to connect");
}