Fix external editor on macOS

Avoid using Gio::AppInfo.
This commit is contained in:
Lawrence Lee
2023-07-31 22:57:57 -07:00
parent b68a6e9581
commit a626bdae3e
5 changed files with 59 additions and 20 deletions

View File

@@ -42,6 +42,13 @@ struct ExtProgAction
bool execute (const std::vector<Glib::ustring>& fileNames) const;
};
struct EditorInfo
{
Glib::ustring name;
Glib::ustring commandline;
bool isNativeCommand;
};
// Stores all external programs that could be called by the user
class ExtProgStore
{
@@ -70,7 +77,7 @@ public:
static bool openInGimp (const Glib::ustring& fileName);
static bool openInPhotoshop (const Glib::ustring& fileName);
static bool openInCustomEditor (const Glib::ustring& fileName, const Glib::ustring* command = nullptr);
static bool openInExternalEditor(const Glib::ustring &fileName, const Glib::RefPtr<Gio::AppInfo> &editorInfo, bool nativeCommand);
static bool openInExternalEditor(const Glib::ustring &fileName, const EditorInfo &editorInfo);
};
#define extProgStore ExtProgStore::getInstance()