mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-29 09:23:32 +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,13 +31,9 @@ void open_file(const std::string& file)
|
|||||||
|
|
||||||
void open_folder(const std::string& file)
|
void open_folder(const std::string& file)
|
||||||
{
|
{
|
||||||
if (base::launcher::support_open_folder()) {
|
|
||||||
if (!base::launcher::open_folder(file))
|
if (!base::launcher::open_folder(file))
|
||||||
ui::Alert::show("Problem<<Cannot open folder:<<%s||&Close", file.c_str());
|
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");
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace launcher
|
} // namespace launcher
|
||||||
} // namespace app
|
} // namespace app
|
||||||
|
@ -116,19 +116,12 @@ bool open_folder(const std::string& file)
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
return false;
|
int ret;
|
||||||
|
ret = system(("xdg-open \"" + file + "\"").c_str());
|
||||||
|
return (ret == 0);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool support_open_folder()
|
|
||||||
{
|
|
||||||
#if defined(_WIN32) || defined(__APPLE__)
|
|
||||||
return true;
|
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace launcher
|
} // namespace launcher
|
||||||
} // namespace base
|
} // namespace base
|
||||||
|
@ -17,8 +17,6 @@ namespace base {
|
|||||||
bool open_file(const std::string& file);
|
bool open_file(const std::string& file);
|
||||||
bool open_folder(const std::string& file);
|
bool open_folder(const std::string& file);
|
||||||
|
|
||||||
bool support_open_folder();
|
|
||||||
|
|
||||||
} // namespace launcher
|
} // namespace launcher
|
||||||
} // namespace base
|
} // namespace base
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user