Merge remote-tracking branch 'origin/fix_ftb_again' into integration_butchery

This commit is contained in:
Petr Mrázek 2014-03-09 23:59:47 +01:00
commit df89183c10
2 changed files with 17 additions and 2 deletions

2
.gitignore vendored
View File

@ -13,6 +13,8 @@ MultiMC5.kdev4
MultiMC.pro.user MultiMC.pro.user
CMakeLists.txt.user CMakeLists.txt.user
CMakeLists.txt.user.* CMakeLists.txt.user.*
/.project
/.settings
# Build dirs # Build dirs
build build

View File

@ -1,4 +1,3 @@
#include "MultiMC.h" #include "MultiMC.h"
#include <iostream> #include <iostream>
#include <QDir> #include <QDir>
@ -43,6 +42,11 @@
#include "logger/QsLog.h" #include "logger/QsLog.h"
#include <logger/QsLogDest.h> #include <logger/QsLogDest.h>
#ifdef Q_OS_WIN32
#include <windows.h>
static const int APPDATA_BUFFER_SIZE = 1024;
#endif
using namespace Util::Commandline; using namespace Util::Commandline;
MultiMC::MultiMC(int &argc, char **argv, bool root_override) MultiMC::MultiMC(int &argc, char **argv, bool root_override)
@ -340,7 +344,16 @@ void MultiMC::initGlobalSettings()
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
QString ftbDefault = QDir::home().absoluteFilePath(".ftblauncher"); QString ftbDefault = QDir::home().absoluteFilePath(".ftblauncher");
#elif defined(Q_OS_WIN32) #elif defined(Q_OS_WIN32)
QString ftbDefault = PathCombine(QStandardPaths::writableLocation(QStandardPaths::DataLocation), "/ftblauncher"); wchar_t buf[APPDATA_BUFFER_SIZE];
QString ftbDefault;
if(!GetEnvironmentVariableW(L"APPDATA", buf, APPDATA_BUFFER_SIZE))
{
QLOG_FATAL() << "Your APPDATA folder is missing! If you are on windows, this means your system is broken. If you aren't on windows, how the **** are you running the windows build????";
}
else
{
ftbDefault = PathCombine(QString::fromWCharArray(buf), "ftblauncher");
}
#elif defined(Q_OS_MAC) #elif defined(Q_OS_MAC)
QString ftbDefault = QString ftbDefault =
PathCombine(QDir::homePath(), "Library/Application Support/ftblauncher"); PathCombine(QDir::homePath(), "Library/Application Support/ftblauncher");