Add support for open_folder on Linux

Removed base::launcher::support_open_folder() as it would always return
true.
This commit is contained in:
Aurélien Gâteau 2015-05-15 22:36:20 +02:00
parent 02d163b8d8
commit 817b134f31
3 changed files with 5 additions and 18 deletions

View File

@ -31,13 +31,9 @@ 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");
}
} // namespace launcher
} // namespace app

View File

@ -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

View File

@ -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