myQtHelper->getDataPath() removed

This commit is contained in:
doitux
2007-09-08 22:01:30 +00:00
parent d3be07bb17
commit 26390ac1a7
12 changed files with 66 additions and 35 deletions
+17
View File
@@ -248,6 +248,23 @@ unix: !mac{
message("Found libboost_thread") message("Found libboost_thread")
LIBS += -lboost_thread LIBS += -lboost_thread
} }
exists( /usr/lib/libboost_filesystem-mt.so ){
message("Found libboost_filesystem-mt")
LIBS += -lboost_filesystem-mt
}
exists( /usr/lib64/libboost_filesystem-mt.so ){
message("Found libboost_filesystem-mt")
LIBS += -lboost_filesystem-mt
}
exists( /usr/lib/libboost_filesystem.so ){
message("Found libboost_filesystem")
LIBS += -lboost_filesystem
}
exists( /usr/lib64/libboost_filesystem.so ){
message("Found libboost_filesystem")
LIBS += -lboost_filesystem
}
LIBPATH += lib LIBPATH += lib
LIBS += -lpokerth_lib LIBS += -lpokerth_lib
LIBS += -lcrypto -lSDL_mixer LIBS += -lcrypto -lSDL_mixer
+17
View File
@@ -127,6 +127,23 @@ unix:!mac{
message("Found libboost_thread") message("Found libboost_thread")
LIBS += -lboost_thread LIBS += -lboost_thread
} }
exists( /usr/lib/libboost_filesystem-mt.so ){
message("Found libboost_filesystem-mt")
LIBS += -lboost_filesystem-mt
}
exists( /usr/lib64/libboost_filesystem-mt.so ){
message("Found libboost_filesystem-mt")
LIBS += -lboost_filesystem-mt
}
exists( /usr/lib/libboost_filesystem.so ){
message("Found libboost_filesystem")
LIBS += -lboost_filesystem
}
exists( /usr/lib64/libboost_filesystem.so ){
message("Found libboost_filesystem")
LIBS += -lboost_filesystem
}
LIBPATH += lib LIBPATH += lib
LIBS += -lpokerth_lib LIBS += -lpokerth_lib
LIBS += -lcrypto LIBS += -lcrypto
+1 -1
View File
@@ -2477,7 +2477,7 @@ void mainWindowImpl::breakButtonClicked() {
void mainWindowImpl::paintStartSplash() { void mainWindowImpl::paintStartSplash() {
StartSplash *mySplash = new StartSplash(this); StartSplash *mySplash = new StartSplash(this, myConfig);
#ifdef __APPLE__ #ifdef __APPLE__
int offset = 305; int offset = 305;
@@ -19,16 +19,19 @@
***************************************************************************/ ***************************************************************************/
#include "startsplash.h" #include "startsplash.h"
StartSplash::StartSplash(mainWindowImpl *parent) #include "configfile.h"
: QSplashScreen(parent), myW(parent) #include "mainwindowimpl.h"
StartSplash::StartSplash(mainWindowImpl *parent, ConfigFile *c)
: QSplashScreen(parent), myW(parent), myConfig(c)
{ {
myQtHelper = new QtHelper; myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str());
QFontDatabase::addApplicationFont (myQtHelper->getDataPath() +"fonts/c059013l.pfb"); QFontDatabase::addApplicationFont (myAppDataPath +"fonts/c059013l.pfb");
QFontDatabase::addApplicationFont (myQtHelper->getDataPath() +"fonts/andybold.ttf"); QFontDatabase::addApplicationFont (myAppDataPath +"fonts/andybold.ttf");
logo = myQtHelper->getDataPath()+"gfx/gui/misc/logoChip3D.png"; logo = myAppDataPath+"gfx/gui/misc/logoChip3D.png";
frameNo = 52; frameNo = 52;
@@ -12,17 +12,16 @@
#ifndef STARTSPLASH_H #ifndef STARTSPLASH_H
#define STARTSPLASH_H #define STARTSPLASH_H
#include "mainwindowimpl.h"
#include "qthelper.h"
#include <QtGui> #include <QtGui>
#include <QtCore> #include <QtCore>
class mainWindowImpl;
class ConfigFile;
class StartSplash : public QSplashScreen class StartSplash : public QSplashScreen
{ {
Q_OBJECT Q_OBJECT
public: public:
StartSplash(mainWindowImpl *); StartSplash(mainWindowImpl *, ConfigFile*);
~StartSplash(); ~StartSplash();
@@ -39,8 +38,9 @@ public slots:
private: private:
mainWindowImpl *myW; mainWindowImpl *myW;
QtHelper *myQtHelper; QString myAppDataPath;
QPixmap logo; QPixmap logo;
ConfigFile *myConfig;
}; };
@@ -29,9 +29,9 @@ selectAvatarDialogImpl::selectAvatarDialogImpl(QWidget *parent, ConfigFile *c)
setupUi(this); setupUi(this);
myQtHelper = new QtHelper; myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str());
pushButton_OpenAvatarFile->setIcon(QIcon(QPixmap(myQtHelper->getDataPath()+"gfx/gui/misc/fileopen16.png"))); pushButton_OpenAvatarFile->setIcon(QIcon(QPixmap(myAppDataPath+"gfx/gui/misc/fileopen16.png")));
// listWidget->setViewMode(QListView::IconMode); // listWidget->setViewMode(QListView::IconMode);
// listWidget->setIconSize(QSize(50,50)); // listWidget->setIconSize(QSize(50,50));
@@ -25,8 +25,6 @@
#include <QtCore> #include <QtCore>
#include <QtGui> #include <QtGui>
#include "qthelper.h"
class ConfigFile; class ConfigFile;
class selectAvatarDialogImpl; class selectAvatarDialogImpl;
@@ -53,11 +51,11 @@ public slots:
private: private:
ConfigFile* myConfig; ConfigFile* myConfig;
QtHelper *myQtHelper;
bool settingsCorrect; bool settingsCorrect;
QString externalAvatar; QString externalAvatar;
QString avatarDir; QString avatarDir;
QString myAppDataPath;
}; };
@@ -31,10 +31,10 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva
setupUi(this); setupUi(this);
QtHelper *myQtHelper = new QtHelper; myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str());
pushButton_openFlipsidePicture->setIcon(QIcon(QPixmap(myQtHelper->getDataPath()+"gfx/gui/misc/fileopen16.png"))); pushButton_openFlipsidePicture->setIcon(QIcon(QPixmap(myAppDataPath+"gfx/gui/misc/fileopen16.png")));
pushButton_openLogDir->setIcon(QIcon(QPixmap(myQtHelper->getDataPath()+"gfx/gui/misc/fileopen16.png"))); pushButton_openLogDir->setIcon(QIcon(QPixmap(myAppDataPath+"gfx/gui/misc/fileopen16.png")));
if (myConfig->readConfigInt("CLA_NoWriteAccess")) { groupBox_logOnOff->setDisabled(TRUE); } if (myConfig->readConfigInt("CLA_NoWriteAccess")) { groupBox_logOnOff->setDisabled(TRUE); }
@@ -23,8 +23,6 @@
#include "ui_settingsdialog.h" #include "ui_settingsdialog.h"
#include "selectavatardialogimpl.h" #include "selectavatardialogimpl.h"
#include "qthelper.h"
#include <QtCore> #include <QtCore>
#include <QtGui> #include <QtGui>
@@ -68,6 +66,7 @@ private:
ConfigFile* myConfig; ConfigFile* myConfig;
selectAvatarDialogImpl* mySelectAvatarDialogImpl; selectAvatarDialogImpl* mySelectAvatarDialogImpl;
QString myAppDataPath;
}; };
+2 -2
View File
@@ -25,7 +25,7 @@ SDLPlayer::SDLPlayer(ConfigFile *c)
SDL_Init(SDL_INIT_AUDIO); SDL_Init(SDL_INIT_AUDIO);
initAudio(); initAudio();
myQtHelper = new QtHelper; myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str());
} }
@@ -56,7 +56,7 @@ void SDLPlayer::playSound(string audioString, int playerID) {
if(audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) { if(audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) {
QFile myFile(myQtHelper->getDataPath() + "sounds/default/" + QString::fromStdString(audioString)+".wav"); QFile myFile(myAppDataPath + "sounds/default/" + QString::fromStdString(audioString)+".wav");
if(myFile.open(QIODevice::ReadOnly)) { if(myFile.open(QIODevice::ReadOnly)) {
+1 -2
View File
@@ -15,7 +15,6 @@
#define SDLPLAYER_H #define SDLPLAYER_H
#include "configfile.h" #include "configfile.h"
#include "qthelper.h"
#if (defined _WIN32) || (defined __APPLE__) #if (defined _WIN32) || (defined __APPLE__)
#include <SDL_mixer.h> #include <SDL_mixer.h>
@@ -53,7 +52,7 @@ private:
bool audioEnabled; bool audioEnabled;
ConfigFile *myConfig; ConfigFile *myConfig;
QtHelper *myQtHelper; QString myAppDataPath;
}; };
+5 -7
View File
@@ -36,8 +36,6 @@
#include <QtGui> #include <QtGui>
#include <QtCore> #include <QtCore>
#include "qthelper.h"
#include <cstdlib> #include <cstdlib>
#include <ctime> #include <ctime>
@@ -68,7 +66,6 @@ int main( int argc, char **argv )
{ {
//create defaultconfig //create defaultconfig
ConfigFile *myConfig = new ConfigFile(argc, argv); ConfigFile *myConfig = new ConfigFile(argc, argv);
QtHelper *myQtHelper = new QtHelper;
//ENABLE_LEAK_CHECK(); //ENABLE_LEAK_CHECK();
//_CrtSetBreakAlloc(49937); //_CrtSetBreakAlloc(49937);
@@ -81,13 +78,14 @@ int main( int argc, char **argv )
// set PlastiqueStyle even for mac-version to prevent artefacts on styled widgets // set PlastiqueStyle even for mac-version to prevent artefacts on styled widgets
a.setStyle(new QPlastiqueStyle); a.setStyle(new QPlastiqueStyle);
QString myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str());
//set QApplication default font //set QApplication default font
#ifdef _WIN32 #ifdef _WIN32
QString font1String("font-family: \"Arial\";"); QString font1String("font-family: \"Arial\";");
#else #else
QFontDatabase::addApplicationFont (myQtHelper->getDataPath() +"fonts/n019003l.pfb"); QFontDatabase::addApplicationFont (myAppDataPath +"fonts/n019003l.pfb");
QFontDatabase::addApplicationFont (myQtHelper->getDataPath() +"fonts/VeraBd.ttf"); QFontDatabase::addApplicationFont (myAppDataPath +"fonts/VeraBd.ttf");
QString font1String("font-family: \"Nimbus Sans L\";"); QString font1String("font-family: \"Nimbus Sans L\";");
#endif #endif
@@ -95,11 +93,11 @@ int main( int argc, char **argv )
//Set translations //Set translations
QTranslator qtTranslator; QTranslator qtTranslator;
qtTranslator.load(QString(myQtHelper->getDataPath() +"translations/qt_") + QString::fromStdString(myConfig->readConfigString("Language"))); qtTranslator.load(QString(myAppDataPath +"translations/qt_") + QString::fromStdString(myConfig->readConfigString("Language")));
a.installTranslator(&qtTranslator); a.installTranslator(&qtTranslator);
QTranslator translator; QTranslator translator;
translator.load(QString(myQtHelper->getDataPath() +"translations/pokerth_") + QString::fromStdString(myConfig->readConfigString("Language"))); translator.load(QString(myAppDataPath +"translations/pokerth_") + QString::fromStdString(myConfig->readConfigString("Language")));
a.installTranslator(&translator); a.installTranslator(&translator);