Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/kfileitemactions.cpp
Show First 20 Lines • Show All 602 Lines • ▼ Show 20 Line(s) | 594 | { | |||
---|---|---|---|---|---|
603 | 603 | | |||
604 | const KFileItemList items = d->m_props.items(); | 604 | const KFileItemList items = d->m_props.items(); | ||
605 | const KFileItem firstItem = items.first(); | 605 | const KFileItem firstItem = items.first(); | ||
606 | const bool isLocal = firstItem.url().isLocalFile(); | 606 | const bool isLocal = firstItem.url().isLocalFile(); | ||
607 | // "Open With..." for folders is really not very useful, especially for remote folders. | 607 | // "Open With..." for folders is really not very useful, especially for remote folders. | ||
608 | // (media:/something, or trash:/, or ftp://...) | 608 | // (media:/something, or trash:/, or ftp://...) | ||
609 | if (!d->m_props.isDirectory() || isLocal) { | 609 | if (!d->m_props.isDirectory() || isLocal) { | ||
610 | if (!topMenu->actions().isEmpty()) { | 610 | if (!topMenu->actions().isEmpty()) { | ||
611 | topMenu->addSeparator(); | 611 | topMenu->addSeparator(); | ||
elvisangelaccio: Why are we removing this separator? | |||||
612 | } | 612 | } | ||
613 | 613 | | |||
614 | QAction *runAct = new QAction(this); | 614 | QAction *runAct = new QAction(this); | ||
615 | QString runActionName; | 615 | QString runActionName; | ||
616 | 616 | | |||
617 | const QStringList serviceIdList = d->listPreferredServiceIds(d->m_mimeTypeList, traderConstraint); | 617 | const QStringList serviceIdList = d->listPreferredServiceIds(d->m_mimeTypeList, traderConstraint); | ||
618 | //qDebug() << "serviceIdList=" << serviceIdList; | 618 | //qDebug() << "serviceIdList=" << serviceIdList; | ||
619 | 619 | | |||
Show All 25 Lines | 622 | if (d->m_mimeTypeList.count() > 1 | |||
645 | d->m_fileOpenList = d->m_props.items(); | 645 | d->m_fileOpenList = d->m_props.items(); | ||
646 | QObject::connect(runAct, SIGNAL(triggered()), d, SLOT(slotRunPreferredApplications())); | 646 | QObject::connect(runAct, SIGNAL(triggered()), d, SLOT(slotRunPreferredApplications())); | ||
647 | topMenu->addAction(runAct); | 647 | topMenu->addAction(runAct); | ||
648 | } | 648 | } | ||
649 | 649 | | |||
650 | if (!offers.isEmpty()) { | 650 | if (!offers.isEmpty()) { | ||
651 | QMenu *menu = topMenu; | 651 | QMenu *menu = topMenu; | ||
652 | 652 | | |||
653 | // Always show the top app inline | 653 | // Show the top app inline for files, but not folders | ||
654 | if (!d->m_props.isDirectory()) { | ||||
654 | QAction *act = d->createAppAction(offers.takeFirst(), true); | 655 | QAction *act = d->createAppAction(offers.takeFirst(), true); | ||
655 | menu->addAction(act); | 656 | menu->addAction(act); | ||
657 | } | ||||
656 | 658 | | |||
657 | // If there are still more apps, show them in a sub-menu | 659 | // If there are still more apps, show them in a sub-menu | ||
658 | if (!offers.isEmpty()) { // submenu 'open with' | 660 | if (!offers.isEmpty()) { // submenu 'open with' | ||
659 | menu = new QMenu(i18nc("@title:menu", "&Open With"), topMenu); | 661 | menu = new QMenu(i18nc("@title:menu", "&Open With"), topMenu); | ||
660 | menu->menuAction()->setObjectName(QStringLiteral("openWith_submenu")); // for the unittest | 662 | menu->menuAction()->setObjectName(QStringLiteral("openWith_submenu")); // for the unittest | ||
661 | topMenu->addMenu(menu); | 663 | topMenu->addMenu(menu); | ||
662 | 664 | | |||
663 | // Add other apps to the sub-menu | 665 | // Add other apps to the sub-menu | ||
▲ Show 20 Lines • Show All 157 Lines • Show Last 20 Lines |
Why are we removing this separator?