Being specific about which open is called on mac

This commit is contained in:
Mark Watkins 2011-11-08 19:39:16 +10:00
parent e088d09723
commit 250cdae0e5

View File

@ -279,13 +279,17 @@ void PreferencesDialog::Save()
// <base-path>/myApp.app/Contents/MacOS/myApp // <base-path>/myApp.app/Contents/MacOS/myApp
//apppath=QApplication::instance()->applicationDirPath()+"/../../../SleepyHead.app"; //apppath=QApplication::instance()->applicationDirPath()+"/../../../SleepyHead.app";
apppath=QApplication::instance()->applicationDirPath().section("/",0,-3); apppath=QApplication::instance()->applicationDirPath().section("/",0,-3);
if (QDesktopServices::openUrl(apppath)) { bool success=false;
QApplication::instance()->exit(); //if (QDesktopServices::openUrl(apppath)) {
} else if (QProcess::startDetached("open",QStringList() << apppath)) { // success=true;
QApplication::instance()->exit(); //} else
} else { if (QProcess::startDetached("/usr/bin/open",QStringList() << apppath)) {
QMessageBox::warning(this,"Gah!","If you can read this, two seperate application restart commands didn't work. Mark want's to know the following string:"+apppath,QMessageBox::Ok); success=true;
} }
if (!success) {
QMessageBox::warning(this,"Gah!","If you can read this, two seperate application restart commands didn't work. Mark want's to know the following string:"+apppath,QMessageBox::Ok);
} else QApplication::instance()->exit();
#else #else
apppath=QApplication::instance()->applicationFilePath(); apppath=QApplication::instance()->applicationFilePath();