Skip to content

Commit

Permalink
Prefer launching target URI
Browse files Browse the repository at this point in the history
  • Loading branch information
kra-mo committed Dec 16, 2023
1 parent 95a339e commit 9241c44
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hyperplane/item_sorter.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def do_compare(
else:
return self.__ordering_from_cmpfunc(
GLib.DateTime.compare(
recent_info2.get_added(), recent_info1.get_added()
recent_info2.get_modified(), recent_info1.get_modified()
)
)

Expand Down
11 changes: 9 additions & 2 deletions hyperplane/items_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def __get_list(
Gio.FILE_ATTRIBUTE_THUMBNAIL_PATH,
Gio.FILE_ATTRIBUTE_STANDARD_IS_HIDDEN,
Gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME,
Gio.FILE_ATTRIBUTE_STANDARD_TARGET_URI, # For Recent
Gio.FILE_ATTRIBUTE_STANDARD_TARGET_URI, # For Recent
)
)
if gfile:
Expand Down Expand Up @@ -227,7 +227,14 @@ def activate(self, _grid_view: Gtk.GridView, pos: int) -> None:
self.get_root().tab_view.get_selected_page().get_child().new_page(gfile)
return

Gio.AppInfo.launch_default_for_uri(uri := gfile.get_uri())
if not (
uri := file_info.get_attribute_string(
Gio.FILE_ATTRIBUTE_STANDARD_TARGET_URI
)
):
uri = gfile.get_uri()

Gio.AppInfo.launch_default_for_uri(uri)

recent_data = Gtk.RecentData()
recent_data.display_name = file_info.get_display_name()
Expand Down

0 comments on commit 9241c44

Please sign in to comment.