added custom port support for database
This commit is contained in:
parent
a0eeb84de2
commit
56bdf0bfc3
|
@ -11,8 +11,9 @@ In next sections, «component» must be replaced by the proper name of the compo
|
|||
Create `~/.config/it.linux.golem/component.conf` with following content:
|
||||
|
||||
[database]
|
||||
hostname=serverozzo.golem.linux.it
|
||||
database=golem_gestionale
|
||||
hostname=vupiuesse.andromeda.golem.linux.it
|
||||
port=7004
|
||||
database=gestionale
|
||||
username=golem
|
||||
password=guess
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ int main(int argc, char *argv[])
|
|||
/* open database and attach query */
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL"); /* QMYSQL <-- database driver */
|
||||
db.setHostName(settings.value("hostname").toString());
|
||||
db.setPort(settings.value("port").toInt());
|
||||
db.setDatabaseName(settings.value("database").toString());
|
||||
db.setUserName(settings.value("username").toString());
|
||||
db.setPassword(settings.value("password").toString());
|
||||
|
|
Loading…
Reference in New Issue