/cpw/tomkiewicz/masterpassword: 524edcbc83cb: Use purple_core_ge...

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Fri Apr 26 09:26:38 EDT 2013


Changeset: 524edcbc83cb67d87f5165e39ab19b2e189a93b9
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2013-04-26 15:26 +0200
Branch:	 soc.2008.masterpassword
URL: https://hg.pidgin.im/cpw/tomkiewicz/masterpassword/rev/524edcbc83cb

Description:

Use purple_core_get_ui_info instead of g_get_application_name

diffstat:

 libpurple/plugins/keyrings/kwallet.cpp |  21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diffs (46 lines):

diff --git a/libpurple/plugins/keyrings/kwallet.cpp b/libpurple/plugins/keyrings/kwallet.cpp
--- a/libpurple/plugins/keyrings/kwallet.cpp
+++ b/libpurple/plugins/keyrings/kwallet.cpp
@@ -479,11 +479,18 @@ kwallet_get_handle(void)
 	return &handle;
 }
 
-static void kwallet_core_initialized_cb(void)
+static const char *kwallet_get_ui_name(void)
 {
-	const gchar *appName = g_get_application_name();
-	if (qCoreApp && appName)
-		qCoreApp->setApplicationName(appName);
+	GHashTable *ui_info;
+	const char *ui_name = NULL;
+
+	ui_info = purple_core_get_ui_info();
+	if (ui_info != NULL)
+		ui_name = (const char*)g_hash_table_lookup(ui_info, "name");
+	if (ui_name == NULL)
+		ui_name = KWALLET_APP_NAME;
+
+	return ui_name;
 }
 
 static gboolean
@@ -492,7 +499,7 @@ kwallet_load(PurplePlugin *plugin)
 	if (!qCoreApp) {
 		int argc = 0;
 		qCoreApp = new QCoreApplication(argc, NULL);
-		qCoreApp->setApplicationName(KWALLET_APP_NAME);
+		qCoreApp->setApplicationName(kwallet_get_ui_name());
 	}
 
 	if (!kwallet_is_enabled()) {
@@ -512,10 +519,6 @@ kwallet_load(PurplePlugin *plugin)
 
 	purple_keyring_register(keyring_handler);
 
-	purple_signal_connect(purple_get_core(), "core-initialized",
-		kwallet_get_handle(),
-		PURPLE_CALLBACK(kwallet_core_initialized_cb), NULL);
-
 	return TRUE;
 }
 



More information about the Commits mailing list