/***************************************************************************
* Copyright (C) 2011 by Peter Penz <peter.penz19@gmail.com> *
* *
- * Based on the Itemviews NG project from Trolltech Labs: *
- * http://qt.gitorious.org/qt-labs/itemviews-ng *
+ * Based on the Itemviews NG project from Trolltech Labs *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
#define KITEMMODELBASE_H
#include "dolphin_export.h"
+#include "kitemviews/kitemrange.h"
+#include "kitemviews/kitemset.h"
-#include <kitemviews/kitemrange.h>
-#include <kitemviews/kitemset.h>
-
-#include <QUrl>
#include <QHash>
#include <QObject>
+#include <QUrl>
#include <QVariant>
class QMimeData;
* Sets the sort-role to \a role. The method KItemModelBase::onSortRoleChanged() will be
* called so that model-implementations can react on the sort-role change. Afterwards the
* signal sortRoleChanged() will be emitted.
+ * The implementation should resort only if \a resortItems is true.
*/
- void setSortRole(const QByteArray& role);
+ void setSortRole(const QByteArray& role, bool resortItems = true);
QByteArray sortRole() const;
/**
* Usually the most efficient way is to emit a
* itemsRemoved() signal for all items, reorder the items internally and to emit a
* itemsInserted() signal afterwards.
+ * The implementation should resort only if \a resortItems is true.
*/
- virtual void onSortRoleChanged(const QByteArray& current, const QByteArray& previous);
+ virtual void onSortRoleChanged(const QByteArray& current, const QByteArray& previous, bool resortItems = true);
/**
* Is invoked if the sort order has been changed by KItemModelBase::setSortOrder(). Allows