Sort the applets alphabetically to make it easier to find the right applet

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=740196
This commit is contained in:
Alexander Wiedenbruch 2007-11-22 19:39:16 +00:00
parent 72a3b2b68b
commit e4765f3dcd
2 changed files with 3 additions and 1 deletions

View File

@ -96,6 +96,8 @@ void KCategorizedItemsView::setItemModel(QStandardItemModel * model)
m_modelItems = model; m_modelItems = model;
m_modelFilterItems->setSourceModel(m_modelItems); m_modelFilterItems->setSourceModel(m_modelItems);
m_modelFilterItems->setSortCaseSensitivity(Qt::CaseInsensitive);
m_modelFilterItems->sort(0);
itemsView->setModel(m_modelFilterItems); itemsView->setModel(m_modelFilterItems);

View File

@ -120,7 +120,7 @@ bool DefaultItemFilterProxyModel::filterAcceptsRow(int sourceRow,
bool DefaultItemFilterProxyModel::lessThan(const QModelIndex &left, bool DefaultItemFilterProxyModel::lessThan(const QModelIndex &left,
const QModelIndex &right) const const QModelIndex &right) const
{ {
return (sourceModel()->data(left).toString() < sourceModel()->data(right).toString()); return sourceModel()->data(left).toString().compare(sourceModel()->data(right).toString(), sortCaseSensitivity()) < 0;
} }
void DefaultItemFilterProxyModel::setSearch(const QString & pattern) void DefaultItemFilterProxyModel::setSearch(const QString & pattern)