summaryrefslogtreecommitdiff
path: root/src/modinforegular.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-06-23 02:24:34 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-07-02 10:10:18 -0400
commit8d1c121f648f2f6a8e0a5e2ad76cd245e318290d (patch)
tree44aa8aee2685174615f33f999ca102179939d3e4 /src/modinforegular.cpp
parenta72573b385a941adf7d662b8df5c8e35309fdd45 (diff)
split nexus tab
added OrganizerCore::loggedInAction() to execute a function only when logged in, replaces a bunch of copy/pasted stuff in mainwindow moved common variables in ModInfoDialogTab moved DescriptionPage to modinfodialognexus.h, renamed to NexusTabWebpage, deleted now empty descriptionpage.h
Diffstat (limited to 'src/modinforegular.cpp')
-rw-r--r--src/modinforegular.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/modinforegular.cpp b/src/modinforegular.cpp
index a271c4e8..babbd665 100644
--- a/src/modinforegular.cpp
+++ b/src/modinforegular.cpp
@@ -118,7 +118,7 @@ void ModInfoRegular::readMeta()
m_EndorsedState = metaFile.value("endorsed", false).toBool() ? ENDORSED_TRUE : ENDORSED_FALSE;
}
}
-
+
QString categoriesString = metaFile.value("category", "").toString();
QStringList categories = categoriesString.split(',', QString::SkipEmptyParts);
@@ -291,15 +291,27 @@ void ModInfoRegular::nxmRequestFailed(QString, int, int, QVariant userData, QNet
bool ModInfoRegular::updateNXMInfo()
{
- QDateTime time = QDateTime::currentDateTimeUtc();
- QDateTime target = m_LastNexusQuery.addDays(1);
- if (m_NexusID > 0 && time >= target) {
+ if (needsDescriptionUpdate()) {
m_NexusBridge.requestDescription(m_GameName, m_NexusID, QVariant());
return true;
}
+
return false;
}
+bool ModInfoRegular::needsDescriptionUpdate() const
+{
+ if (m_NexusID > 0) {
+ QDateTime time = QDateTime::currentDateTimeUtc();
+ QDateTime target = m_LastNexusQuery.addDays(1);
+
+ if (time >= target) {
+ return true;
+ }
+ }
+
+ return false;
+}
void ModInfoRegular::setCategory(int categoryID, bool active)
{