diff options
| -rw-r--r-- | src/modlistbypriorityproxy.cpp | 34 | ||||
| -rw-r--r-- | src/modlistbypriorityproxy.h | 2 |
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; |
