QTfrontend/main.cpp
changeset 2418 538a777f90c4
parent 2377 f3fab2b09e0c
child 2428 6800f8aa0184
equal deleted inserted replaced
2417:f7ed1ea25050 2418:538a777f90c4
    22 #include <QMessageBox>
    22 #include <QMessageBox>
    23 #include <QPlastiqueStyle>
    23 #include <QPlastiqueStyle>
    24 #include <QRegExp>
    24 #include <QRegExp>
    25 #include <QMap>
    25 #include <QMap>
    26 
    26 
    27 
    27 char *programname;
    28 
    28 
    29 #include "hwform.h"
    29 #include "hwform.h"
    30 #include "hwconsts.h"
    30 #include "hwconsts.h"
    31 
    31 
    32 bool checkForDir(const QString & dir)
    32 bool checkForDir(const QString & dir)
    42 			return false;
    42 			return false;
    43 		}
    43 		}
    44 	return true;
    44 	return true;
    45 }
    45 }
    46 
    46 
    47 int main(int argc, char *argv[])
    47 int main(int argc, char *argv[]) {
    48 {
    48         
       
    49        programname = argv[0];
       
    50         
    49     QApplication app(argc, argv);
    51     QApplication app(argc, argv);
    50 
    52 
    51     QStringList arguments = app.arguments();
    53     QStringList arguments = app.arguments();
    52     QMap<QString, QString> parsedArgs;
    54     QMap<QString, QString> parsedArgs;
    53     {
    55     {
   285 		);
   287 		);
   286 
   288 
   287 	bindir->cd("bin"); // workaround over NSIS installer
   289 	bindir->cd("bin"); // workaround over NSIS installer
   288 
   290 
   289 	cfgdir->setPath(cfgdir->homePath());
   291 	cfgdir->setPath(cfgdir->homePath());
       
   292         
   290 #ifdef __APPLE__
   293 #ifdef __APPLE__
   291 
       
   292 
       
   293 	if (checkForDir(cfgdir->absolutePath() + "/Library/Application Support/Hedgewars"))
   294 	if (checkForDir(cfgdir->absolutePath() + "/Library/Application Support/Hedgewars"))
   294 	{
   295 	{
   295 		checkForDir(cfgdir->absolutePath() + "/Library/Application Support/Hedgewars/Demos");
   296 		checkForDir(cfgdir->absolutePath() + "/Library/Application Support/Hedgewars/Demos");
   296 		checkForDir(cfgdir->absolutePath() + "/Library/Application Support/Hedgewars/Saves");
   297 		checkForDir(cfgdir->absolutePath() + "/Library/Application Support/Hedgewars/Saves");
   297 	}
   298 	}