Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/krun.cpp
Show First 20 Lines • Show All 754 Lines • ▼ Show 20 Line(s) | 753 | if (!service.entryPath().isEmpty() && | |||
---|---|---|---|---|---|
755 | !::makeServiceExecutable(service, window)) { | 755 | !::makeServiceExecutable(service, window)) { | ||
756 | return 0; | 756 | return 0; | ||
757 | } | 757 | } | ||
758 | 758 | | |||
759 | 759 | | |||
760 | if ((flags & DeleteTemporaryFiles) == 0) { | 760 | if ((flags & DeleteTemporaryFiles) == 0) { | ||
761 | // Remember we opened those urls, for the "recent documents" menu in kicker | 761 | // Remember we opened those urls, for the "recent documents" menu in kicker | ||
762 | for (const QUrl &url : urls) { | 762 | for (const QUrl &url : urls) { | ||
763 | // Only add files, or else the list of recent documents fills up | ||||
764 | // with non-documents (e.g. web URLs, appstream URLs, etc) | ||||
765 | if (KProtocolManager::supportsListing(url)) { | ||||
763 | KRecentDocument::add(url, service.desktopEntryName()); | 766 | KRecentDocument::add(url, service.desktopEntryName()); | ||
764 | } | 767 | } | ||
765 | } | 768 | } | ||
769 | } | ||||
766 | 770 | | |||
767 | return runApplicationImpl(service, urls, window, flags, suggestedFileName, asn); | 771 | return runApplicationImpl(service, urls, window, flags, suggestedFileName, asn); | ||
768 | } | 772 | } | ||
769 | 773 | | |||
770 | qint64 KRun::runService(const KService &_service, const QList<QUrl> &_urls, QWidget *window, | 774 | qint64 KRun::runService(const KService &_service, const QList<QUrl> &_urls, QWidget *window, | ||
771 | bool tempFiles, const QString &suggestedFileName, const QByteArray &asn) | 775 | bool tempFiles, const QString &suggestedFileName, const QByteArray &asn) | ||
772 | { | 776 | { | ||
773 | if (!_service.entryPath().isEmpty() && | 777 | if (!_service.entryPath().isEmpty() && | ||
774 | !KDesktopFile::isAuthorizedDesktopFile(_service.entryPath()) && | 778 | !KDesktopFile::isAuthorizedDesktopFile(_service.entryPath()) && | ||
775 | !::makeServiceExecutable(_service, window)) { | 779 | !::makeServiceExecutable(_service, window)) { | ||
776 | return 0; | 780 | return 0; | ||
777 | } | 781 | } | ||
778 | 782 | | |||
779 | if (!tempFiles) { | 783 | if (!tempFiles) { | ||
780 | // Remember we opened those urls, for the "recent documents" menu in kicker | 784 | // Remember we opened those urls, for the "recent documents" menu in kicker | ||
781 | for (const QUrl &url : _urls) { | 785 | for (const QUrl &url : _urls) { | ||
786 | // Only add files, or else the list of recent documents fills up | ||||
787 | // with non-documents (e.g. web URLs, appstream URLs, etc) | ||||
788 | if (KProtocolManager::supportsListing(url)) { | ||||
782 | KRecentDocument::add(url, _service.desktopEntryName()); | 789 | KRecentDocument::add(url, _service.desktopEntryName()); | ||
783 | } | 790 | } | ||
784 | } | 791 | } | ||
792 | } | ||||
785 | 793 | | |||
786 | bool useKToolInvocation = !(tempFiles || _service.entryPath().isEmpty() || !suggestedFileName.isEmpty()); | 794 | bool useKToolInvocation = !(tempFiles || _service.entryPath().isEmpty() || !suggestedFileName.isEmpty()); | ||
787 | 795 | | |||
788 | if (useKToolInvocation) { | 796 | if (useKToolInvocation) { | ||
789 | // Is klauncher installed? Let's try to start it, if it fails, then we won't use it. | 797 | // Is klauncher installed? Let's try to start it, if it fails, then we won't use it. | ||
790 | static int klauncherAvailable = -1; | 798 | static int klauncherAvailable = -1; | ||
791 | if (klauncherAvailable == -1) { | 799 | if (klauncherAvailable == -1) { | ||
792 | KToolInvocation::ensureKdeinitRunning(); | 800 | KToolInvocation::ensureKdeinitRunning(); | ||
▲ Show 20 Lines • Show All 848 Lines • Show Last 20 Lines |