From 2b21463514a46e7f3600f32560a0e944d15a2750 Mon Sep 17 00:00:00 2001 From: Tannin Date: Wed, 7 Jan 2015 23:13:40 +0100 Subject: - download servers that haven't been available for over a month are now purged from the known servers list - bugfix: encoding detection for fomod xmls could incorrectly interpret files as utf16 encoded - bugfix: hashing algorithm for bsa files was wrong - bugfix: nxmhandler reported non-issues as errors - bugfix: nxmhandler tried to apply chrome fix on every start - bugfix: "not endorsed" icon displayed for non-nexus mods - bugfix: when drag&dropping within the overwrite dialog the file might still get moved to a mod (and probably not the intended one) - bugfix: dropping files from overwrite on the modlist was refused when not sorting by priority (only in 1.2.15) - bugfix: unmanaged mods couldn't be reordered (only in 1.2.15) --- src/mainwindow.cpp | 5 ++++- src/modinfo.cpp | 4 +--- src/modinfo.h | 4 ---- src/modlist.cpp | 12 +++++++++--- src/modlist.h | 2 +- src/modlistsortproxy.cpp | 37 +++++++++++++++++++------------------ src/overwriteinfodialog.ui | 5 ++++- src/profile.cpp | 2 +- src/settings.cpp | 12 ++++++++++++ src/version.rc | 4 ++-- 10 files changed, 53 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index bf2d6139..ee2f32af 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3313,7 +3313,10 @@ void MainWindow::overwriteClosed(int) void MainWindow::displayModInformation(ModInfo::Ptr modInfo, unsigned int index, int tab) { - m_ModList.modInfoAboutToChange(modInfo); + if (!m_ModList.modInfoAboutToChange(modInfo)) { + qDebug("A different mod information dialog is open. If this is incorrect, please restart MO"); + return; + } std::vector flags = modInfo->getFlags(); if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end()) { QDialog *dialog = this->findChild("__overwriteDialog"); diff --git a/src/modinfo.cpp b/src/modinfo.cpp index c06a50d6..bf48ae8b 100644 --- a/src/modinfo.cpp +++ b/src/modinfo.cpp @@ -812,7 +812,7 @@ void ModInfoRegular::ignoreUpdate(bool ignore) std::vector ModInfoRegular::getFlags() const { std::vector result = ModInfoWithConflictInfo::getFlags(); - if ((m_NexusID != -1) && (endorsedState() == ENDORSED_FALSE)) { + if ((m_NexusID > 0) && (endorsedState() == ENDORSED_FALSE)) { result.push_back(ModInfo::FLAG_NOTENDORSED); } if (!isValid()) { @@ -1013,8 +1013,6 @@ QStringList ModInfoOverwrite::archives() const return result; } -const char ModInfoForeign::INT_IDENTIFIER[] = "__int__foreign"; - QString ModInfoForeign::name() const { return m_Name; diff --git a/src/modinfo.h b/src/modinfo.h index 6fbab1a0..4534841d 100644 --- a/src/modinfo.h +++ b/src/modinfo.h @@ -1018,10 +1018,6 @@ class ModInfoForeign : public ModInfoWithConflictInfo friend class ModInfo; -public: - - static const char INT_IDENTIFIER[]; - public: virtual bool updateAvailable() const { return false; } diff --git a/src/modlist.cpp b/src/modlist.cpp index 43862008..0cf8766a 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -571,10 +571,15 @@ void ModList::changeModPriority(int sourceIndex, int newPriority) emit modorder_changed(); } -void ModList::modInfoAboutToChange(ModInfo::Ptr info) +bool ModList::modInfoAboutToChange(ModInfo::Ptr info) { - m_ChangeInfo.name = info->name(); - m_ChangeInfo.state = state(info->name()); + if (m_ChangeInfo.name.isEmpty()) { + m_ChangeInfo.name = info->name(); + m_ChangeInfo.state = state(info->name()); + return true; + } else { + return false; + } } void ModList::modInfoChanged(ModInfo::Ptr info) @@ -590,6 +595,7 @@ void ModList::modInfoChanged(ModInfo::Ptr info) } else { qCritical("modInfoChanged not called after modInfoAboutToChange"); } + m_ChangeInfo.name = QString(); } void ModList::disconnectSlots() { diff --git a/src/modlist.h b/src/modlist.h index 3c33fd05..38d08c2d 100644 --- a/src/modlist.h +++ b/src/modlist.h @@ -101,7 +101,7 @@ public: void changeModPriority(int sourceIndex, int newPriority); - void modInfoAboutToChange(ModInfo::Ptr info); + bool modInfoAboutToChange(ModInfo::Ptr info); void modInfoChanged(ModInfo::Ptr info); void disconnectSlots(); diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp index 4e066eb8..b0e33bf2 100644 --- a/src/modlistsortproxy.cpp +++ b/src/modlistsortproxy.cpp @@ -26,6 +26,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #include #include @@ -324,23 +325,23 @@ bool ModListSortProxy::filterAcceptsRow(int row, const QModelIndex &parent) cons bool ModListSortProxy::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) { - if (sortColumn() != ModList::COL_PRIORITY) { - QWidget *wid = qApp->activeWindow()->findChild("modList"); - MessageDialog::showMessage(tr("Drag&Drop is only supported when sorting by priority"), wid); - return false; - } - if ((row == -1) && (column == -1)) { - return this->sourceModel()->dropMimeData(data, action, -1, -1, mapToSource(parent)); - } - // in the regular model, when dropping between rows, the row-value passed to - // the sourceModel is inconsistent between ascending and descending ordering. - // This should fix that - if (sortOrder() == Qt::DescendingOrder) { - --row; - } + if (!data->hasUrls() && (sortColumn() != ModList::COL_PRIORITY)) { + QWidget *wid = qApp->activeWindow()->findChild("modList"); + MessageDialog::showMessage(tr("Drag&Drop is only supported when sorting by priority"), wid); + return false; + } + if ((row == -1) && (column == -1)) { + return this->sourceModel()->dropMimeData(data, action, -1, -1, mapToSource(parent)); + } + // in the regular model, when dropping between rows, the row-value passed to + // the sourceModel is inconsistent between ascending and descending ordering. + // This should fix that + if (sortOrder() == Qt::DescendingOrder) { + --row; + } - QModelIndex proxyIndex = index(row, column, parent); - QModelIndex sourceIndex = mapToSource(proxyIndex); - return this->sourceModel()->dropMimeData(data, action, sourceIndex.row(), sourceIndex.column(), - sourceIndex.parent()); + QModelIndex proxyIndex = index(row, column, parent); + QModelIndex sourceIndex = mapToSource(proxyIndex); + return this->sourceModel()->dropMimeData(data, action, sourceIndex.row(), sourceIndex.column(), + sourceIndex.parent()); } diff --git a/src/overwriteinfodialog.ui b/src/overwriteinfodialog.ui index 2c194ecf..5e5986ca 100644 --- a/src/overwriteinfodialog.ui +++ b/src/overwriteinfodialog.ui @@ -23,7 +23,10 @@ true - QAbstractItemView::DragOnly + QAbstractItemView::DragDrop + + + Qt::MoveAction QAbstractItemView::ExtendedSelection diff --git a/src/profile.cpp b/src/profile.cpp index fda61c4d..01d75446 100644 --- a/src/profile.cpp +++ b/src/profile.cpp @@ -271,7 +271,7 @@ void Profile::refreshModStatus() modName = QString::fromUtf8(line.trimmed().constData()); } if (modName.size() > 0) { - QString lookupName = modName + (line.at(0) == '*' ? ModInfoForeign::INT_IDENTIFIER : ""); + QString lookupName = modName; if (namesRead.find(lookupName) != namesRead.end()) { continue; } else { diff --git a/src/settings.cpp b/src/settings.cpp index 274e5979..d41723ca 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -402,7 +402,19 @@ void Settings::updateServers(const QList &servers) } } + // clean up unavailable servers + QDate now = QDate::currentDate(); + foreach (const QString &key, m_Settings.childKeys()) { + QVariantMap val = m_Settings.value(key).toMap(); + QDate lastSeen = val["lastSeen"].toDate(); + if (lastSeen.daysTo(now) > 30) { + qDebug("removing server %s since it hasn't been available for downloads in over a month", qPrintable(key)); + m_Settings.remove(key); + } + } + m_Settings.endGroup(); + m_Settings.sync(); } diff --git a/src/version.rc b/src/version.rc index 51c05050..1261029a 100644 --- a/src/version.rc +++ b/src/version.rc @@ -1,7 +1,7 @@ #include "Winver.h" -#define VER_FILEVERSION 1,2,15,0 -#define VER_FILEVERSION_STR "1,2,15,0\0" +#define VER_FILEVERSION 1,2,16,0 +#define VER_FILEVERSION_STR "1,2,16,0\0" VS_VERSION_INFO VERSIONINFO FILEVERSION VER_FILEVERSION -- cgit v1.3.1