mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-28 15:20:15 +00:00
Add support for open_folder on Linux
Removed base::launcher::support_open_folder() as it would always return true.
This commit is contained in:
parent
02d163b8d8
commit
817b134f31
@ -31,12 +31,8 @@ void open_file(const std::string& file)
|
||||
|
||||
void open_folder(const std::string& file)
|
||||
{
|
||||
if (base::launcher::support_open_folder()) {
|
||||
if (!base::launcher::open_folder(file))
|
||||
ui::Alert::show("Problem<<Cannot open folder:<<%s||&Close", file.c_str());
|
||||
}
|
||||
else
|
||||
ui::Alert::show("Problem<<This command is not supported on your platform||&Close");
|
||||
if (!base::launcher::open_folder(file))
|
||||
ui::Alert::show("Problem<<Cannot open folder:<<%s||&Close", file.c_str());
|
||||
}
|
||||
|
||||
} // namespace launcher
|
||||
|
@ -116,19 +116,12 @@ bool open_folder(const std::string& file)
|
||||
|
||||
#else
|
||||
|
||||
return false;
|
||||
int ret;
|
||||
ret = system(("xdg-open \"" + file + "\"").c_str());
|
||||
return (ret == 0);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
bool support_open_folder()
|
||||
{
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace launcher
|
||||
} // namespace base
|
||||
|
@ -17,8 +17,6 @@ namespace base {
|
||||
bool open_file(const std::string& file);
|
||||
bool open_folder(const std::string& file);
|
||||
|
||||
bool support_open_folder();
|
||||
|
||||
} // namespace launcher
|
||||
} // namespace base
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user