mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 08:14:47 -07:00
mac patches
This commit is contained in:
parent
0d63bb7316
commit
4f13c01e12
6 changed files with 43 additions and 6 deletions
|
|
@ -56,7 +56,18 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
// qInstallMsgHandler(myMessageOutput);
|
||||
QApplication app(argc, argv);
|
||||
#ifdef Q_OS_MAC
|
||||
QDir baseDir(app.applicationDirPath());
|
||||
baseDir.cdUp();
|
||||
QDir pluginsDir = baseDir;
|
||||
pluginsDir.cd("PlugIns");
|
||||
app.addLibraryPath(pluginsDir.absolutePath());
|
||||
baseDir.cdUp();
|
||||
baseDir.cdUp();
|
||||
#endif
|
||||
#ifdef Q_OS_WIN
|
||||
app.addLibraryPath(app.applicationDirPath() + "/plugins");
|
||||
#endif
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
|
||||
QCoreApplication::setOrganizationName("Cockatrice");
|
||||
|
|
@ -83,6 +94,15 @@ int main(int argc, char *argv[])
|
|||
qsrand(QDateTime::currentDateTime().toTime_t());
|
||||
|
||||
bool startMainProgram = true;
|
||||
#ifdef Q_OS_MAC
|
||||
if (!db->getLoadSuccess())
|
||||
if (db->loadCardDatabase(baseDir.absolutePath() + "/cards.xml"))
|
||||
settingsCache->setCardDatabasePath(baseDir.absolutePath() + "/cards.xml");
|
||||
if (!QDir(settingsCache->getDeckPath()).exists())
|
||||
settingsCache->setDeckPath(baseDir.absolutePath() + "/decks");
|
||||
if (!QDir(settingsCache->getPicsPath()).exists())
|
||||
settingsCache->setPicsPath(baseDir.absolutePath() + "/pics");
|
||||
#endif
|
||||
if (!db->getLoadSuccess() || !QDir(settingsCache->getDeckPath()).exists() || !QDir(settingsCache->getPicsPath()).exists()) {
|
||||
DlgSettings dlgSettings;
|
||||
dlgSettings.show();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue