diff --git a/src/widgets/kfileitemactions.cpp b/src/widgets/kfileitemactions.cpp --- a/src/widgets/kfileitemactions.cpp +++ b/src/widgets/kfileitemactions.cpp @@ -607,9 +607,6 @@ // "Open With..." for folders is really not very useful, especially for remote folders. // (media:/something, or trash:/, or ftp://...) if (!d->m_props.isDirectory() || isLocal) { - if (!topMenu->actions().isEmpty()) { - topMenu->addSeparator(); - } QAction *runAct = new QAction(this); QString runActionName; @@ -649,10 +646,13 @@ if (!offers.isEmpty()) { QMenu *menu = topMenu; + QAction *act; - // Always show the top app inline - QAction *act = d->createAppAction(offers.takeFirst(), true); - menu->addAction(act); + // Show the top app inline for files, but not folders + if (!d->m_props.isDirectory()) { + act = d->createAppAction(offers.takeFirst(), true); + menu->addAction(act); + } // If there are still more apps, show them in a sub-menu if (!offers.isEmpty()) { // submenu 'open with' @@ -664,8 +664,8 @@ KService::List::ConstIterator it = offers.constBegin(); for (; it != offers.constEnd(); it++) { QAction *act = d->createAppAction(*it, - // no submenu -> prefix single offer - menu == topMenu); + // no submenu -> prefix single offer + menu == topMenu); menu->addAction(act); } topMenu->addSeparator();