Add function for opening images with Gio::AppInfo

This commit is contained in:
Lawrence Lee
2021-04-12 21:53:04 -07:00
parent 3efbb99ba9
commit 349ceb9336
2 changed files with 11 additions and 0 deletions

View File

@@ -339,3 +339,8 @@ bool ExtProgStore::openInCustomEditor (const Glib::ustring& fileName)
#endif #endif
} }
bool ExtProgStore::openInExternalEditor(const Glib::ustring &fileName, const Glib::RefPtr<Gio::AppInfo> &editorInfo)
{
return editorInfo->launch(Gio::File::create_for_path(fileName));
}

View File

@@ -24,6 +24,11 @@
#include "threadutils.h" #include "threadutils.h"
namespace Gio
{
class AppInfo;
}
struct ExtProgAction struct ExtProgAction
{ {
Glib::ustring filePathEXE; Glib::ustring filePathEXE;
@@ -64,6 +69,7 @@ public:
static bool openInGimp (const Glib::ustring& fileName); static bool openInGimp (const Glib::ustring& fileName);
static bool openInPhotoshop (const Glib::ustring& fileName); static bool openInPhotoshop (const Glib::ustring& fileName);
static bool openInCustomEditor (const Glib::ustring& fileName); static bool openInCustomEditor (const Glib::ustring& fileName);
static bool openInExternalEditor(const Glib::ustring &fileName, const Glib::RefPtr<Gio::AppInfo> &editorInfo);
}; };
#define extProgStore ExtProgStore::getInstance() #define extProgStore ExtProgStore::getInstance()