comparison src/main.cpp @ 196:38d726399c90

Fix #889 for non-Mac platforms and leave a note about Macs
author Chris Cannam
date Wed, 05 Mar 2014 11:27:24 +0000
parents a9491d167efa
children a3e9ddb7bb8b
comparison
equal deleted inserted replaced
195:797395e56489 196:38d726399c90
144 } 144 }
145 #endif 145 #endif
146 146
147 TonyApplication application(argc, argv); 147 TonyApplication application(argc, argv);
148 148
149 // QStringList args = application.arguments(); 149 // For some weird reason, Mac builds are crashing on startup when
150 // this line is present. Eliminate it on that platform for now.
151 #ifndef Q_OS_MAC
152 QStringList args = application.arguments();
153 #else
154 cerr << "NOTE: Command-line arguments are currently disabled on Mac, see comments in main.cpp" << endl;
150 QStringList args; 155 QStringList args;
156 #endif
151 157
152 signal(SIGINT, signalHandler); 158 signal(SIGINT, signalHandler);
153 signal(SIGTERM, signalHandler); 159 signal(SIGTERM, signalHandler);
154 160
155 #ifndef Q_OS_WIN32 161 #ifndef Q_OS_WIN32
282 static bool havePriorCommandLineModel = false; 288 static bool havePriorCommandLineModel = false;
283 289
284 if (!m_mainWindow) return; 290 if (!m_mainWindow) return;
285 291
286 MainWindow::FileOpenStatus status = MainWindow::FileOpenFailed; 292 MainWindow::FileOpenStatus status = MainWindow::FileOpenFailed;
293
294 #ifdef Q_OS_WIN32
295 path.replace("\\", "/");
296 #endif
287 297
288 if (path.endsWith("ton")) { 298 if (path.endsWith("ton")) {
289 if (!haveSession) { 299 if (!haveSession) {
290 status = m_mainWindow->openSessionFile(path); 300 status = m_mainWindow->openSessionFile(path);
291 if (status == MainWindow::FileOpenSucceeded) { 301 if (status == MainWindow::FileOpenSucceeded) {