Commit 65cbe753 authored by David Faure's avatar David Faure
Browse files

We don't need KSortableValueList for sorting, a QMap does the job just as well.

svn path=/trunk/KDE/kdebase/libkonq/; revision=539637
parent 8083b49a
...@@ -318,7 +318,7 @@ void KNewMenu::slotFillTemplates() ...@@ -318,7 +318,7 @@ void KNewMenu::slotFillTemplates()
// Look into "templates" dirs. // Look into "templates" dirs.
QStringList files = d->m_actionCollection->instance()->dirs()->findAllResources("templates"); QStringList files = d->m_actionCollection->instance()->dirs()->findAllResources("templates");
KSortableValueList<Entry,QString> slist; QMap<QString, Entry> slist; // used for sorting
for ( QStringList::Iterator it = files.begin() ; it != files.end() ; ++it ) for ( QStringList::Iterator it = files.begin() ; it != files.end() ; ++it )
{ {
//kDebug(1203) << *it << endl; //kDebug(1203) << *it << endl;
...@@ -341,18 +341,17 @@ void KNewMenu::slotFillTemplates() ...@@ -341,18 +341,17 @@ void KNewMenu::slotFillTemplates()
// because this filetype is the most used (according kde-core discussion) // because this filetype is the most used (according kde-core discussion)
QString key = config.readEntry("Name"); QString key = config.readEntry("Name");
if ( (*it).endsWith( "TextFile.desktop" ) ) if ( (*it).endsWith( "TextFile.desktop" ) )
key = "1_" + key; key.prepend( '1' );
else else
key = "2_" + key; key.prepend( '2' );
slist.insert( key, e ); slist.insert( key, e );
} }
} }
} }
slist.sort(); for(QMap<QString, Entry>::const_iterator it = slist.begin(); it != slist.end(); ++it)
for(KSortableValueList<Entry, QString>::ConstIterator it = slist.begin(); it != slist.end(); ++it)
{ {
s_templatesList->append( (*it).value() ); s_templatesList->append( it.value() );
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment