aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2009-01-23 18:28:58 +0800
committerxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2009-01-23 18:28:58 +0800
commit2ae796383dcebe1f5da5428747f23ee2e33aeb12 (patch)
tree6c875f84d2338ac3214397d79d7987609b0d23d3
parentabab6bdd6d8e2fe56a40dea3803e7cfc21058488 (diff)
downloadgsoc2013-empathy-2ae796383dcebe1f5da5428747f23ee2e33aeb12.tar
gsoc2013-empathy-2ae796383dcebe1f5da5428747f23ee2e33aeb12.tar.gz
gsoc2013-empathy-2ae796383dcebe1f5da5428747f23ee2e33aeb12.tar.bz2
gsoc2013-empathy-2ae796383dcebe1f5da5428747f23ee2e33aeb12.tar.lz
gsoc2013-empathy-2ae796383dcebe1f5da5428747f23ee2e33aeb12.tar.xz
gsoc2013-empathy-2ae796383dcebe1f5da5428747f23ee2e33aeb12.tar.zst
gsoc2013-empathy-2ae796383dcebe1f5da5428747f23ee2e33aeb12.zip
Add a source field to specify the name of the account source. (Stephane Wirtel)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk> git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@2245 4ee84921-47dd-4033-b63a-18d7a039a3e4
-rw-r--r--src/empathy-import-dialog.c9
-rw-r--r--src/empathy-import-dialog.h4
-rw-r--r--src/empathy-import-pidgin.c2
3 files changed, 11 insertions, 4 deletions
diff --git a/src/empathy-import-dialog.c b/src/empathy-import-dialog.c
index ddf264324..7aa537afa 100644
--- a/src/empathy-import-dialog.c
+++ b/src/empathy-import-dialog.c
@@ -60,13 +60,16 @@ enum
};
EmpathyImportAccountData *
-empathy_import_account_data_new (void)
+empathy_import_account_data_new (const gchar *source)
{
EmpathyImportAccountData *data;
+ g_return_val_if_fail (!G_STR_EMPTY (source), NULL);
+
data = g_slice_new0 (EmpathyImportAccountData);
data->settings = g_hash_table_new_full (g_str_hash, g_str_equal, NULL,
(GDestroyNotify) tp_g_value_slice_free);
+ data->source = g_strdup (source);
return data;
}
@@ -80,6 +83,8 @@ empathy_import_account_data_free (EmpathyImportAccountData *data)
g_object_unref (data->profile);
if (data->settings != NULL)
g_hash_table_destroy (data->settings);
+ if (data->source != NULL)
+ g_free (data->source);
g_slice_free (EmpathyImportAccountData, data);
}
@@ -197,7 +202,7 @@ import_dialog_add_accounts_to_model (EmpathyImportDialog *dialog)
COL_IMPORT, import,
COL_PROTOCOL, mc_profile_get_display_name (data->profile),
COL_NAME, g_value_get_string (value),
- COL_SOURCE, "Pidgin",
+ COL_SOURCE, data->source,
COL_ACCOUNT_DATA, data,
-1);
}
diff --git a/src/empathy-import-dialog.h b/src/empathy-import-dialog.h
index 68fd6e17a..1d616e387 100644
--- a/src/empathy-import-dialog.h
+++ b/src/empathy-import-dialog.h
@@ -32,9 +32,11 @@ typedef struct
GHashTable *settings;
/* The profile to use for this account */
McProfile *profile;
+ /* The name of the account import source */
+ gchar *source;
} EmpathyImportAccountData;
-EmpathyImportAccountData *empathy_import_account_data_new (void);
+EmpathyImportAccountData *empathy_import_account_data_new (const gchar *source);
void empathy_import_account_data_free (EmpathyImportAccountData *data);
void empathy_import_dialog_show (GtkWindow *parent, gboolean warning);
diff --git a/src/empathy-import-pidgin.c b/src/empathy-import-pidgin.c
index aedad4e62..6c40bccf6 100644
--- a/src/empathy-import-pidgin.c
+++ b/src/empathy-import-pidgin.c
@@ -188,7 +188,7 @@ empathy_import_pidgin_load (void)
continue;
/* Create account data struct */
- data = empathy_import_account_data_new ();
+ data = empathy_import_account_data_new ("Pidgin");
/* Parse account's child nodes to fill the account data struct */
for (child = node->children; child; child = child->next)