baobab: Open directory in explorer patch
This commit is contained in:
parent
d93748c8e8
commit
8b964d430a
40
mingw-w64-baobab/0001-Open-directory-in-explorer.patch
Normal file
40
mingw-w64-baobab/0001-Open-directory-in-explorer.patch
Normal file
@ -0,0 +1,40 @@
|
||||
From f836c43a2d34edb1c3f9b58692d1e8c3949e4035 Mon Sep 17 00:00:00 2001
|
||||
From: Doronin Stanislav <mugisbrows@gmail.com>
|
||||
Date: Tue, 10 Aug 2021 20:45:50 +0300
|
||||
Subject: [PATCH] Open directory in explorer
|
||||
|
||||
---
|
||||
src/baobab-window.vala | 17 ++++++++++++++++-
|
||||
1 file changed, 16 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/baobab-window.vala b/src/baobab-window.vala
|
||||
index 26c5ff5..4ac55b1 100644
|
||||
--- a/src/baobab-window.vala
|
||||
+++ b/src/baobab-window.vala
|
||||
@@ -370,7 +370,22 @@ namespace Baobab {
|
||||
public void open_item (Gtk.TreeIter iter) {
|
||||
var file = active_location.scanner.get_file (iter);
|
||||
try {
|
||||
- AppInfo.launch_default_for_uri (file.get_uri (), null);
|
||||
+ string path = file.get_path();
|
||||
+ bool is_dir = FileUtils.test(path, FileTest.IS_DIR);
|
||||
+ string[] spawn_args;
|
||||
+ if (is_dir) {
|
||||
+ spawn_args = {"explorer", path};
|
||||
+ } else {
|
||||
+ spawn_args = {"explorer", "/select,", path};
|
||||
+ }
|
||||
+ string[] spawn_env = Environ.get();
|
||||
+ Pid child_pid;
|
||||
+ Process.spawn_async(".",
|
||||
+ spawn_args,
|
||||
+ spawn_env,
|
||||
+ SpawnFlags.SEARCH_PATH | SpawnFlags.DO_NOT_REAP_CHILD,
|
||||
+ null,
|
||||
+ out child_pid);
|
||||
} catch (Error e) {
|
||||
message (_("Failed to open file"), e.message, Gtk.MessageType.ERROR);
|
||||
}
|
||||
--
|
||||
2.25.1.windows.1
|
||||
|
||||
@ -23,10 +23,12 @@ options=('strip' 'staticlibs')
|
||||
license=("GPL2")
|
||||
source=("https://download.gnome.org/sources/${_realname}/${pkgver%.*}/${_realname}-${pkgver}.tar.xz"
|
||||
"0001-Fix-application-icon-name-in-baobab-main-window.ui.patch"
|
||||
"0001-Build-GUI-application-on-windows.patch")
|
||||
"0001-Build-GUI-application-on-windows.patch"
|
||||
"0001-Open-directory-in-explorer.patch")
|
||||
sha256sums=('a6aeaa2c327a997fe0d5f443ce95b785e2ba6e338fb0a026cb7dc7d7d688d1a7'
|
||||
'53b44512790623b318c07584ea72c85acaf5c1280c00dde8969e863010cb183c'
|
||||
'29fdd3e63e1b87dc9b88ee23674bda6bdd127828a8c542279ae4185a1e72f6b7')
|
||||
'29fdd3e63e1b87dc9b88ee23674bda6bdd127828a8c542279ae4185a1e72f6b7'
|
||||
'5373f48a42f48adb951f7eefe0330034f865f91e736ad8e54f29206b971df18e')
|
||||
|
||||
prepare() {
|
||||
cd "${_realname}-${pkgver}"
|
||||
@ -34,6 +36,7 @@ prepare() {
|
||||
patch --forward --strip=1 --input="${srcdir}/0001-Fix-application-icon-name-in-baobab-main-window.ui.patch"
|
||||
# https://gitlab.gnome.org/GNOME/baobab/-/merge_requests/32
|
||||
patch --forward --strip=1 --input="${srcdir}/0001-Build-GUI-application-on-windows.patch"
|
||||
patch --forward --strip=1 --input="${srcdir}/0001-Open-directory-in-explorer.patch"
|
||||
}
|
||||
|
||||
build() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user