aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-import-assistant.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-05-22 23:04:27 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-05-23 00:40:31 +0800
commitcec324e80ae88463e97e79ce16806127b512f931 (patch)
treef48fc49f1b22f2b216a3483cbdd6661819b3d7f3 /widgets/misc/e-import-assistant.c
parentb3f707bb6783c950b0819aa4432b69a61236d23e (diff)
downloadgsoc2013-evolution-cec324e80ae88463e97e79ce16806127b512f931.tar
gsoc2013-evolution-cec324e80ae88463e97e79ce16806127b512f931.tar.gz
gsoc2013-evolution-cec324e80ae88463e97e79ce16806127b512f931.tar.bz2
gsoc2013-evolution-cec324e80ae88463e97e79ce16806127b512f931.tar.lz
gsoc2013-evolution-cec324e80ae88463e97e79ce16806127b512f931.tar.xz
gsoc2013-evolution-cec324e80ae88463e97e79ce16806127b512f931.tar.zst
gsoc2013-evolution-cec324e80ae88463e97e79ce16806127b512f931.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/misc/e-import-assistant.c')
-rw-r--r--widgets/misc/e-import-assistant.c19
1 files changed, 8 insertions, 11 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;