Skip to content

Commit b9840b3

Browse files
Support OSX build
1 parent 2d50210 commit b9840b3

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

sources/all.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ DESTDIR = ./bin
99

1010
SUBDIRS = plugins/scg \
1111
#plugins/scn \
12-
plugins/scs \
12+
# plugins/scs \
1313
kbe
1414

1515
#win32: SUBDIRS += updater

sources/kbe/main.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,17 @@ int main(int argc, char *argv[])
3232
a.setApplicationName("KBE");
3333

3434
a.setAttribute(Qt::AA_DontShowIconsInMenus, false);
35-
QDir root_dir = a.applicationDirPath();
35+
36+
QDir binPath(QCoreApplication::applicationDirPath());
37+
38+
/* Set working directory */
39+
#ifdef Q_OS_MAC
40+
binPath.cdUp(); /* Fix this on Mac because of the .app folder, */
41+
binPath.cdUp(); /* which means that the actual executable is */
42+
binPath.cdUp(); /* three levels deep. Grrr. */
43+
#endif
44+
45+
QDir root_dir = binPath;
3646

3747
//#if KBE_DEBUG_MODE
3848
// root_dir.cdUp();
@@ -48,6 +58,7 @@ int main(int argc, char *argv[])
4858

4959
//splash.showMessage("Load Translation", Qt::AlignBottom | Qt::AlignHCenter);
5060

61+
5162
QTranslator myappTranslator;
5263
myappTranslator.load(":/media/translations/lang_" + QLocale::system().name() + ".qm");
5364
a.installTranslator(&myappTranslator);

0 commit comments

Comments
 (0)