summaryrefslogtreecommitdiffstats
path: root/libmultimc
diff options
context:
space:
mode:
Diffstat (limited to 'libmultimc')
-rw-r--r--libmultimc/include/appsettings.h4
-rw-r--r--libmultimc/include/logintask.h8
-rw-r--r--libmultimc/src/appsettings.cpp3
-rw-r--r--libmultimc/src/instancelist.cpp2
-rw-r--r--libmultimc/src/logintask.cpp22
5 files changed, 20 insertions, 19 deletions
diff --git a/libmultimc/include/appsettings.h b/libmultimc/include/appsettings.h
index 66ffb7b5..8447d58b 100644
--- a/libmultimc/include/appsettings.h
+++ b/libmultimc/include/appsettings.h
@@ -18,11 +18,11 @@
#include <QObject>
-#include <basicsettingsobject.h>
+#include <inisettingsobject.h>
#include "libmmc_config.h"
-class LIBMULTIMC_EXPORT AppSettings : public BasicSettingsObject
+class LIBMULTIMC_EXPORT AppSettings : public INISettingsObject
{
Q_OBJECT
public:
diff --git a/libmultimc/include/logintask.h b/libmultimc/include/logintask.h
index c1efb223..e00609ec 100644
--- a/libmultimc/include/logintask.h
+++ b/libmultimc/include/logintask.h
@@ -30,20 +30,20 @@ class LIBMULTIMC_EXPORT LoginTask : public Task
{
Q_OBJECT
public:
- explicit LoginTask(const UserInfo& uInfo, QObject *parent = 0);
+ explicit LoginTask(const UserInfo& uInfo, QString inst, QObject *parent = 0);
public slots:
void processNetReply(QNetworkReply* reply);
signals:
- void loginComplete(LoginResponse loginResponse);
- void loginFailed(const QString& errorMsg);
+ void loginComplete(QString inst, LoginResponse loginResponse);
+ void loginFailed(QString inst, const QString& errorMsg);
protected:
void executeTask();
QNetworkReply* netReply;
-
+ QString inst;
UserInfo uInfo;
};
diff --git a/libmultimc/src/appsettings.cpp b/libmultimc/src/appsettings.cpp
index 68d2c015..7c886fdb 100644
--- a/libmultimc/src/appsettings.cpp
+++ b/libmultimc/src/appsettings.cpp
@@ -18,10 +18,11 @@
#include <setting.h>
#include <QPoint>
+#include <QApplication>
//#include <QColor>
AppSettings::AppSettings(QObject *parent) :
- BasicSettingsObject(parent)
+ INISettingsObject(QApplication::applicationDirPath() + "/multimc.cfg",parent)
{
// Updates
registerSetting(new Setting("UseDevBuilds", false));
diff --git a/libmultimc/src/instancelist.cpp b/libmultimc/src/instancelist.cpp
index 3b0b668f..78650634 100644
--- a/libmultimc/src/instancelist.cpp
+++ b/libmultimc/src/instancelist.cpp
@@ -28,7 +28,7 @@
InstanceList::InstanceList(const QString &instDir, QObject *parent) :
- QObject(parent), m_instDir(instDir)
+ QObject(parent), m_instDir("instances")
{
}
diff --git a/libmultimc/src/logintask.cpp b/libmultimc/src/logintask.cpp
index 71075630..e042a93f 100644
--- a/libmultimc/src/logintask.cpp
+++ b/libmultimc/src/logintask.cpp
@@ -24,8 +24,8 @@
#include <QUrl>
#include <QUrlQuery>
-LoginTask::LoginTask(const UserInfo &uInfo, QObject *parent) :
- Task(parent), uInfo(uInfo)
+LoginTask::LoginTask( const UserInfo& uInfo, QString inst, QObject* parent ) :
+ Task(parent), uInfo(uInfo), inst(inst)
{
}
@@ -78,42 +78,42 @@ void LoginTask::processNetReply(QNetworkReply *reply)
QString sessionID = strings[3];
LoginResponse response(username, sessionID, latestVersion);
- emit loginComplete(response);
+ emit loginComplete(inst, response);
}
else
{
- emit loginFailed("Failed to parse Minecraft version string.");
+ emit loginFailed(inst, "Failed to parse Minecraft version string.");
}
}
else
{
if (responseStr.toLower() == "bad login")
- emit loginFailed("Invalid username or password.");
+ emit loginFailed(inst, "Invalid username or password.");
else if (responseStr.toLower() == "old version")
- emit loginFailed("Launcher outdated, please update.");
+ emit loginFailed(inst, "Launcher outdated, please update.");
else
- emit loginFailed("Login failed: " + responseStr);
+ emit loginFailed(inst, "Login failed: " + responseStr);
}
}
else if (responseCode == 503)
{
- emit loginFailed("The login servers are currently unavailable. "
+ emit loginFailed(inst, "The login servers are currently unavailable. "
"Check http://help.mojang.com/ for more info.");
}
else
{
- emit loginFailed(QString("Login failed: Unknown HTTP error %1 occurred.").
+ emit loginFailed(inst, QString("Login failed: Unknown HTTP error %1 occurred.").
arg(QString::number(responseCode)));
}
break;
}
case QNetworkReply::OperationCanceledError:
- emit loginFailed("Login canceled.");
+ emit loginFailed(inst, "Login canceled.");
break;
default:
- emit loginFailed("Login failed: " + reply->errorString());
+ emit loginFailed(inst, "Login failed: " + reply->errorString());
break;
}