summaryrefslogtreecommitdiff
path: root/core/launcher/startmenu.cpp
Side-by-side diff
Diffstat (limited to 'core/launcher/startmenu.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/startmenu.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp
index 2871233..28c8b97 100644
--- a/core/launcher/startmenu.cpp
+++ b/core/launcher/startmenu.cpp
@@ -223,7 +223,15 @@ bool StartMenu::loadMenu( AppLnkSet *folder, QPopupMenu *menu )
if ( pmenu ) {
QString t = app->name();
t.replace(QRegExp("&"),"&&"); // escape shortcut character
- pmenu->insertItem( app->pixmap(), t, app->id() );
+
+ int index = -1;
+
+ for ( index = 0; index < pmenu-> count ( ); index++ ) {
+ if ( pmenu-> text ( pmenu-> idAt ( index )). compare ( t ) > 0 )
+ break;
+ }
+
+ pmenu->insertItem( app->pixmap(), t, app->id(), index );
}
result=TRUE;
}