Add a way to set or change the application name

May be useful for presenting different message sources
within a single process.
This commit is contained in:
William Jon McCann 2011-01-17 16:40:17 -05:00
parent 277f40c872
commit a967c61e5b
2 changed files with 17 additions and 2 deletions

View File

@ -119,6 +119,21 @@ _notify_update_spec_version (GError **error)
return TRUE;
}
/**
* notify_set_app_name:
* @app_name: The name of the application
*
* Sets the application name.
*
*/
void
notify_set_app_name (const char *app_name)
{
g_free (_app_name);
_app_name = g_strdup (app_name);
}
/**
* notify_init:
* @app_name: The name of the application initializing libnotify.
@ -136,8 +151,7 @@ notify_init (const char *app_name)
if (_initted)
return TRUE;
g_free (_app_name);
_app_name = g_strdup (app_name);
notify_set_app_name (app_name);
g_type_init ();

View File

@ -35,6 +35,7 @@ void notify_uninit (void);
gboolean notify_is_initted (void);
const char *notify_get_app_name (void);
void notify_set_app_name (const char *app_name);
GList *notify_get_server_caps (void);