From 250cdae0e5b75b153aa6fe723f8ac85343a79253 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Tue, 8 Nov 2011 19:39:16 +1000 Subject: [PATCH] Being specific about which open is called on mac --- preferencesdialog.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/preferencesdialog.cpp b/preferencesdialog.cpp index 96c93726..a116deab 100644 --- a/preferencesdialog.cpp +++ b/preferencesdialog.cpp @@ -279,13 +279,17 @@ void PreferencesDialog::Save() // /myApp.app/Contents/MacOS/myApp //apppath=QApplication::instance()->applicationDirPath()+"/../../../SleepyHead.app"; apppath=QApplication::instance()->applicationDirPath().section("/",0,-3); - if (QDesktopServices::openUrl(apppath)) { - QApplication::instance()->exit(); - } else if (QProcess::startDetached("open",QStringList() << apppath)) { - QApplication::instance()->exit(); - } else { - 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); + bool success=false; + //if (QDesktopServices::openUrl(apppath)) { + // success=true; + //} else + if (QProcess::startDetached("/usr/bin/open",QStringList() << apppath)) { + 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 apppath=QApplication::instance()->applicationFilePath();