Nuke and pave the old login system

Also, account list now saves profile lists.
This commit is contained in:
Andrew
2013-11-20 18:31:15 -06:00
parent 03652b01d2
commit abf8408911
11 changed files with 150 additions and 120 deletions

View File

@ -185,7 +185,7 @@ bool MojangAccountList::loadList(const QString& filePath)
// TODO: We should probably report this error to the user.
if (!file.open(QIODevice::ReadOnly))
{
QLOG_ERROR() << "Failed to read the account list file (" << path << ").";
QLOG_ERROR() << QString("Failed to read the account list file (%1).").arg(path).toUtf8();
return false;
}
@ -217,9 +217,9 @@ bool MojangAccountList::loadList(const QString& filePath)
// Make sure the format version matches.
if (root.value("formatVersion").toVariant().toInt() != ACCOUNT_LIST_FORMAT_VERSION)
{
QString newName = "accountlist-old.json";
QLOG_WARN() << "Format version mismatch when loading account list. Existing one will be renamed to \""
<< newName << "\".";
QString newName = "accounts-old.json";
QLOG_WARN() << "Format version mismatch when loading account list. Existing one will be renamed to"
<< newName;
// Attempt to rename the old version.
file.rename(newName);
@ -257,7 +257,7 @@ bool MojangAccountList::saveList(const QString& filePath)
return false;
}
QLOG_INFO() << "Writing account list to \"" << path << "\"...";
QLOG_INFO() << "Writing account list to" << path;
QLOG_DEBUG() << "Building JSON data structure.";
// Build the JSON document to write to the list file.
@ -289,7 +289,7 @@ bool MojangAccountList::saveList(const QString& filePath)
// TODO: We should probably report this error to the user.
if (!file.open(QIODevice::WriteOnly))
{
QLOG_ERROR() << "Failed to read the account list file (" << path << ").";
QLOG_ERROR() << QString("Failed to read the account list file (%1).").arg(path).toUtf8();
return false;
}
@ -297,7 +297,7 @@ bool MojangAccountList::saveList(const QString& filePath)
file.write(doc.toJson());
file.close();
QLOG_INFO() << "Saved account list to \"" << path << "\".";
QLOG_INFO() << "Saved account list to" << path;
return true;
}