Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/kfileitemactions.cpp
Show First 20 Lines • Show All 239 Lines • ▼ Show 20 Line(s) | 239 | if (!d->m_mimeTypeList.contains((*kit).mimetype())) { | |||
---|---|---|---|---|---|
240 | d->m_mimeTypeList << (*kit).mimetype(); | 240 | d->m_mimeTypeList << (*kit).mimetype(); | ||
241 | } | 241 | } | ||
242 | } | 242 | } | ||
243 | } | 243 | } | ||
244 | 244 | | |||
245 | int KFileItemActions::addServiceActionsTo(QMenu *mainMenu) | 245 | int KFileItemActions::addServiceActionsTo(QMenu *mainMenu) | ||
246 | { | 246 | { | ||
247 | const KFileItemList items = d->m_props.items(); | 247 | const KFileItemList items = d->m_props.items(); | ||
248 | const KFileItem firstItem = items.first(); | 248 | const KFileItem &firstItem = items.first(); | ||
249 | const QString protocol = firstItem.url().scheme(); // assumed to be the same for all items | 249 | const QString protocol = firstItem.url().scheme(); // assumed to be the same for all items | ||
250 | const bool isLocal = !firstItem.localPath().isEmpty(); | 250 | const bool isLocal = !firstItem.localPath().isEmpty(); | ||
251 | const bool isSingleLocal = items.count() == 1 && isLocal; | 251 | const bool isSingleLocal = items.count() == 1 && isLocal; | ||
252 | const QList<QUrl> urlList = d->m_props.urlList(); | 252 | const QList<QUrl> urlList = d->m_props.urlList(); | ||
253 | 253 | | |||
254 | KIO::PopupServices s; | 254 | KIO::PopupServices s; | ||
255 | 255 | | |||
256 | // 1 - Look for builtin and user-defined services | 256 | // 1 - Look for builtin and user-defined services | ||
▲ Show 20 Lines • Show All 346 Lines • ▼ Show 20 Line(s) | 600 | { | |||
603 | } | 603 | } | ||
604 | 604 | | |||
605 | d->m_traderConstraint = traderConstraint; | 605 | d->m_traderConstraint = traderConstraint; | ||
606 | KService::List offers = associatedApplications(d->m_mimeTypeList, traderConstraint); | 606 | KService::List offers = associatedApplications(d->m_mimeTypeList, traderConstraint); | ||
607 | 607 | | |||
608 | //// Ok, we have everything, now insert | 608 | //// Ok, we have everything, now insert | ||
609 | 609 | | |||
610 | const KFileItemList items = d->m_props.items(); | 610 | const KFileItemList items = d->m_props.items(); | ||
611 | const KFileItem firstItem = items.first(); | 611 | const KFileItem &firstItem = items.first(); | ||
612 | const bool isLocal = firstItem.url().isLocalFile(); | 612 | const bool isLocal = firstItem.url().isLocalFile(); | ||
613 | // "Open With..." for folders is really not very useful, especially for remote folders. | 613 | // "Open With..." for folders is really not very useful, especially for remote folders. | ||
614 | // (media:/something, or trash:/, or ftp://...) | 614 | // (media:/something, or trash:/, or ftp://...) | ||
615 | if (!d->m_props.isDirectory() || isLocal) { | 615 | if (!d->m_props.isDirectory() || isLocal) { | ||
616 | 616 | | |||
617 | QAction *runAct = new QAction(this); | 617 | QAction *runAct = new QAction(this); | ||
618 | 618 | | |||
619 | const QStringList serviceIdList = d->listPreferredServiceIds(d->m_mimeTypeList, traderConstraint); | 619 | const QStringList serviceIdList = d->listPreferredServiceIds(d->m_mimeTypeList, traderConstraint); | ||
▲ Show 20 Lines • Show All 209 Lines • Show Last 20 Lines |