summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2016-03-31 18:26:54 +0200
committerCarlos Soriano <csoriano@gnome.org>2016-04-14 10:35:16 +0200
commita5f7263f2e9e58431b48b719895c17556bdd4e38 (patch)
tree07dd1b6f5d1c403b249f6c21bc4766c1af966b5e
parent4dc12abb9bd5f1db51c149cc820dd6b660a94a8c (diff)
downloadnautilus-a5f7263f2e9e58431b48b719895c17556bdd4e38.tar.gz
properties-window: use get_target_uri instead of custom code
Now that we have the code to request the target uri in nautilus file, we can use that instead of our own code special casing subclasses of nautilus file. https://bugzilla.gnome.org/show_bug.cgi?id=712620
-rw-r--r--src/nautilus-properties-window.c40
1 files changed, 7 insertions, 33 deletions
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 74fcea8ba..85903e4ae 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -51,7 +51,6 @@
#include <libnautilus-private/nautilus-file-attributes.h>
#include <libnautilus-private/nautilus-file-operations.h>
#include <libnautilus-private/nautilus-file-utilities.h>
-#include <libnautilus-private/nautilus-desktop-icon-file.h>
#include <libnautilus-private/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-link.h>
#include <libnautilus-private/nautilus-metadata.h>
@@ -279,39 +278,14 @@ static NautilusFile *
get_target_file_for_original_file (NautilusFile *file)
{
NautilusFile *target_file;
- GFile *location;
- char *uri_to_display;
- NautilusDesktopLink *link;
-
- target_file = NULL;
- if (NAUTILUS_IS_DESKTOP_ICON_FILE (file)) {
- link = nautilus_desktop_icon_file_get_link (NAUTILUS_DESKTOP_ICON_FILE (file));
-
- if (link != NULL) {
- /* map to linked URI for these types of links */
- location = nautilus_desktop_link_get_activation_location (link);
- if (location) {
- target_file = nautilus_file_get (location);
- g_object_unref (location);
- }
-
- g_object_unref (link);
- }
- } else {
- uri_to_display = nautilus_file_get_activation_uri (file);
- if (uri_to_display != NULL) {
- target_file = nautilus_file_get_by_uri (uri_to_display);
- g_free (uri_to_display);
- }
- }
-
- if (target_file != NULL) {
- return target_file;
- }
+ g_autoptr (GFile) location;
+ g_autofree char *uri_to_display;
+
+ uri_to_display = nautilus_file_get_target_uri (file);
+ location = g_file_new_for_uri (uri_to_display);
+ target_file = nautilus_file_get (location);
- /* Ref passed-in file here since we've decided to use it. */
- nautilus_file_ref (file);
- return file;
+ return target_file;
}
static NautilusFile *