Bug 74269 - FIXME/Patch: sorting Settings/Keyboard entires
Summary: FIXME/Patch: sorting Settings/Keyboard entires
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-05 19:27 UTC by Kurt Hindenburg
Modified: 2004-02-05 23:50 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Patch to sort KeyBoard menu entires (1.14 KB, patch)
2004-02-05 19:28 UTC, Kurt Hindenburg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kurt Hindenburg 2004-02-05 19:27:48 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r3, propolice) 
OS:          Linux

FIXME in konsole/konsole.cpp asks for sorting of Keyboard menu entires.
New layout:
linux console
vt100 (historical)
VT420PC
XTerm (XFree 3.x.x)
XTerm (XFree 4.x.x)
Comment 1 Kurt Hindenburg 2004-02-05 19:28:46 UTC
Created attachment 4526 [details]
Patch to sort KeyBoard menu entires
Comment 2 Waldo Bastian 2004-02-05 23:50:29 UTC
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@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;