summaryrefslogtreecommitdiffstats
path: root/pica-client
diff options
context:
space:
mode:
Diffstat (limited to 'pica-client')
-rw-r--r--pica-client/globals.h4
-rw-r--r--pica-client/main.cpp39
2 files changed, 18 insertions, 25 deletions
diff --git a/pica-client/globals.h b/pica-client/globals.h
index dd03bf8..ff657be 100644
--- a/pica-client/globals.h
+++ b/pica-client/globals.h
@@ -7,10 +7,7 @@
#define PICA_CLIENT_DHPARAMBITS 4096
#ifndef PICA_INSTALLPREFIX
-
#define PICA_INSTALLPREFIX "/usr"
-#define PICA_APPBUNDLENAME "PicaPicaMessenger.app"
-
#endif
#include "../PICA_id.h"
@@ -19,6 +16,7 @@
extern class QString config_dir;
extern class QString config_dbname;
extern class QString config_defaultDHParam;
+extern class QString config_resourceDir;
extern class SkyNet *skynet;
extern class MainWindow *mainwindow;
extern class AskPassword *askpassword;
diff --git a/pica-client/main.cpp b/pica-client/main.cpp
index a397d8e..43ea995 100644
--- a/pica-client/main.cpp
+++ b/pica-client/main.cpp
@@ -17,9 +17,11 @@
#include "settings.h"
#include "dialogs/settingsdialog.h"
+
//globals
QString config_dir;
QString config_dbname;
+QString config_resourceDir;
SkyNet *skynet;
MainWindow *mainwindow;
class AskPassword *askpassword;
@@ -33,20 +35,9 @@ class PicaSysTray *systray;
class FileTransferController *ftctrl;
class AccountsWindow *accwindow;
+QString config_defaultDHParam;
+QString snd_newmessage;
-#ifndef WIN32
-QString config_defaultDHParam(PICA_INSTALLPREFIX"/share/pica-client/"PICA_CLIENT_DHPARAMFILE);
-
-QString snd_newmessage(PICA_INSTALLPREFIX"/share/pica-client/picapica-snd-newmessage.wav");
-#elif defined(__APPLE__)
-QString config_defaultDHParam("./"PICA_APPBUNDLENAME"/Contents/Resources/"PICA_CLIENT_DHPARAMFILE);
-
-QString snd_newmessage("./"PICA_APPBUNDLENAME"/Contents/Resources/picapica-snd-newmessage.wav");
-#else
-QString config_defaultDHParam("share\\"PICA_CLIENT_DHPARAMFILE);
-
-QString snd_newmessage("share\\picapica-snd-newmessage.wav");
-#endif
static bool create_database()
{
@@ -488,19 +479,23 @@ int main(int argc, char *argv[])
{
QApplication a(argc, argv);
- if (!create_config_dir())
- return -1;
-#ifndef WIN32
- picapica_ico_sit = QIcon(PICA_INSTALLPREFIX"/share/pica-client/picapica-icon-sit.png");
- picapica_ico_fly = QIcon(PICA_INSTALLPREFIX"/share/pica-client/picapica-icon-fly.png");
+#ifdef WIN32
+ config_resourceDir = QLatin1String("share\\");
#elif defined(__APPLE__)
- picapica_ico_sit = QIcon("./"PICA_APPBUNDLENAME"/Contents/Resources/picapica-icon-sit.png");
- picapica_ico_fly = QIcon("./"PICA_APPBUNDLENAME"/Contents/Resources/picapica-icon-fly.png");
+ config_resourceDir = QCoreApplication::applicationDirPath() + QLatin1String("/../Resources/");
#else
- picapica_ico_sit = QIcon("share\\picapica-icon-sit.png");
- picapica_ico_fly = QIcon("share\\picapica-icon-fly.png");
+ config_resourceDir = QLatin1String(PICA_INSTALLPREFIX "/share/pica-client/");
#endif
+ if (!create_config_dir())
+ return -1;
+
+ config_defaultDHParam = config_resourceDir + QLatin1String(PICA_CLIENT_DHPARAMFILE);
+ snd_newmessage = config_resourceDir + QLatin1String("picapica-snd-newmessage.wav");
+
+ picapica_ico_sit = QIcon(config_resourceDir + "picapica-icon-sit.png");
+ picapica_ico_fly = QIcon(config_resourceDir + "picapica-icon-fly.png");
+
Settings st(config_dbname);
if (st.isEmpty()) //show settings dialog on first start