summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikaƫl Capelle <capelle.mikael@gmail.com>2021-01-11 18:54:31 +0100
committerGitHub <noreply@github.com>2021-01-11 18:54:31 +0100
commit9e663691b0ad23faa979361facb416b7ea0fb08d (patch)
tree686f6043ed9be1434b36d5e3cca4ef8877bbd83c /src
parent1dc2b225485a073d82e08a9820493086b2dda8b8 (diff)
parenta7e6f9a5a8c5bbafbb3f4625c1d2151dab96d46b (diff)
Merge pull request #1356 from Holt59/collapsible-separators
Remove dead code.
Diffstat (limited to 'src')
-rw-r--r--src/modlistbypriorityproxy.cpp34
-rw-r--r--src/modlistbypriorityproxy.h2
2 files changed, 3 insertions, 33 deletions
diff --git a/src/modlistbypriorityproxy.cpp b/src/modlistbypriorityproxy.cpp
index e0efe585..480a4105 100644
--- a/src/modlistbypriorityproxy.cpp
+++ b/src/modlistbypriorityproxy.cpp
@@ -170,19 +170,6 @@ bool ModListByPriorityProxy::hasChildren(const QModelIndex& parent) const
return item->children.size() > 0;
}
-bool ModListByPriorityProxy::setData(const QModelIndex& index, const QVariant& value, int role)
-{
- // only care about the "name" column
- if (index.column() == 0 && role == Qt::EditRole) {
- QString oldValue = data(index, role).toString();
- if (m_CollapsedItems.contains(oldValue)) {
- m_CollapsedItems.erase(oldValue);
- m_CollapsedItems.insert(value.toString());
- }
- }
- return QAbstractProxyModel::setData(index, value, role);
-}
-
bool ModListByPriorityProxy::canDropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) const
{
ModListDropInfo dropInfo(data, m_core);
@@ -228,24 +215,9 @@ bool ModListByPriorityProxy::canDropMimeData(const QMimeData* data, Qt::DropActi
}
}
- // top-level drop is disabled unless it's before the first separator
- if (!parent.isValid() && row >= 0) {
-
- // the row may be outside of the children list if we insert at the end
- if (row >= m_Root.children.size()) {
- return false;
- }
-
- // if the previous row is a collapsed separator, disable dropping
- if (row > 0 && m_Root.children[row - 1]->mod->isSeparator()) {
- // we cannot use the name of the mod directly because it does not exactly
- // match the display value (e.g. for separators)
- QString display = sourceModel()->index(m_Root.children[row - 1]->index, ModList::COL_NAME).data(Qt::DisplayRole).toString();
- if (m_CollapsedItems.contains(display)
- && (m_Root.children[row]->mod->isSeparator() || m_Root.children[row]->mod->isOverwrite())) {
- return false;
- }
- }
+ // the row may be outside of the children list if we insert at the end
+ if (!parent.isValid() && row >= m_Root.children.size()) {
+ return false;
}
return QAbstractProxyModel::canDropMimeData(data, action, row, column, parent);
diff --git a/src/modlistbypriorityproxy.h b/src/modlistbypriorityproxy.h
index 5cd66c62..74ecc942 100644
--- a/src/modlistbypriorityproxy.h
+++ b/src/modlistbypriorityproxy.h
@@ -38,7 +38,6 @@ public:
int columnCount(const QModelIndex& index) const override;
bool hasChildren(const QModelIndex& parent) const override;
- bool setData(const QModelIndex& index, const QVariant& value, int role) override;
bool canDropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) const override;
bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) override;
@@ -79,7 +78,6 @@ private:
TreeItem m_Root;
std::map<unsigned int, TreeItem*> m_IndexToItem;
- std::set<QString> m_CollapsedItems;
private:
OrganizerCore& m_core;