aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArnaud Maillet <arnaud.maillet@collabora.co.uk>2009-07-28 20:49:53 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-08-22 01:44:52 +0800
commit5e48d35061335282d7cf64e00dcf932dffcdfb54 (patch)
tree9e9f43495c8dcb51f937e6d4f0e73bbc84ae8b32 /src
parent735481c7e2d0d2180d5970b83722452f8aa99ae9 (diff)
downloadgsoc2013-empathy-5e48d35061335282d7cf64e00dcf932dffcdfb54.tar
gsoc2013-empathy-5e48d35061335282d7cf64e00dcf932dffcdfb54.tar.gz
gsoc2013-empathy-5e48d35061335282d7cf64e00dcf932dffcdfb54.tar.bz2
gsoc2013-empathy-5e48d35061335282d7cf64e00dcf932dffcdfb54.tar.lz
gsoc2013-empathy-5e48d35061335282d7cf64e00dcf932dffcdfb54.tar.xz
gsoc2013-empathy-5e48d35061335282d7cf64e00dcf932dffcdfb54.tar.zst
gsoc2013-empathy-5e48d35061335282d7cf64e00dcf932dffcdfb54.zip
Port empathy-import-pidgin to mc5
Diffstat (limited to 'src')
-rw-r--r--src/empathy-import-pidgin.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/empathy-import-pidgin.c b/src/empathy-import-pidgin.c
index 935c022ea..5c8221ce7 100644
--- a/src/empathy-import-pidgin.c
+++ b/src/empathy-import-pidgin.c
@@ -22,6 +22,7 @@
#include <config.h>
#include <string.h>
+#include <unistd.h>
#include <glib.h>
#include <glib/gstdio.h>
@@ -114,8 +115,7 @@ import_dialog_pidgin_parse_setting (EmpathyImportAccountData *data,
/* Search for the map corresponding to setting we are parsing */
for (i = 0; i < G_N_ELEMENTS (pidgin_cm_map); i++)
{
- if (!tp_strdiff (mc_profile_get_protocol_name (data->profile),
- pidgin_cm_map[i].protocol) &&
+ if (!tp_strdiff (data->protocol, pidgin_cm_map[i].protocol) &&
!tp_strdiff (tag_name, pidgin_cm_map[i].pidgin_name))
{
item = pidgin_cm_map + i;
@@ -199,23 +199,26 @@ empathy_import_pidgin_load (void)
if (!tp_strdiff ((gchar *) child->name,
PIDGIN_ACCOUNT_TAG_PROTOCOL))
{
- gchar *content;
+ xmlChar *content;
const gchar *protocol;
- protocol = content = (gchar *) xmlNodeGetContent (child);
+ content = xmlNodeGetContent (child);
+
+ protocol = (const gchar *) content;
if (g_str_has_prefix (protocol, "prpl-"))
protocol += 5;
- if (!tp_strdiff (protocol, PIDGIN_PROTOCOL_BONJOUR))
- protocol = "salut";
- else if (!tp_strdiff (protocol, PIDGIN_PROTOCOL_NOVELL))
- protocol = "groupwise";
+ data->protocol = g_strdup (protocol);
+
+ if (!tp_strdiff (data->protocol, PIDGIN_PROTOCOL_BONJOUR))
+ data->protocol = "salut";
+ else if (!tp_strdiff (data->protocol, PIDGIN_PROTOCOL_NOVELL))
+ data->protocol = "groupwise";
- data->profile = mc_profile_lookup (protocol);
- g_free (content);
+ xmlFree (content);
- if (data->profile == NULL)
+ if (data->protocol == NULL)
break;
}
@@ -240,8 +243,7 @@ empathy_import_pidgin_load (void)
username = name;
/* Split "username@server" if it is an IRC account */
- if (strstr (name, "@") && !tp_strdiff (
- mc_profile_get_protocol_name (data->profile), "irc"))
+ if (strstr (name, "@") && !tp_strdiff (data->protocol, "irc"))
{
nick_server = g_strsplit (name, "@", 2);
username = nick_server[0];
@@ -287,12 +289,11 @@ empathy_import_pidgin_load (void)
/* If we have the needed settings, add the account data to the list,
* otherwise free the data */
- if (data->profile != NULL && g_hash_table_size (data->settings) > 0)
+ if (data->protocol != NULL && g_hash_table_size (data->settings) > 0)
{
/* Special-case XMPP:
* http://bugzilla.gnome.org/show_bug.cgi?id=579992 */
- if (!tp_strdiff (
- mc_profile_get_protocol_name (data->profile), "jabber"))
+ if (!tp_strdiff (data->protocol, "jabber"))
{
if (EMP_STR_EMPTY (tp_asv_get_string (data->settings, "server")))
{