From 9ea5086c4cd1acf6f462070a5c792a252aa176dd Mon Sep 17 00:00:00 2001 From: Tannin Date: Tue, 12 May 2015 20:34:05 +0200 Subject: slight cleanup regarding steam log-in settings --- src/organizercore.cpp | 6 +-- src/settings.cpp | 11 ++-- src/settingsdialog.ui | 146 +++++++++++++++++++++++++------------------------- 3 files changed, 80 insertions(+), 83 deletions(-) (limited to 'src') diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 2d1febea..ce0b8c5f 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -85,7 +85,7 @@ static void startSteam(QWidget *widget) QSettings steamSettings("HKEY_CURRENT_USER\\Software\\Valve\\Steam", QSettings::NativeFormat); QString exe = steamSettings.value("SteamExe", "").toString(); if (!exe.isEmpty()) { - QString temp = QString("\"%1\"").arg(exe); + exe = QString("\"%1\"").arg(exe); //See if username and password supplied. If so, pass them into steam. QStringList args; QString username; @@ -97,8 +97,8 @@ static void startSteam(QWidget *widget) args << password; } } - if (!QProcess::startDetached(temp, args)) { - reportError(QObject::tr("Failed to start \"%1\"").arg(temp)); + if (!QProcess::startDetached(exe, args)) { + reportError(QObject::tr("Failed to start \"%1\"").arg(exe)); } else { QMessageBox::information(widget, QObject::tr("Waiting"), QObject::tr("Please press OK once you're logged into steam.")); diff --git a/src/settings.cpp b/src/settings.cpp index 57e422bb..71eb37d5 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -259,13 +259,10 @@ bool Settings::getNexusLogin(QString &username, QString &password) const bool Settings::getSteamLogin(QString &username, QString &password) const { - if (m_Settings.contains("Settings/steam_username")) { - username = m_Settings.value("Settings/steam_username", "").toString(); - if (m_Settings.contains("Settings/steam_password")) { - password = deObfuscate(m_Settings.value("Settings/steam_password", "").toString()); - } else { - password = ""; - } + if (m_Settings.contains("Settings/steam_username") + && m_Settings.contains("Settings/steam_password")) { + username = m_Settings.value("Settings/steam_username").toString(); + password = deObfuscate(m_Settings.value("Settings/steam_password").toString()); return true; } else { return false; diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index f2ab3908..b88885dc 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -455,6 +455,79 @@ p, li { white-space: pre-wrap; } + + + Steam + + + + + + Username + + + + + + + + + + Password + + + + + + + QLineEdit::Password + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 40 + + + + + + + + If you save your steam user ID and password here, they will be used when logging into steam. Note, however, your password will be stored unencrypted, so make sure your computer is secure. + + + true + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 232 + + + + + + Plugins @@ -811,79 +884,6 @@ For the other games this is not a sufficient replacement for AI! - - - Steam - - - - - - Username - - - - - - - If you save your steam user ID and password here, they will be used when logging into steam. Note, however, your password will be stored unencrypted, so make sure your computer is secure. - - - true - - - - - - - Password - - - - - - - - - - QLineEdit::Password - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 40 - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 40 - - - - - - -- cgit v1.3.1