aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-05-22 23:04:27 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:42:19 +0800
commit9a2cffb0570bbde009ef45ae19c00059a9804e02 (patch)
tree5c04da6305e1aef66921295d9c318d9a577f19dd /widgets
parentdf724f165213ea60a5a8dd45c3e7b6ca829d4dac (diff)
downloadgsoc2013-evolution-9a2cffb0570bbde009ef45ae19c00059a9804e02.tar.gz
gsoc2013-evolution-9a2cffb0570bbde009ef45ae19c00059a9804e02.tar.zst
gsoc2013-evolution-9a2cffb0570bbde009ef45ae19c00059a9804e02.zip
Bug 650491 - Shell handles forwarding uris to existing process wrong
This adds a "handle-uris" GAction which takes a string array argument, so the URIs can be passed to the primary process verbatim.
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/e-import-assistant.c19
-rw-r--r--widgets/misc/e-import-assistant.h2
2 files changed, 9 insertions, 12 deletions
diff --git a/widgets/misc/e-import-assistant.c b/widgets/misc/e-import-assistant.c
index 521e8fb76b..5d612a9de7 100644
--- a/widgets/misc/e-import-assistant.c
+++ b/widgets/misc/e-import-assistant.c
@@ -984,7 +984,8 @@ forward_cb (gint current_page,
}
static gboolean
-set_import_uris (EImportAssistant *assistant, gchar **uris)
+set_import_uris (EImportAssistant *assistant,
+ const gchar * const *uris)
{
EImportAssistantPrivate *priv;
GPtrArray *fileuris = NULL;
@@ -998,12 +999,12 @@ set_import_uris (EImportAssistant *assistant, gchar **uris)
priv = E_IMPORT_ASSISTANT (assistant)->priv;
for (i = 0; uris[i]; i++) {
- gchar *uri = uris[i];
+ const gchar *uri = uris[i];
gchar *filename;
filename = g_filename_from_uri (uri, NULL, NULL);
if (!filename)
- filename = uri;
+ filename = g_strdup (uri);
if (filename && *filename && g_file_test (filename, G_FILE_TEST_IS_REGULAR)) {
gchar *furi;
@@ -1015,9 +1016,7 @@ set_import_uris (EImportAssistant *assistant, gchar **uris)
tmp = g_build_filename (curr, filename, NULL);
g_free (curr);
- if (filename != uri)
- g_free (filename);
-
+ g_free (filename);
filename = tmp;
}
@@ -1041,8 +1040,7 @@ set_import_uris (EImportAssistant *assistant, gchar **uris)
g_free (furi);
if (fileuris == NULL) {
- if (filename != uri)
- g_free (filename);
+ g_free (filename);
break;
}
}
@@ -1052,8 +1050,7 @@ set_import_uris (EImportAssistant *assistant, gchar **uris)
g_ptr_array_add (fileuris, furi);
}
- if (filename != uri)
- g_free (filename);
+ g_free (filename);
}
if (fileuris != NULL) {
@@ -1394,7 +1391,7 @@ e_import_assistant_new (GtkWindow *parent)
*/
GtkWidget *
e_import_assistant_new_simple (GtkWindow *parent,
- gchar **uris)
+ const gchar * const *uris)
{
GtkWidget *assistant;
diff --git a/widgets/misc/e-import-assistant.h b/widgets/misc/e-import-assistant.h
index c0675c75f8..e120844dfd 100644
--- a/widgets/misc/e-import-assistant.h
+++ b/widgets/misc/e-import-assistant.h
@@ -61,7 +61,7 @@ struct _EImportAssistantClass {
GType e_import_assistant_get_type (void);
GtkWidget * e_import_assistant_new (GtkWindow *parent);
GtkWidget * e_import_assistant_new_simple (GtkWindow *parent,
- gchar **uris);
+ const gchar * const *uris);
G_END_DECLS