Browse Source

Set application name for database connections. Fixes #58.

Neal Wilson 12 years ago
parent
commit
4a5d70fc6e
2 changed files with 310 additions and 306 deletions
  1. 308
    306
      src/typica.cpp
  2. 2
    0
      src/typica.w

+ 308
- 306
src/typica.cpp
File diff suppressed because it is too large
View File


+ 2
- 0
src/typica.w View File

@@ -12533,6 +12533,7 @@ void SqlConnectionSetup::testConnection()
12533 12533
 	QSqlDatabase database =
12534 12534
 		QSqlDatabase::addDatabase(driver->itemData(driver->currentIndex()).
12535 12535
 		                          toString());
12536
+	database.setConnectOptions("application_name=Typica");
12536 12537
 	database.setHostName(hostname->text());
12537 12538
 	database.setDatabaseName(dbname->text());
12538 12539
 	database.setUserName(user->text());
@@ -12573,6 +12574,7 @@ help.
12573 12574
 @<Try connecting to the database@>=
12574 12575
 QSqlDatabase database =
12575 12576
 	QSqlDatabase::addDatabase(settings.value("database/driver").toString());
12577
+database.setConnectOptions("application_name=Typica");
12576 12578
 database.setHostName(settings.value("database/hostname").toString());
12577 12579
 database.setDatabaseName(settings.value("database/dbname").toString());
12578 12580
 database.setUserName(settings.value("database/user").toString());

Loading…
Cancel
Save