Skip to content

Commit

Permalink
Move slot connections to avoid issue when starting MO2 to download a …
Browse files Browse the repository at this point in the history
…NXM link. (#2082)

* Move slot connections to avoid issue when starting MO2 to download a NXM link.
  • Loading branch information
Holt59 authored Aug 1, 2024
1 parent f11925a commit acd2011
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 130 deletions.
18 changes: 3 additions & 15 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,16 +407,9 @@ MainWindow::MainWindow(Settings& settings, OrganizerCore& organizerCore,
SLOT(nexusApi()));

connect(NexusInterface::instance().getAccessManager(),
SIGNAL(credentialsReceived(const APIUserAccount&)), this,
SLOT(updateWindowTitle(const APIUserAccount&)));

connect(NexusInterface::instance().getAccessManager(),
SIGNAL(credentialsReceived(const APIUserAccount&)),
&NexusInterface::instance(), SLOT(setUserAccount(const APIUserAccount&)));

connect(&NexusInterface::instance(),
SIGNAL(requestsChanged(const APIStats&, const APIUserAccount&)), this,
SLOT(onRequestsChanged(const APIStats&, const APIUserAccount&)));
&NXMAccessManager::credentialsReceived, this, &MainWindow::updateWindowTitle);
connect(&NexusInterface::instance(), &NexusInterface::requestsChanged, ui->statusBar,
&StatusBar::setAPI);

connect(&TutorialManager::instance(), SIGNAL(windowTutorialFinished(QString)), this,
SLOT(windowTutorialFinished(QString)));
Expand Down Expand Up @@ -658,11 +651,6 @@ void MainWindow::updateWindowTitle(const APIUserAccount& user)
this->setWindowTitle(title);
}

void MainWindow::onRequestsChanged(const APIStats& stats, const APIUserAccount& user)
{
ui->statusBar->setAPI(stats, user);
}

void MainWindow::resizeLists(bool pluginListCustom)
{
// ensure the columns aren't so small you can't see them any more
Expand Down
2 changes: 0 additions & 2 deletions src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,6 @@ private slots:
void nxmRequestFailed(QString gameName, int modID, int fileID, QVariant userData,
int requestID, int errorCode, const QString& errorString);

void onRequestsChanged(const APIStats& stats, const APIUserAccount& user);

void modRenamed(const QString& oldName, const QString& newName);
void modRemoved(const QString& fileName);

Expand Down
7 changes: 5 additions & 2 deletions src/nexusinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,11 @@ NexusInterface::NexusInterface(Settings* s) : m_PluginContainer(nullptr)

m_DiskCache = new QNetworkDiskCache(this);

connect(m_AccessManager, SIGNAL(requestNXMDownload(QString)), this,
SLOT(downloadRequestedNXM(QString)));
connect(m_AccessManager, &NXMAccessManager::requestNXMDownload, this,
&NexusInterface::downloadRequestedNXM);

connect(m_AccessManager, &NXMAccessManager::credentialsReceived, this,
&NexusInterface::setUserAccount);
}

NexusInterface::~NexusInterface()
Expand Down
Loading

0 comments on commit acd2011

Please sign in to comment.