diff options
| author | Thomas Tanner <trtanner@btinternet.com> | 2015-11-24 06:58:29 +0000 |
|---|---|---|
| committer | Thomas Tanner <trtanner@btinternet.com> | 2015-11-24 06:58:29 +0000 |
| commit | 37c3bea7dd5a562a97c00b740103cc2868b3013b (patch) | |
| tree | c4fce29e8aaba21307456dd30b9cbf81580e6c3e | |
| parent | 3659284ab6bdbf0845cf846600a26db688584d6f (diff) | |
Removes all uses of GameInfo::getShortName, replaced by IPluginGame::getNexustName
| -rw-r--r-- | src/downloadmanager.cpp | 11 | ||||
| -rw-r--r-- | src/downloadmanager.h | 4 | ||||
| -rw-r--r-- | src/mainwindow.cpp | 18 | ||||
| -rw-r--r-- | src/organizercore.cpp | 1 | ||||
| -rw-r--r-- | src/settings.cpp | 14 | ||||
| -rw-r--r-- | src/shared/fallout3info.h | 1 | ||||
| -rw-r--r-- | src/shared/falloutnvinfo.h | 1 | ||||
| -rw-r--r-- | src/shared/gameinfo.h | 1 | ||||
| -rw-r--r-- | src/shared/oblivioninfo.h | 2 | ||||
| -rw-r--r-- | src/shared/skyriminfo.h | 1 |
10 files changed, 29 insertions, 25 deletions
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index e0d76765..588b8bb9 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -18,10 +18,11 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. */
#include "downloadmanager.h"
+
#include "nxmurl.h"
#include "nexusinterface.h"
#include "nxmaccessmanager.h"
-#include <gameinfo.h>
+#include "iplugingame.h"
#include <nxmurl.h>
#include <taskprogressmanager.h>
#include "utility.h"
@@ -30,6 +31,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include "bbcode.h"
#include <utility.h>
#include <report.h>
+
#include <QTimer>
#include <QFileInfo>
#include <QRegExp>
@@ -37,6 +39,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include <QInputDialog>
#include <QMessageBox>
#include <QCoreApplication>
+
#include <boost/bind.hpp>
#include <regex>
@@ -447,7 +450,7 @@ void DownloadManager::addNXMDownload(const QString &url) {
NXMUrl nxmInfo(url);
- QString managedGame = ToQString(MOShared::GameInfo::instance().getGameShortName());
+ QString managedGame = m_ManagedGame->getNexusName();
qDebug("add nxm download: %s", qPrintable(url));
if (nxmInfo.game().compare(managedGame, Qt::CaseInsensitive) != 0) {
qDebug("download requested for wrong game (game: %s, url: %s)", qPrintable(managedGame), qPrintable(nxmInfo.game()));
@@ -1462,3 +1465,7 @@ void DownloadManager::directoryChanged(const QString&) refreshList();
}
+void DownloadManager::managedGameChanged(MOBase::IPluginGame *managedGame)
+{
+ m_ManagedGame = managedGame;
+}
diff --git a/src/downloadmanager.h b/src/downloadmanager.h index f13cc65d..faa4267e 100644 --- a/src/downloadmanager.h +++ b/src/downloadmanager.h @@ -35,6 +35,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include <QFileSystemWatcher>
#include <QSettings>
+namespace MOBase { class IPluginGame; }
class NexusInterface;
@@ -416,6 +417,8 @@ public slots: void nxmRequestFailed(int modID, int fileID, QVariant userData, int requestID, const QString &errorString);
+ void managedGameChanged(MOBase::IPluginGame *gamePlugin);
+
private slots:
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
@@ -503,6 +506,7 @@ private: QRegExp m_DateExpression;
+ MOBase::IPluginGame *m_ManagedGame;
};
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 3c331c65..ceb118ea 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -58,10 +58,8 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include "browserdialog.h"
#include "aboutdialog.h"
#include "safewritefile.h"
-#include "organizerproxy.h"
#include "nxmaccessmanager.h"
#include <archive.h>
-#include <gameinfo.h>
#include <appconfig.h>
#include <utility.h>
#include <ipluginproxy.h>
@@ -70,15 +68,11 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include <questionboxmemory.h>
#include <taskprogressmanager.h>
#include <util.h>
-#include <map>
-#include <ctime>
-#include <wchar.h>
-#include <utility.h>
+
#include <QTime>
#include <QInputDialog>
#include <QSettings>
#include <QWhatsThis>
-#include <sstream>
#include <QProcess>
#include <QMenu>
#include <QBuffer>
@@ -126,8 +120,14 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include <boost/foreach.hpp>
#include <boost/assign.hpp>
#endif
+
+#include <sstream>
#include <regex>
#include <functional>
+#include <map>
+#include <ctime>
+#include <wchar.h>
+#include <utility.h>
#ifdef TEST_MODELS
#include "modeltest.h"
@@ -4391,8 +4391,8 @@ void MainWindow::on_bossButton_clicked() parameters << "--unattended"
<< "--stdout"
<< "--noreport"
- << "--game" << ToQString(GameInfo::instance().getGameShortName())
- << "--gamePath" << QString("\"%1\"").arg(ToQString(GameInfo::instance().getGameDirectory()))
+ << "--game" << m_OrganizerCore.managedGame()->getNexusName()
+ << "--gamePath" << QString("\"%1\"").arg(m_OrganizerCore.managedGame()->gameDirectory().absolutePath())
<< "--out" << outPath;
if (m_DidUpdateMasterList) {
diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 7a2f95d3..c81a473c 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -159,6 +159,7 @@ OrganizerCore::OrganizerCore(const QSettings &initSettings) connect(NexusInterface::instance()->getAccessManager(), SIGNAL(loginFailed(QString)), this, SLOT(loginFailed(QString)));
connect(this, SIGNAL(managedGameChanged(MOBase::IPluginGame*)), &m_Settings, SLOT(managedGameChanged(MOBase::IPluginGame*)));
+ connect(this, SIGNAL(managedGameChanged(MOBase::IPluginGame*)), &m_DownloadManager, SLOT(managedGameChanged(MOBase::IPluginGame*)));
connect(&m_PluginList, &PluginList::writePluginsList, &m_PluginListsWriter, &DelayedFileWriterBase::write);
diff --git a/src/settings.cpp b/src/settings.cpp index 4c2a34c8..61d6aaa3 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -23,25 +23,21 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include "utility.h" #include "helper.h" #include "json.h" -#include <gameinfo.h> #include <appconfig.h> #include <utility.h> #include <iplugingame.h> #include <QCheckBox> -#include <QLineEdit> -#include <QDirIterator> -#include <QRegExp> #include <QCoreApplication> -#include <QMessageBox> #include <QDesktopServices> +#include <QDirIterator> +#include <QLineEdit> +#include <QMessageBox> +#include <QRegExp> #include <memory> - using namespace MOBase; -using namespace MOShared; - template <typename T> class QListWidgetItemEx : public QListWidgetItem { @@ -112,7 +108,7 @@ void Settings::registerAsNXMHandler(bool force) std::wstring nxmPath = ToWString(QCoreApplication::applicationDirPath() + "/nxmhandler.exe"); std::wstring executable = ToWString(QCoreApplication::applicationFilePath()); std::wstring mode = force ? L"forcereg" : L"reg"; - std::wstring parameters = mode + L" " + GameInfo::instance().getGameShortName() + L" \"" + executable + L"\""; + std::wstring parameters = mode + L" " + m_GamePlugin->getNexusName().toStdWString() + L" \"" + executable + L"\""; HINSTANCE res = ::ShellExecuteW(nullptr, L"open", nxmPath.c_str(), parameters.c_str(), nullptr, SW_SHOWNORMAL); if ((int)res <= 32) { QMessageBox::critical(nullptr, tr("Failed"), diff --git a/src/shared/fallout3info.h b/src/shared/fallout3info.h index ae6a27c7..ed130e53 100644 --- a/src/shared/fallout3info.h +++ b/src/shared/fallout3info.h @@ -41,7 +41,6 @@ public: virtual GameInfo::Type getType() { return TYPE_FALLOUT3; }
virtual std::wstring getGameName() const { return L"Fallout 3"; }
- virtual std::wstring getGameShortName() const { return L"Fallout3"; }
virtual std::vector<std::wstring> getSavegameAttachmentExtensions();
diff --git a/src/shared/falloutnvinfo.h b/src/shared/falloutnvinfo.h index 2179bf2f..75febd4c 100644 --- a/src/shared/falloutnvinfo.h +++ b/src/shared/falloutnvinfo.h @@ -41,7 +41,6 @@ public: virtual GameInfo::Type getType() { return TYPE_FALLOUTNV; }
virtual std::wstring getGameName() const { return L"New Vegas"; }
- virtual std::wstring getGameShortName() const { return L"FalloutNV"; }
virtual std::vector<std::wstring> getSavegameAttachmentExtensions();
diff --git a/src/shared/gameinfo.h b/src/shared/gameinfo.h index 9ae42159..9538a19c 100644 --- a/src/shared/gameinfo.h +++ b/src/shared/gameinfo.h @@ -62,7 +62,6 @@ public: virtual GameInfo::Type getType() = 0;
virtual std::wstring getGameName() const = 0;
- virtual std::wstring getGameShortName() const = 0;
/// determine the load order mechanism used by this game. this may throw an
/// exception if the mechanism can't be determined
diff --git a/src/shared/oblivioninfo.h b/src/shared/oblivioninfo.h index 2a550e0e..a9808d77 100644 --- a/src/shared/oblivioninfo.h +++ b/src/shared/oblivioninfo.h @@ -39,7 +39,7 @@ public: virtual GameInfo::Type getType() { return TYPE_OBLIVION; }
virtual std::wstring getGameName() const { return L"Oblivion"; }
- virtual std::wstring getGameShortName() const { return L"Oblivion"; }
+
virtual std::vector<std::wstring> getSavegameAttachmentExtensions();
// file name of this games ini (no path)
diff --git a/src/shared/skyriminfo.h b/src/shared/skyriminfo.h index 741f76c9..1bf67c11 100644 --- a/src/shared/skyriminfo.h +++ b/src/shared/skyriminfo.h @@ -41,7 +41,6 @@ public: virtual GameInfo::Type getType() { return TYPE_SKYRIM; }
virtual std::wstring getGameName() const { return L"Skyrim"; }
- virtual std::wstring getGameShortName() const { return L"Skyrim"; }
virtual LoadOrderMechanism getLoadOrderMechanism() const;
|
