summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Ruprecht <cmaiku@gmail.com>2018-10-02 16:08:15 -0500
committerMike Ruprecht <cmaiku@gmail.com>2018-10-02 16:08:15 -0500
commit84f93b7cf632998582aea18db46c32895eef9a13 (patch)
treedd15f2fea97f9991d01d5f911b245944bffecd4b
parent3c7a695ffb7254c1d024568b685b0541c96c67e3 (diff)
downloadpidgin-84f93b7cf632998582aea18db46c32895eef9a13.tar.gz
core: Remove purple_core_ensure_single_instance()
When the DBus API is removed, purple_core_ensure_single_instance() would always return true. Since we're using GApplication for uniqueness in *nix and something else in Windows for Pidgin, this function is no longer used. This patch drops it.
-rw-r--r--libpurple/core.c55
-rw-r--r--libpurple/core.h13
2 files changed, 0 insertions, 68 deletions
diff --git a/libpurple/core.c b/libpurple/core.c
index 2f344c1a32..9b22e152e8 100644
--- a/libpurple/core.c
+++ b/libpurple/core.c
@@ -359,61 +359,6 @@ purple_core_get_ui_ops(void)
return _ops;
}
-#ifdef HAVE_DBUS
-static char *purple_dbus_owner_user_dir(void)
-{
- DBusMessage *msg = NULL, *reply = NULL;
- DBusConnection *dbus_connection = NULL;
- DBusError dbus_error;
- char *remote_user_dir = NULL;
-
- if ((dbus_connection = purple_dbus_get_connection()) == NULL)
- return NULL;
-
- if ((msg = dbus_message_new_method_call(PURPLE_DBUS_SERVICE, PURPLE_DBUS_PATH, PURPLE_DBUS_INTERFACE, "PurpleUserDir")) == NULL)
- return NULL;
-
- dbus_error_init(&dbus_error);
- reply = dbus_connection_send_with_reply_and_block(dbus_connection, msg, 5000, &dbus_error);
- dbus_message_unref(msg);
- dbus_error_free(&dbus_error);
-
- if (reply)
- {
- dbus_error_init(&dbus_error);
- dbus_message_get_args(reply, &dbus_error, DBUS_TYPE_STRING, &remote_user_dir, DBUS_TYPE_INVALID);
- remote_user_dir = g_strdup(remote_user_dir);
- dbus_error_free(&dbus_error);
- dbus_message_unref(reply);
- }
-
- return remote_user_dir;
-}
-
-#endif /* HAVE_DBUS */
-
-gboolean
-purple_core_ensure_single_instance()
-{
- gboolean is_single_instance = TRUE;
-#ifdef HAVE_DBUS
- /* in the future, other mechanisms might have already set this to FALSE */
- if (is_single_instance)
- {
- if (!purple_dbus_is_owner())
- {
- const char *user_dir = purple_user_dir();
- char *dbus_owner_user_dir = purple_dbus_owner_user_dir();
-
- is_single_instance = !purple_strequal(dbus_owner_user_dir, user_dir);
- g_free(dbus_owner_user_dir);
- }
- }
-#endif /* HAVE_DBUS */
-
- return is_single_instance;
-}
-
GHashTable* purple_core_get_ui_info() {
PurpleCoreUiOps *ops = purple_core_get_ui_ops();
diff --git a/libpurple/core.h b/libpurple/core.h
index d38ccac1b1..b22244f653 100644
--- a/libpurple/core.h
+++ b/libpurple/core.h
@@ -173,19 +173,6 @@ void purple_core_set_ui_ops(PurpleCoreUiOps *ops);
PurpleCoreUiOps *purple_core_get_ui_ops(void);
/**
- * purple_core_ensure_single_instance:
- *
- * Ensures that only one instance is running. If libpurple is built with D-Bus
- * support, this checks if another process owns the libpurple bus name and if
- * so whether that process is using the same configuration directory as this
- * process.
- *
- * Returns: %TRUE if this is the first instance of libpurple running;
- * %FALSE if there is another instance running.
- */
-gboolean purple_core_ensure_single_instance(void);
-
-/**
* purple_core_get_ui_info:
*
* Returns a hash table containing various information about the UI. The