summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2015-01-07 23:13:40 +0100
committerTannin <devnull@localhost>2015-01-07 23:13:40 +0100
commit2b21463514a46e7f3600f32560a0e944d15a2750 (patch)
tree78d9debcdb45e4f7f597f7dabeac08f77c37e980
parentd20a26e0eb817c924028f912d35e21668c7f9e22 (diff)
- 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)
-rw-r--r--src/mainwindow.cpp5
-rw-r--r--src/modinfo.cpp4
-rw-r--r--src/modinfo.h4
-rw-r--r--src/modlist.cpp12
-rw-r--r--src/modlist.h2
-rw-r--r--src/modlistsortproxy.cpp37
-rw-r--r--src/overwriteinfodialog.ui5
-rw-r--r--src/profile.cpp2
-rw-r--r--src/settings.cpp12
-rw-r--r--src/version.rc4
10 files changed, 53 insertions, 34 deletions
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<ModInfo::EFlag> flags = modInfo->getFlags();
if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end()) {
QDialog *dialog = this->findChild<QDialog*>("__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<ModInfo::EFlag> ModInfoRegular::getFlags() const
{
std::vector<ModInfo::EFlag> 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
@@ -1020,10 +1020,6 @@ class ModInfoForeign : public ModInfoWithConflictInfo
public:
- static const char INT_IDENTIFIER[];
-
-public:
-
virtual bool updateAvailable() const { return false; }
virtual bool updateIgnored() const { return false; }
virtual bool downgradeAvailable() 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 <http://www.gnu.org/licenses/>.
#include <QCheckBox>
#include <QWidgetAction>
#include <QApplication>
+#include <QMimeData>
#include <QDebug>
#include <QTreeView>
@@ -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<QTreeView*>("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<QTreeView*>("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 @@
<bool>true</bool>
</property>
<property name="dragDropMode">
- <enum>QAbstractItemView::DragOnly</enum>
+ <enum>QAbstractItemView::DragDrop</enum>
+ </property>
+ <property name="defaultDropAction">
+ <enum>Qt::MoveAction</enum>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
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<ServerInfo> &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