aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--embed/mozilla/MozDownload.cpp5
-rw-r--r--embed/xulrunner/components/MozDownload.cpp6
-rw-r--r--lib/ephy-file-helpers.c6
-rw-r--r--lib/ephy-file-helpers.h2
-rw-r--r--src/popup-commands.c9
5 files changed, 19 insertions, 9 deletions
diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp
index bdce1212f..d3d13d32b 100644
--- a/embed/mozilla/MozDownload.cpp
+++ b/embed/mozilla/MozDownload.cpp
@@ -404,8 +404,11 @@ MozDownload::OnStateChange (nsIWebProgress *aWebProgress, nsIRequest *aRequest,
rv = mDestination->GetSpec (aDest);
NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE);
- ephy_file_browse_to (aDest.get (), user_time);
+ GFile *dest;
+ dest = g_file_new_for_uri (aDest.get ());
+ ephy_file_browse_to (dest, user_time);
+ g_object_unref (dest);
g_strfreev (str);
}
#endif /* HAVE_GECKO_1_9 */
diff --git a/embed/xulrunner/components/MozDownload.cpp b/embed/xulrunner/components/MozDownload.cpp
index 7b935f5aa..b079b83b3 100644
--- a/embed/xulrunner/components/MozDownload.cpp
+++ b/embed/xulrunner/components/MozDownload.cpp
@@ -400,8 +400,12 @@ MozDownload::OnStateChange (nsIWebProgress *aWebProgress, nsIRequest *aRequest,
rv = mDestination->GetSpec (aDest);
NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE);
- ephy_file_browse_to (aDest.get (), user_time);
+ GFile *dest;
+ dest = g_file_new_for_uri (dest);
+ ephy_file_browse_to (dest, user_time);
+
+ g_object_unref (dest);
g_strfreev (str);
}
#endif /* HAVE_GECKO_1_9 */
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index 22e8ef9e9..79885bd59 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -702,14 +702,13 @@ ephy_file_launch_handler (const char *mime_type,
}
gboolean
-ephy_file_browse_to (const char *parameter,
+ephy_file_browse_to (GFile *file,
guint32 user_time)
{
- GFile *file, *parent, *desktop;
+ GFile *parent, *desktop;
char *desktop_dir;
gboolean ret;
- file = g_file_new_for_uri (parameter);
desktop_dir = ephy_file_desktop_dir ();
desktop = g_file_new_for_path (desktop_dir);
@@ -728,7 +727,6 @@ ephy_file_browse_to (const char *parameter,
}
g_free (desktop_dir);
- g_object_unref (file);
return ret;
}
diff --git a/lib/ephy-file-helpers.h b/lib/ephy-file-helpers.h
index 408b975cb..4bb9e3f59 100644
--- a/lib/ephy-file-helpers.h
+++ b/lib/ephy-file-helpers.h
@@ -92,7 +92,7 @@ gboolean ephy_file_launch_handler (const char *mime_type,
GFile *file,
guint32 user_time);
-gboolean ephy_file_browse_to (const char *parameter,
+gboolean ephy_file_browse_to (GFile *file,
guint32 user_time);
void ephy_file_delete_directory (const char *path);
diff --git a/src/popup-commands.c b/src/popup-commands.c
index 51b2fbfd5..330030a67 100644
--- a/src/popup-commands.c
+++ b/src/popup-commands.c
@@ -174,6 +174,7 @@ save_property_url_completed_cb (EphyEmbedPersist *persist)
EPHY_EMBED_PERSIST_ASK_DESTINATION))
{
const char *dest;
+ GFile *dest_file;
guint32 user_time;
user_time = ephy_embed_persist_get_user_time (persist);
@@ -181,9 +182,13 @@ save_property_url_completed_cb (EphyEmbedPersist *persist)
g_return_if_fail (dest != NULL);
+ dest_file = g_file_new_for_path (dest);
+
+ g_return_if_fail (dest_file != NULL);
/* If save location is the desktop, nautilus will not open */
- ephy_file_browse_to (dest, user_time);
-
+ ephy_file_browse_to (dest_file, user_time);
+
+ g_object_unref (dest_file);
}
}