[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdepim/libkdepim
From: Sergio Luis Martins <iamsergio () gmail ! com>
Date: 2010-12-13 21:42:47
Message-ID: 20101213214247.326C5AC8A7 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1206211 by smartins:
Make subcategories work in korganizer.
" SubCategory" was being compared to "Category:SubCategory", and that failed.
We must use the same role in both sides.
BUG: 251139
MM +4 -1 kcheckcombobox.cpp
MM +3 -0 kcheckcombobox.h
--- trunk/KDE/kdepim/libkdepim/kcheckcombobox.cpp #1206210:1206211
@@ -206,7 +206,10 @@
{
for ( int r = 0; r < model()->rowCount( rootModelIndex() ); ++r ) {
QModelIndex indx = model()->index( r, modelColumn(), rootModelIndex() );
- QString text = indx.data().toString();
+
+ // DisplayRole has " SubCategory"
+ // UserRole has "Category:SubCategory"
+ QString text = indx.data( Qt::UserRole ).toString();
bool found = items.contains( text );
model()->setData( indx, found ? Qt::Checked : Qt::Unchecked, Qt::CheckStateRole );
}
--- trunk/KDE/kdepim/libkdepim/kcheckcombobox.h #1206210:1206211
@@ -145,6 +145,9 @@
* are silently ignored.
*
* @param items The items that will be set to checked.
+ * TODO: pass the Role, now it's using Qt::UserRole because that's what korganizer needs
+ * (and korg is the only user) but to make KCheckComboBox an independent component,
+ * we must remove that hardcoded role.
*/
void setCheckedItems( const QStringList &items );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic