From 349ceb933627955a8ea7238e2b0c1ecb904e6103 Mon Sep 17 00:00:00 2001 From: Lawrence Lee <45837045+Lawrence37@users.noreply.github.com> Date: Mon, 12 Apr 2021 21:53:04 -0700 Subject: [PATCH] Add function for opening images with Gio::AppInfo --- rtgui/extprog.cc | 5 +++++ rtgui/extprog.h | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/rtgui/extprog.cc b/rtgui/extprog.cc index 57d57ecd8..939ead608 100644 --- a/rtgui/extprog.cc +++ b/rtgui/extprog.cc @@ -339,3 +339,8 @@ bool ExtProgStore::openInCustomEditor (const Glib::ustring& fileName) #endif } + +bool ExtProgStore::openInExternalEditor(const Glib::ustring &fileName, const Glib::RefPtr &editorInfo) +{ + return editorInfo->launch(Gio::File::create_for_path(fileName)); +} diff --git a/rtgui/extprog.h b/rtgui/extprog.h index c5e00bb1b..86dbc1674 100644 --- a/rtgui/extprog.h +++ b/rtgui/extprog.h @@ -24,6 +24,11 @@ #include "threadutils.h" +namespace Gio +{ + class AppInfo; +} + struct ExtProgAction { Glib::ustring filePathEXE; @@ -64,6 +69,7 @@ public: static bool openInGimp (const Glib::ustring& fileName); static bool openInPhotoshop (const Glib::ustring& fileName); static bool openInCustomEditor (const Glib::ustring& fileName); + static bool openInExternalEditor(const Glib::ustring &fileName, const Glib::RefPtr &editorInfo); }; #define extProgStore ExtProgStore::getInstance()