#include "kitemmodelbase.h"
-KItemRange::KItemRange(int index, int count) :
- index(index),
- count(count)
-{
-}
-
-bool KItemRange::operator == (const KItemRange& other) const
-{
- return index == other.index && count == other.count;
-}
-
KItemModelBase::KItemModelBase(QObject* parent) :
QObject(parent),
m_groupedSorting(false),
bool KItemModelBase::setData(int index, const QHash<QByteArray, QVariant> &values)
{
- Q_UNUSED(index);
- Q_UNUSED(values);
+ Q_UNUSED(index)
+ Q_UNUSED(values)
return false;
}
return m_groupedSorting;
}
-void KItemModelBase::setSortRole(const QByteArray& role)
+void KItemModelBase::setSortRole(const QByteArray& role, bool resortItems)
{
if (role != m_sortRole) {
const QByteArray previous = m_sortRole;
m_sortRole = role;
- onSortRoleChanged(role, previous);
+ onSortRoleChanged(role, previous, resortItems);
emit sortRoleChanged(role, previous);
}
}
bool KItemModelBase::setExpanded(int index, bool expanded)
{
- Q_UNUSED(index);
- Q_UNUSED(expanded);
+ Q_UNUSED(index)
+ Q_UNUSED(expanded)
return false;
}
bool KItemModelBase::isExpanded(int index) const
{
- Q_UNUSED(index);
+ Q_UNUSED(index)
return false;
}
bool KItemModelBase::isExpandable(int index) const
{
- Q_UNUSED(index);
+ Q_UNUSED(index)
return false;
}
int KItemModelBase::expandedParentsCount(int index) const
{
- Q_UNUSED(index);
+ Q_UNUSED(index)
return 0;
}
-QMimeData* KItemModelBase::createMimeData(const QSet<int>& indexes) const
+QMimeData* KItemModelBase::createMimeData(const KItemSet& indexes) const
{
- Q_UNUSED(indexes);
- return 0;
+ Q_UNUSED(indexes)
+ return nullptr;
}
int KItemModelBase::indexForKeyboardSearch(const QString& text, int startFromIndex) const
{
- Q_UNUSED(text);
- Q_UNUSED(startFromIndex);
+ Q_UNUSED(text)
+ Q_UNUSED(startFromIndex)
return -1;
}
bool KItemModelBase::supportsDropping(int index) const
{
- Q_UNUSED(index);
+ Q_UNUSED(index)
return false;
}
+QString KItemModelBase::blacklistItemDropEventMimeType() const
+{
+ return QStringLiteral("application/x-dolphin-blacklist-drop");
+}
+
void KItemModelBase::onGroupedSortingChanged(bool current)
{
- Q_UNUSED(current);
+ Q_UNUSED(current)
}
-void KItemModelBase::onSortRoleChanged(const QByteArray& current, const QByteArray& previous)
+void KItemModelBase::onSortRoleChanged(const QByteArray& current, const QByteArray& previous, bool resortItems)
{
- Q_UNUSED(current);
- Q_UNUSED(previous);
+ Q_UNUSED(current)
+ Q_UNUSED(previous)
+ Q_UNUSED(resortItems)
}
void KItemModelBase::onSortOrderChanged(Qt::SortOrder current, Qt::SortOrder previous)
{
- Q_UNUSED(current);
- Q_UNUSED(previous);
+ Q_UNUSED(current)
+ Q_UNUSED(previous)
}
-#include "kitemmodelbase.moc"
+QUrl KItemModelBase::url(int index) const
+{
+ return data(index).value("url").toUrl();
+}
+
+bool KItemModelBase::isDir(int index) const
+{
+ return data(index).value("isDir").toBool();
+}
+
+QUrl KItemModelBase::directory() const
+{
+ return QUrl();
+}