mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
kcontrol: replace use of QtConcurrent::blockingFilter() with QMutableListIterator<T>()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
5d535e9575
commit
ca76c014aa
1 changed files with 7 additions and 7 deletions
|
@ -26,7 +26,6 @@
|
|||
#include <QtCore/QRegExp>
|
||||
#include <QtGui/QTextDocument> // for Qt::escape
|
||||
#include <QtXml/qxml.h>
|
||||
#include <QtCore/QtConcurrentFilter>
|
||||
|
||||
//#include <libintl.h>
|
||||
//#include <locale.h>
|
||||
|
@ -78,15 +77,16 @@ static QString translate_description(ConfigItem* item)
|
|||
? item->name : translate_xml_item(item->description);
|
||||
}
|
||||
|
||||
static bool notEmpty(const ConfigItem* item)
|
||||
{
|
||||
return ! item->name.isEmpty();
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void removeEmptyItems(QList<T*>& list)
|
||||
{
|
||||
QtConcurrent::blockingFilter(list, notEmpty);
|
||||
QMutableListIterator<T*> filterit(list);
|
||||
while (filterit.hasNext()) {
|
||||
const T* it = filterit.next();
|
||||
if (it->name.isEmpty()) {
|
||||
filterit.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
|
|
Loading…
Add table
Reference in a new issue