diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/downloadlist.cpp | 4 | ||||
| -rw-r--r-- | src/modlistviewactions.cpp | 3 | ||||
| -rw-r--r-- | src/plugincontainer.cpp | 9 | ||||
| -rw-r--r-- | src/pluginlist.cpp | 4 |
4 files changed, 11 insertions, 9 deletions
diff --git a/src/downloadlist.cpp b/src/downloadlist.cpp index 1f6dd4b2..6624e9ae 100644 --- a/src/downloadlist.cpp +++ b/src/downloadlist.cpp @@ -226,7 +226,7 @@ bool DownloadList::lessThanPredicate(const QModelIndex &left, const QModelIndex if ((leftIndex < m_manager.numTotalDownloads())
&& (rightIndex < m_manager.numTotalDownloads())) {
if (left.column() == DownloadList::COL_NAME) {
- return m_manager.getFileName(left.row()).compare(m_manager.getFileName(right.row()), Qt::CaseInsensitive) < 0;
+ return left.data(Qt::DisplayRole).toString().compare(right.data(Qt::DisplayRole).toString(), Qt::CaseInsensitive) < 0;
} else if (left.column() == DownloadList::COL_MODNAME) {
QString leftName, rightName;
@@ -275,7 +275,7 @@ bool DownloadList::lessThanPredicate(const QModelIndex &left, const QModelIndex if (leftState == rightState)
return m_manager.getFileTime(left.row()) < m_manager.getFileTime(right.row());
else
- return leftState > rightState;
+ return leftState < rightState;
} else if (left.column() == DownloadList::COL_SIZE) {
return m_manager.getFileSize(left.row()) < m_manager.getFileSize(right.row());
} else if (left.column() == DownloadList::COL_FILETIME) {
diff --git a/src/modlistviewactions.cpp b/src/modlistviewactions.cpp index c11f4ea8..acf765f6 100644 --- a/src/modlistviewactions.cpp +++ b/src/modlistviewactions.cpp @@ -145,9 +145,10 @@ void ModListViewActions::createEmptyMod(const QModelIndex& index) const return; } + // find the priority before refresh() otherwise the index might not be valid + const int newPriority = findInstallPriority(index); m_core.refresh(); - const int newPriority = findInstallPriority(index); const auto mIndex = ModInfo::getIndex(name); if (newPriority >= 0) { m_core.modList()->changeModPriority(mIndex, newPriority); diff --git a/src/plugincontainer.cpp b/src/plugincontainer.cpp index 93a66ece..c5896d2e 100644 --- a/src/plugincontainer.cpp +++ b/src/plugincontainer.cpp @@ -42,9 +42,10 @@ namespace bf = boost::fusion; // the one corresponding to the currently managed games.
// - If a plugin has a master plugin (IPlugin::master()), it cannot be enabled/disabled by users,
// and will follow the enabled/disabled state of its parent.
-// - Each plugin has an "enabled" setting stored in persistence. A plugin is considered disabled
-// if the setting is false.
-// - If the setting is true or does not exist, a plugin is considered disabled if one of its
+// - Each plugin has an "enabled" setting stored in persistence. If the setting does not exist,
+// the plugin's enabledByDefault is used instead.
+// - A plugin is considered disabled if the setting is false.
+// - If the setting is true, a plugin is considered disabled if one of its
// requirements is not met.
// - Users cannot enable a plugin if one of its requirements is not met.
//
@@ -599,7 +600,7 @@ bool PluginContainer::isEnabled(IPlugin* plugin) const }
// Check if the plugin is enabled:
- if (!m_Organizer->persistent(plugin->name(), "enabled", true).toBool()) {
+ if (!m_Organizer->persistent(plugin->name(), "enabled", plugin->enabledByDefault()).toBool()) {
return false;
}
diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index b6cb25d0..10ed1e28 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -543,7 +543,7 @@ void PluginList::readLockedOrderFrom(const QString &fileName) auto alreadyLocked = [&](){ return std::find_if(m_LockedOrder.begin(), m_LockedOrder.end(), findLocked) != m_LockedOrder.end(); };
// See if we can just set the given priority
- if (!m_ESPs[priority].forceEnabled && !alreadyLocked())
+ if (!m_ESPs[m_ESPsByPriority.at(priority)].forceEnabled && !alreadyLocked())
{
m_LockedOrder[pluginName] = priority;
continue;
@@ -552,7 +552,7 @@ void PluginList::readLockedOrderFrom(const QString &fileName) // Find the next higher priority we can set the plugin to
while (++priority < m_ESPs.size())
{
- if (!m_ESPs[priority].forceEnabled && !alreadyLocked())
+ if (!m_ESPs[m_ESPsByPriority.at(priority)].forceEnabled && !alreadyLocked())
{
m_LockedOrder[pluginName] = priority;
break;
|
