[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdebase/kcontrol/filetypes
From: Luboš Luňák <l.lunak () kde ! org>
Date: 2003-06-23 9:51:51
[Download RAW message or body]
CVS commit by lunakl:
Don't use the listview when searching for dirty items that need to be saved,
the listview may contain only filtered items.
M +16 -3 filetypesview.cpp 1.63
--- kdebase/kcontrol/filetypes/filetypesview.cpp #1.62:1.63
@@ -331,7 +331,8 @@ bool FileTypesView::sync( QValueList<Typ
// now go through all entries and sync those which are dirty.
- QListViewItemIterator it2(typesLV);
- for (; it2.current(); ++it2) {
- TypesListItem *tli = (TypesListItem *) it2.current();
+ // don't use typesLV, it may be filtered
+ QMapIterator<QString,TypesListItem*> it1 = m_majorMap.begin();
+ while ( it1 != m_majorMap.end() ) {
+ TypesListItem *tli = *it1;
if (tli->isDirty()) {
kdDebug() << "Entry " << tli->name() << " is dirty. Saving." << endl;
@@ -340,4 +341,16 @@ bool FileTypesView::sync( QValueList<Typ
didIt = true;
}
+ ++it1;
+ }
+ QPtrListIterator<TypesListItem> it2( m_itemList );
+ while ( it2.current() ) {
+ TypesListItem *tli = *it2;
+ if (tli->isDirty()) {
+ kdDebug() << "Entry " << tli->name() << " is dirty. Saving." << endl;
+ tli->sync();
+ itemsModified.append( tli );
+ didIt = true;
+ }
+ ++it2;
}
setDirty(false);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic