mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-17 03:14:34 +01:00
Add fallback in case of xdg-utils is not installed
Some distributions may not install xdg-utils by default, so inform the user in case of xdg-utils is not installed when the user tries to use any of the xdg-utils commands.
This commit is contained in:
1 parent
b0e318f6d1
commit
a313321893
1 file changed
+10
-1
+10
-1
@@ -217,7 +217,10 @@ void LaunchBrowser(const char *url) {
|
||||
ShellExecute(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL);
|
||||
#elif __linux__
|
||||
std::string command = std::string("xdg-open ") + url;
|
||||
system(command.c_str());
|
||||
errno = system(command.c_str());
|
||||
if (errno) {
|
||||
ILOG("Would have gone to %s but xdg-utils seems not to be installed", url)
|
||||
}
|
||||
#elif __APPLE__
|
||||
std::string command = std::string("open ") + url;
|
||||
system(command.c_str());
|
||||
@@ -232,6 +235,9 @@ void LaunchMarket(const char *url) {
|
||||
#elif __linux__
|
||||
std::string command = std::string("xdg-open ") + url;
|
||||
system(command.c_str());
|
||||
if (errno) {
|
||||
ILOG("Would have gone to %s but xdg-utils seems not to be installed", url)
|
||||
}
|
||||
#elif __APPLE__
|
||||
std::string command = std::string("open ") + url;
|
||||
system(command.c_str());
|
||||
@@ -246,6 +252,9 @@ void LaunchEmail(const char *email_address) {
|
||||
#elif __linux__
|
||||
std::string command = std::string("xdg-email ") + email_address;
|
||||
system(command.c_str());
|
||||
if (errno) {
|
||||
ILOG("Would have gone to %s but xdg-utils seems not to be installed", email_address)
|
||||
}
|
||||
#elif __APPLE__
|
||||
std::string command = std::string("open mailto:") + email_address;
|
||||
system(command.c_str());
|
||||
|
||||
Reference in new issue
Block a user