Commit 43232b87 authored by Lamarque Souza's avatar Lamarque Souza
Browse files

Case insensitively sort images in active-imageviewer.

BUG: 284672
(cherry picked from commit b972e182)
parent 8b256995
......@@ -104,6 +104,7 @@ PlasmaComponents.Page {
sourceModel: metadataModel
sortRole: "label"
sortOrder: "AscendingOrder"
sortCaseSensitivity: Qt.CaseInsensitive
}
delegateWidth: 130
......
......@@ -66,6 +66,10 @@ Image {
repeat: false
onTriggered: {
loadImage(startupArguments[0])
// sort by column 0 (called "label" in metadatamodel.cpp),
// that is, the file name.
metadataModel.sort(0)
}
}
......
......@@ -669,4 +669,14 @@ void MetadataModel::previewFailed(const KFileItem &item)
m_previewJobs.remove(item.url());
}
// Just signal QSortFilterProxyModel to do the real sorting.
void MetadataModel::sort(int column, Qt::SortOrder order)
{
Q_UNUSED(column);
Q_UNUSED(order);
beginResetModel();
endResetModel();
}
#include "metadatamodel.moc"
......@@ -103,6 +103,14 @@ public:
//Reimplemented
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
/**
* Reimplemented
* Just signal QSortFilterProxyModel to do the real sorting.
* Use this class as parameter to QSortFilterProxyModel->setSourceModel (C++) or
* PlasmaCore.SortFilterModel.sourceModel (QML) to get the real sorting.
*/
Q_INVOKABLE void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
Q_SIGNALS:
void queryStringChanged();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment