CCMAIL: peter.penz@gmx.at
svn path=/trunk/KDE/kdebase/apps/; revision=724536
+ QObject::disconnect(d->proxyModel,
+ SIGNAL(layoutAboutToBeChanged()),
+ this, SLOT(slotLayoutAboutToBeChanged()));
+
QObject::disconnect(d->proxyModel,
SIGNAL(layoutChanged()),
this, SLOT(slotLayoutChanged()));
QObject::disconnect(d->proxyModel,
SIGNAL(layoutChanged()),
this, SLOT(slotLayoutChanged()));
+ d->modelSortRole = d->proxyModel->sortRole();
+ d->modelSortColumn = d->proxyModel->sortColumn();
+ d->modelSortOrder = d->proxyModel->sortOrder();
+
+ QObject::connect(d->proxyModel,
+ SIGNAL(layoutAboutToBeChanged()),
+ this, SLOT(slotLayoutAboutToBeChanged()));
+
QObject::connect(d->proxyModel,
SIGNAL(layoutChanged()),
this, SLOT(slotLayoutChanged()));
QObject::connect(d->proxyModel,
SIGNAL(layoutChanged()),
this, SLOT(slotLayoutChanged()));
if (!categoryDrawer && d->proxyModel)
{
if (!categoryDrawer && d->proxyModel)
{
+ QObject::disconnect(d->proxyModel,
+ SIGNAL(layoutAboutToBeChanged()),
+ this, SLOT(slotLayoutAboutToBeChanged()));
+
QObject::disconnect(d->proxyModel,
SIGNAL(layoutChanged()),
this, SLOT(slotLayoutChanged()));
QObject::disconnect(d->proxyModel,
SIGNAL(layoutChanged()),
this, SLOT(slotLayoutChanged()));
}
else if (categoryDrawer && d->proxyModel)
{
}
else if (categoryDrawer && d->proxyModel)
{
+ QObject::connect(d->proxyModel,
+ SIGNAL(layoutAboutToBeChanged()),
+ this, SLOT(slotLayoutAboutToBeChanged()));
+
QObject::connect(d->proxyModel,
SIGNAL(layoutChanged()),
this, SLOT(slotLayoutChanged()));
QObject::connect(d->proxyModel,
SIGNAL(layoutChanged()),
this, SLOT(slotLayoutChanged()));
}
void KCategorizedView::rowsInserted(const QModelIndex &parent,
}
void KCategorizedView::rowsInserted(const QModelIndex &parent,
{
QListView::rowsInserted(parent, start, end);
{
QListView::rowsInserted(parent, start, end);
QAbstractItemView::updateGeometries();
}
QAbstractItemView::updateGeometries();
}
-void KCategorizedView::slotLayoutChanged()
+void KCategorizedView::slotLayoutAboutToBeChanged()
{
if ((viewMode() == KCategorizedView::IconMode) && d->proxyModel &&
d->categoryDrawer && d->proxyModel->isCategorizedModel())
{
if ((viewMode() == KCategorizedView::IconMode) && d->proxyModel &&
d->categoryDrawer && d->proxyModel->isCategorizedModel())
+ {
+ d->modelSortRole = d->proxyModel->sortRole();
+ d->modelSortColumn = d->proxyModel->sortColumn();
+ d->modelSortOrder = d->proxyModel->sortOrder();
+ }
+}
+
+void KCategorizedView::slotLayoutChanged()
+{
+ if ((viewMode() == KCategorizedView::IconMode) && d->proxyModel &&
+ d->categoryDrawer && d->proxyModel->isCategorizedModel() &&
+ ((d->modelSortRole != d->proxyModel->sortRole()) ||
+ (d->modelSortColumn != d->proxyModel->sortColumn()) ||
+ (d->modelSortOrder != d->proxyModel->sortOrder())))
{
// Force the view to update all elements
rowsInsertedArtifficial(QModelIndex(), 0, d->proxyModel->rowCount() - 1);
{
// Force the view to update all elements
rowsInsertedArtifficial(QModelIndex(), 0, d->proxyModel->rowCount() - 1);
virtual void updateGeometries();
virtual void updateGeometries();
+ virtual void slotLayoutAboutToBeChanged();
virtual void slotLayoutChanged();
virtual void slotLayoutChanged();
QModelIndexList intersectedIndexes;
QRect lastDraggedItemsRect;
QRect lastSelectionRect;
QModelIndexList intersectedIndexes;
QRect lastDraggedItemsRect;
QRect lastSelectionRect;
+ int modelSortRole;
+ int modelSortColumn;
+ Qt::SortOrder modelSortOrder;
// Attributes for speed reasons
KCategorizedSortFilterProxyModel *proxyModel;
// Attributes for speed reasons
KCategorizedSortFilterProxyModel *proxyModel;