#include "klistview.h"
#include "klistview_p.h"
-#include <math.h> // trunc
+#include <math.h> // trunc on C99 compliant systems
+#include <kdefakes.h> // trunc for not C99 compliant systems
#include <QApplication>
#include <QPainter>
void KListView::slotSortingRoleChanged()
{
- if (d->proxyModel)
+ if ((viewMode() == KListView::IconMode) && d->proxyModel &&
+ d->itemCategorizer)
{
// Force the view to update all elements
- rowsInsertedArtifficial(QModelIndex(), 0, d->proxyModel->rowCount() -
- 1);
+ rowsInsertedArtifficial(QModelIndex(), 0, d->proxyModel->rowCount() - 1);
}
}