Showing the changes to interface/src/Application.cpp (1 of 29 files). Show all
Unified · Split
| @@ -65,6 +65,7 @@ · 64 unmodified lines | |||
| 65 | #include <OctalCode.h> | 65 | #include <OctalCode.h> |
| 66 | #include <OctreeSceneStats.h> | 66 | #include <OctreeSceneStats.h> |
| 67 | #include <PacketHeaders.h> | 67 | #include <PacketHeaders.h> |
| 68 | #include <PathUtils.h> | ||
| 68 | #include <PerfStat.h> | 69 | #include <PerfStat.h> |
| 69 | #include <ProgramObject.h> | 70 | #include <ProgramObject.h> |
| 70 | #include <ResourceCache.h> | 71 | #include <ResourceCache.h> |
| @@ -133,15 +134,6 @@ void messageHandler(QtMsgType type, const QMessageLogContext& context, const QSt · 62 unmodified lines | |||
| 133 | } | 134 | } |
| 134 | } | 135 | } |
| 135 | 136 | ||
| 136 | QString& Application::resourcesPath() { | ||
| 137 | #ifdef Q_OS_MAC | ||
| 138 | static QString staticResourcePath = QCoreApplication::applicationDirPath() + "/../Resources/"; | ||
| 139 | #else | ||
| 140 | static QString staticResourcePath = QCoreApplication::applicationDirPath() + "/resources/"; | ||
| 141 | #endif | ||
| 142 | return staticResourcePath; | ||
| 143 | } | ||
| 144 | |||
| 145 | Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : | 137 | Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : |
| 146 | QApplication(argc, argv), | 138 | QApplication(argc, argv), |
| 147 | _window(new MainWindow(desktop())), | 139 | _window(new MainWindow(desktop())), |
| @@ -195,7 +187,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 47 unmodified lines | |||
| 195 | _aboutToQuit(false) | 187 | _aboutToQuit(false) |
| 196 | { | 188 | { |
| 197 | // read the ApplicationInfo.ini file for Name/Version/Domain information | 189 | // read the ApplicationInfo.ini file for Name/Version/Domain information |
| 198 | QSettings applicationInfo(Application::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat); | 190 | QSettings applicationInfo(PathUtils::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat); |
| 199 | 191 | ||
| 200 | // set the associated application properties | 192 | // set the associated application properties |
| 201 | applicationInfo.beginGroup("INFO"); | 193 | applicationInfo.beginGroup("INFO"); |
| @@ -213,7 +205,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 11 unmodified lines | |||
| 213 | 205 | ||
| 214 | _applicationStartupTime = startup_time; | 206 | _applicationStartupTime = startup_time; |
| 215 | 207 | ||
| 216 | QFontDatabase::addApplicationFont(Application::resourcesPath() + "styles/Inconsolata.otf"); | 208 | QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "styles/Inconsolata.otf"); |
| 217 | _window->setWindowTitle("Interface"); | 209 | _window->setWindowTitle("Interface"); |
| 218 | 210 | ||
| 219 | qInstallMessageHandler(messageHandler); | 211 | qInstallMessageHandler(messageHandler); |
| @@ -4369,7 +4361,7 @@ void Application::skipVersion(QString latestVersion) { · 4149 unmodified lines | |||
| 4369 | 4361 | ||
| 4370 | void Application::takeSnapshot() { | 4362 | void Application::takeSnapshot() { |
| 4371 | QMediaPlayer* player = new QMediaPlayer(); | 4363 | QMediaPlayer* player = new QMediaPlayer(); |
| 4372 | QFileInfo inf = QFileInfo(Application::resourcesPath() + "sounds/snap.wav"); | 4364 | QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav"); |
| 4373 | player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath())); | 4365 | player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath())); |
| 4374 | player->play(); | 4366 | player->play(); |
| 4375 | 4367 | ||