Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/krun.cpp
Show First 20 Lines • Show All 706 Lines • ▼ Show 20 Line(s) | 705 | qint64 KRun::runApplication(const KService &service, const QList<QUrl> &urls, QWidget *window, | |||
---|---|---|---|---|---|
707 | const QByteArray &asn) | 707 | const QByteArray &asn) | ||
708 | { | 708 | { | ||
709 | if (!service.entryPath().isEmpty() && | 709 | if (!service.entryPath().isEmpty() && | ||
710 | !KDesktopFile::isAuthorizedDesktopFile(service.entryPath()) && | 710 | !KDesktopFile::isAuthorizedDesktopFile(service.entryPath()) && | ||
711 | !::makeServiceExecutable(service, window)) { | 711 | !::makeServiceExecutable(service, window)) { | ||
712 | return 0; | 712 | return 0; | ||
713 | } | 713 | } | ||
714 | 714 | | |||
715 | if (!flags.testFlag(DeleteTemporaryFiles)) { | ||||
716 | // Remember we opened those urls, for the "recent documents" menu in kicker | ||||
apol: while at it, let's stop calling it kicker? | |||||
717 | for (const QUrl &url : urls) { | ||||
718 | KRecentDocument::add(url, service.desktopEntryName()); | ||||
719 | } | ||||
720 | } | ||||
721 | | ||||
715 | KService::Ptr servicePtr(new KService(service)); // clone | 722 | KService::Ptr servicePtr(new KService(service)); // clone | ||
716 | return runApplicationImpl(servicePtr, urls, window, flags, suggestedFileName, asn); | 723 | return runApplicationImpl(servicePtr, urls, window, flags, suggestedFileName, asn); | ||
717 | } | 724 | } | ||
718 | 725 | | |||
719 | qint64 KRun::runService(const KService &_service, const QList<QUrl> &_urls, QWidget *window, | 726 | qint64 KRun::runService(const KService &_service, const QList<QUrl> &_urls, QWidget *window, | ||
720 | bool tempFiles, const QString &suggestedFileName, const QByteArray &asn) | 727 | bool tempFiles, const QString &suggestedFileName, const QByteArray &asn) | ||
721 | { | 728 | { | ||
722 | if (!_service.entryPath().isEmpty() && | 729 | return runApplication(_service, | ||
723 | !KDesktopFile::isAuthorizedDesktopFile(_service.entryPath()) && | 730 | _urls, | ||
724 | !::makeServiceExecutable(_service, window)) { | 731 | window, | ||
725 | return 0; | 732 | tempFiles ? RunFlags(DeleteTemporaryFiles) : RunFlags(), | ||
726 | } | 733 | suggestedFileName, | ||
727 | 734 | asn); | |||
728 | if (!tempFiles) { | | |||
729 | // Remember we opened those urls, for the "recent documents" menu in kicker | | |||
730 | for (const QUrl &url : _urls) { | | |||
731 | KRecentDocument::add(url, _service.desktopEntryName()); | | |||
732 | } | | |||
733 | } | | |||
734 | KService::Ptr servicePtr(new KService(_service)); // clone | | |||
735 | return runApplicationImpl(servicePtr, _urls, window, tempFiles ? RunFlags(DeleteTemporaryFiles) : RunFlags(), suggestedFileName, asn); | | |||
736 | } | 735 | } | ||
737 | 736 | | |||
738 | bool KRun::run(const QString &_exec, const QList<QUrl> &_urls, QWidget *window, const QString &_name, | 737 | bool KRun::run(const QString &_exec, const QList<QUrl> &_urls, QWidget *window, const QString &_name, | ||
739 | const QString &_icon, const QByteArray &asn) | 738 | const QString &_icon, const QByteArray &asn) | ||
740 | { | 739 | { | ||
741 | KService::Ptr service(new KService(_name, _exec, _icon)); | 740 | KService::Ptr service(new KService(_name, _exec, _icon)); | ||
742 | 741 | | |||
743 | return runApplication(*service, _urls, window, RunFlags{}, QString(), asn); | 742 | return runApplication(*service, _urls, window, RunFlags{}, QString(), asn); | ||
▲ Show 20 Lines • Show All 970 Lines • Show Last 20 Lines |
while at it, let's stop calling it kicker?