From e91351d2c22ab041b85f49e243e1f510edf7984e Mon Sep 17 00:00:00 2001 From: sandman Date: Mon, 23 Dec 2002 03:24:31 +0000 Subject: small bugfixes and speedup --- (limited to 'core/settings/button/buttonutils.cpp') diff --git a/core/settings/button/buttonutils.cpp b/core/settings/button/buttonutils.cpp index bb70047..91d2af3 100644 --- a/core/settings/button/buttonutils.cpp +++ b/core/settings/button/buttonutils.cpp @@ -101,19 +101,27 @@ void ButtonUtils::insertActions ( QListViewItem *here ) void ButtonUtils::insertAppLnks ( QListViewItem *here ) { - QStringList types = m_apps-> types ( ); + QStringList types = m_apps-> types ( ); + QListViewItem *typeitem [types. count ( )]; + int i = 0; for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { QListViewItem *item = new QListViewItem ( here, m_apps-> typeName ( *it )); item-> setPixmap ( 0, m_apps-> typePixmap ( *it )); - - for ( QListIterator appit ( m_apps-> children ( )); *appit; ++appit ) { - AppLnk *l = *appit; - + + typeitem [i++] = item; + } + + for ( QListIterator appit ( m_apps-> children ( )); *appit; ++appit ) { + AppLnk *l = *appit; + + int i = 0; + for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { if ( l-> type ( ) == *it ) { - QListViewItem *sub = new QListViewItem ( item, l-> name ( ), QString ( "QPE/Application/" ) + l-> exec ( ), "raise()" ); + QListViewItem *sub = new QListViewItem ( typeitem [i], l-> name ( ), QString ( "QPE/Application/" ) + l-> exec ( ), "raise()" ); sub-> setPixmap ( 0, l-> pixmap ( )); } - } + i++; + } } } -- cgit v0.9.0.2