mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-18 11:40:18 +00:00
Rename HexChat to ZoiteChat in dbus-client.c
This commit is contained in:
committed by
GitHub
parent
a276b08cc0
commit
975f4c8d66
@@ -1,4 +1,4 @@
|
|||||||
/* dbus-client.c - HexChat command-line options for D-Bus
|
/* dbus-client.c - ZoiteChat command-line options for D-Bus
|
||||||
* Copyright (C) 2006 Claessens Xavier
|
* Copyright (C) 2006 Claessens Xavier
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
#include "dbus-client.h"
|
#include "dbus-client.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <gio/gio.h>
|
#include <gio/gio.h>
|
||||||
#include "hexchat.h"
|
#include "zoitechat.h"
|
||||||
#include "hexchatc.h"
|
#include "zoitechatc.h"
|
||||||
|
|
||||||
#define DBUS_REMOTE_PATH "/org/hexchat/Remote"
|
#define DBUS_REMOTE_PATH "/org/zoitechat/Remote"
|
||||||
#define DBUS_REMOTE_INTERFACE "org.hexchat.plugin"
|
#define DBUS_REMOTE_INTERFACE "org.zoitechat.plugin"
|
||||||
|
|
||||||
#define DBUS_SERVICE_DBUS "org.freedesktop.DBus"
|
#define DBUS_SERVICE_DBUS "org.freedesktop.DBus"
|
||||||
#define DBUS_PATH_DBUS "/org/freedesktop/DBus"
|
#define DBUS_PATH_DBUS "/org/freedesktop/DBus"
|
||||||
@@ -54,7 +54,7 @@ new_param_variant (const char *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
hexchat_remote (void)
|
zoitechat_remote (void)
|
||||||
/* TODO: dbus_g_connection_unref (connection) are commented because it makes
|
/* TODO: dbus_g_connection_unref (connection) are commented because it makes
|
||||||
* dbus to crash. Fixed in dbus >=0.70 ?!?
|
* dbus to crash. Fixed in dbus >=0.70 ?!?
|
||||||
* https://launchpad.net/distros/ubuntu/+source/dbus/+bug/54375
|
* https://launchpad.net/distros/ubuntu/+source/dbus/+bug/54375
|
||||||
@@ -64,7 +64,7 @@ hexchat_remote (void)
|
|||||||
GDBusProxy *dbus = NULL;
|
GDBusProxy *dbus = NULL;
|
||||||
GVariant *ret;
|
GVariant *ret;
|
||||||
GDBusProxy *remote_object = NULL;
|
GDBusProxy *remote_object = NULL;
|
||||||
gboolean hexchat_running;
|
gboolean zoitechat_running;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
char *command = NULL;
|
char *command = NULL;
|
||||||
guint i;
|
guint i;
|
||||||
@@ -83,7 +83,7 @@ hexchat_remote (void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Checks if HexChat is already running */
|
/* Checks if ZoiteChat is already running */
|
||||||
dbus = g_dbus_proxy_new_sync (connection,
|
dbus = g_dbus_proxy_new_sync (connection,
|
||||||
G_DBUS_PROXY_FLAGS_NONE,
|
G_DBUS_PROXY_FLAGS_NONE,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -102,18 +102,18 @@ hexchat_remote (void)
|
|||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
write_error (_("Failed to complete NameHasOwner"), &error);
|
write_error (_("Failed to complete NameHasOwner"), &error);
|
||||||
hexchat_running = FALSE;
|
zoitechat_running = FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GVariant *child = g_variant_get_child_value (ret, 0);
|
GVariant *child = g_variant_get_child_value (ret, 0);
|
||||||
hexchat_running = g_variant_get_boolean (child);
|
zoitechat_running = g_variant_get_boolean (child);
|
||||||
g_variant_unref (ret);
|
g_variant_unref (ret);
|
||||||
g_variant_unref (child);
|
g_variant_unref (child);
|
||||||
}
|
}
|
||||||
g_object_unref (dbus);
|
g_object_unref (dbus);
|
||||||
|
|
||||||
if (!hexchat_running) {
|
if (!zoitechat_running) {
|
||||||
g_object_unref (connection);
|
g_object_unref (connection);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -129,7 +129,7 @@ hexchat_remote (void)
|
|||||||
|
|
||||||
if (!remote_object)
|
if (!remote_object)
|
||||||
{
|
{
|
||||||
write_error("Failed to connect to HexChat", &error);
|
write_error("Failed to connect to ZoiteChat", &error);
|
||||||
g_object_unref (connection);
|
g_object_unref (connection);
|
||||||
exit (0);
|
exit (0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user