Merge branch 'origin/master'

This commit is contained in:
David Capello 2015-05-18 15:03:48 -03:00
commit 026972a7b9
3 changed files with 5 additions and 18 deletions

View File

@ -31,12 +31,8 @@ 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

View File

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

View File

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