[Konsole-devel] [Bug 74269] FIXME/Patch: sorting Settings/Keyboard entires

Waldo Bastian bastian at kde.org
Thu Feb 5 22:50:32 UTC 2004


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
      
http://bugs.kde.org/show_bug.cgi?id=74269      
bastian at kde.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From bastian at kde.org  2004-02-05 23:50 -------
Subject: KDE_3_2_BRANCH: kdebase/konsole/konsole

CVS commit by waba: 

Sort Settings/Keyboard entries (BR74269)
Patch by Kurt V.Hindenburg
CCMAIL: 74269-done at bugs.kde.org


  M +15 -1     konsole.cpp   1.441.2.4


--- kdebase/konsole/konsole/konsole.cpp  #1.441.2.3:1.441.2.4
@@ -769,12 +769,26 @@ void Konsole::makeGUI()
 
    // insert keymaps into menu
-   //FIXME: sort
+   // This sorting seems a bit cumbersome; but it is not called often.
+   QStringList kt_titles;
+   typedef QMap<QString,KeyTrans*> QStringKeyTransMap;
+   QStringKeyTransMap kt_map;
+
    for (int i = 0; i < KeyTrans::count(); i++)
    {
       KeyTrans* ktr = KeyTrans::find(i);
       assert( ktr );
+      QString title=ktr->hdr().lower();
+      kt_titles << title;
+      kt_map[title] = ktr;
+   }
+   kt_titles.sort();
+   for ( QStringList::Iterator it = kt_titles.begin(); it != kt_titles.end(); ++it ) {
+      KeyTrans* ktr = kt_map[*it];
+      assert( ktr );
       QString title=ktr->hdr();
       m_keytab->insertItem(title.replace('&',"&&"),ktr->numb());
+      //KONSOLEDEBUG << *it << "---" << title << "---" << ktr->numb() << endl;
    }
+
    applySettingsToGUI();
    isRestored = false;



More information about the konsole-devel mailing list