diff --git a/README.md b/README.md index 3e9215c3..111cff2c 100644 --- a/README.md +++ b/README.md @@ -1,79 +1,79 @@ # KNewStuff Framework for downloading and sharing additional application data ## Introduction The KNewStuff library implements collaborative data sharing for applications. It uses libattica to support the Open Collaboration Services specification. ## Usage There are three parts to KNewStuff: * *KNewStuffCore* - The core functionality, which takes care of the actual work (downloading data and interacting with the remote services). Importantly, this library has no dependencies past Tier 1, and so while the entire framework is to be considered Tier 3, the KNewStuffCore library can be considered Tier 2 for integration purposes. * *KNewStuff* - A Qt Widget based UI library, designed for ease of implementation of various UI patterns found through KDE applications (such as the Get New Stuff buttons, as well as generic download and upload dialogues) * *KNewStuffQuick* - A set of Qt Quick based components designed to provide similar pattern support as KNewStuff, except for Qt Quick based applications, and specifically in Kirigami based applications. If you are using CMake, you need to find the modules, which can be done by doing one of the following in your CMakeLists.txt: Either use the more modern (and compact) component based method (only actually add the component you need, since both NewStuff and NewStuffQuick depend on NewStuffCore): find_package(KF5 COMPONENTS NewStuffCore NewStuff NewStuffQuick) Or use the old-fashioned syntax find_package(KF5NewStuffCore CONFIG) # for the KNewStuffCore library only find_package(KF5NewStuff CONFIG) # for the KNewStuff UI library, will pull in KNewStuffCore for you find_package(KF5NewStuffQuick CONFIG) # for the KNewStuffQuick UI library, will pull in KNewStuffCore for you Also remember to link to the library you are using (either KF5::NewStuff or KF5::NewStuffCore), and for the Qt Quick NewStuffQuick module, add the following to the QML files where you wish to use the components: import org.kde.newstuff 1.0 Finally, because KNewStuffQuick is not a link time requirement, it would be good form to mark it as a runtime requirement (and describing why you need them), which is done by adding the following in your CMakeLists.txt sometime after the find statement: set_package_properties(KF5NewStuffQuick PROPERTIES DESCRIPTION "Qt Quick components used for interacting with remote data services" URL "https://api.kde.org/frameworks/knewstuff/html/index.html" PURPOSE "Required to Get Hot New Stuff for my applicaton" TYPE RUNTIME) When installing your knsrc configuration file, you should install it into the location where KNewStuffCore expects it to be found. Do this by using the CMake variable KDE_INSTALL_KNSRCDIR as provided by the KNewStuffCore module. You can also handle this yourself, which means you will need to feed Engine::init() the full path to the knsrc file. ## Which module should you use? When building applications designed to fit in with other classic, widget based applications, the application authors should use KNS3::DownloadDialog for downloading application content. For uploading KNS3::UploadDialog is used. When building Qt Quick (and in particular Kirigami) based applications, you can use the NewStuffList item from the org.kde.newstuff import to achieve a similar functionality to KNS3::DownloadDialog. You can also use the ItemsModel directly, if this is not featureful enough. Uploading is currently not exposed in KNewStuffQuick. If neither of these options are powerful enough for your needs, you can access the functionality directly through the classes in the KNSCore namespace. Related information such as creation of *.knsrc files can be found on techbase in the [Get Hot New Stuff -tutorials](http://techbase.kde.org/Development/Tutorials#Get_Hot_New_Stuff). +tutorials](https://techbase.kde.org/Development/Tutorials#Get_Hot_New_Stuff). diff --git a/docs/packaging.txt b/docs/packaging.txt index 7534c6f7..5175b207 100644 --- a/docs/packaging.txt +++ b/docs/packaging.txt @@ -1,16 +1,16 @@ This file lists known packaging formats/drafts so we know if we need to do anything about it (e.g. provide convenience APIs for some packages). -Plasma: http://techbase.kde.org/Projects/Plasma/Package +Plasma: https://techbase.kde.org/Projects/Plasma/Package GGZ level packs: /playground/gamedata/README.gamedata in GGZ SVN ... (TODO: find out structure of KNewStuff1 packages) I considered also: * Artworks * Kross * QtScript * Custom (standard KGHNS2 package, supported additions app-specific) diff --git a/src/downloaddialog.h b/src/downloaddialog.h index 9a56772b..8c5ff0a7 100644 --- a/src/downloaddialog.h +++ b/src/downloaddialog.h @@ -1,153 +1,153 @@ /* knewstuff3/ui/downloaddialog.h. Copyright (C) 2005 by Enrico Ros Copyright (C) 2005 - 2007 Josef Spillner Copyright (C) 2007 Dirk Mueller Copyright (C) 2007-2009 Jeremy Whiting Copyright (C) 2009-2010 Frederik Gladhorn This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef KNEWSTUFF3_UI_DOWNLOADDIALOG_H #define KNEWSTUFF3_UI_DOWNLOADDIALOG_H #include #include "knewstuff_export.h" #include "entry.h" namespace KNSCore { class Engine; } namespace KNS3 { class DownloadDialogPrivate; /** * KNewStuff download dialog. * * The download dialog will present items to the user * for installation, updates and removal. * Preview images as well as other meta information can be seen. * * \section knsrc knsrc Files * The Dialog is configured by a .knsrc file containing the KHotNewStuff configuration. * Your application should install a file into the XDG configuration location called: /etc/xdg/appname.knsrc * * The file could look like this for wallpapers: *
    [KNewStuff3]
-   ProvidersUrl=http://download.kde.org/ocs/providers.xml
+   ProvidersUrl=https://download.kde.org/ocs/providers.xml
    Categories=KDE Wallpaper 1920x1200,KDE Wallpaper 1600x1200
    XdgTargetDir=wallpapers
    Uncompress=archive
  * 
* * Uncompress can be one of: always, never or archive: *
    *
  1. always: assume all downloaded files are archives and need to be extracted
  2. *
  3. never: never try to extract the file
  4. *
  5. archive: if the file is an archive, uncompress it, otherwise just pass it on
  6. *
  7. subdir: logic as archive, but decompress into a subdirectory named after the payload filename
  8. *
* * You have different options to set the target install directory: *
  1. StandardResource: not available in KF5, use XdgTargetDir instead.
  2. *
  3. TargetDir: since KF5, this is equivalent to XdgTargetDir. *
  4. XdgTargetDir: a directory in the $XDG_DATA_HOME directory such as .local/share/wallpapers. * This is what QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + name will return.
  5. *
* * @since 4.4 */ class KNEWSTUFF_EXPORT DownloadDialog : public QDialog { Q_OBJECT public: /** * Create a DownloadDialog that lets the user install, update and uninstall * contents. It will try to find a appname.knsrc file with the configuration. * Appname is the name of your application as provided in the about data-> * * @param parent the parent of the dialog */ explicit DownloadDialog(QWidget *parent = nullptr); /** * Create a DownloadDialog that lets the user install, update and uninstall * contents. Manually specify the name of a .knsrc file where the * KHotNewStuff configuration can be found. * * @param configFile the name of the configuration file * @param parent the parent of the dialog */ explicit DownloadDialog(const QString &configFile, QWidget *parent = nullptr); /** * destructor */ ~DownloadDialog() override; /** * The list of entries with changed status (installed/uninstalled) * @return the list of entries */ KNS3::Entry::List changedEntries(); /** * The list of entries that have been newly installed * @return the list of entries */ KNS3::Entry::List installedEntries(); /** * Set the title for display purposes in the widget's title. * @param title the title of the application (or category or whatever) */ void setTitle(const QString &title); /** * Get the current title * @return the current title */ QString title() const; /** * @return the engine used by this dialog * @since 5.30 */ KNSCore::Engine *engine(); public Q_SLOTS: // Override these slots so we can add KAuthorized checks to them. int exec() override; void open() override; protected: void showEvent(QShowEvent *event) override; private: void init(const QString &configFile); DownloadDialogPrivate *const d; Q_DISABLE_COPY(DownloadDialog) }; } #endif diff --git a/src/downloadwidget.h b/src/downloadwidget.h index 847a8d47..2afcb457 100644 --- a/src/downloadwidget.h +++ b/src/downloadwidget.h @@ -1,170 +1,170 @@ /* knewstuff3/ui/downloaddialog.h. Copyright (C) 2005 by Enrico Ros Copyright (C) 2005 - 2007 Josef Spillner Copyright (C) 2007 Dirk Mueller Copyright (C) 2007-2009 Jeremy Whiting Copyright (C) 2009-2010 Frederik Gladhorn This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef KNEWSTUFF3_UI_DOWNLOADWIDGET_H #define KNEWSTUFF3_UI_DOWNLOADWIDGET_H #include #include "knewstuff_export.h" #include "entry.h" namespace KNSCore { class Engine; } namespace KNS3 { class DownloadWidgetPrivate; /** * KNewStuff download widget. * * The download widget will present items to the user * for installation, updates and removal. * Preview images as well as other meta information can be seen. * * \section knsrc knsrc Files * The Dialog is configured by a .knsrc file containing the KHotNewStuff configuration. * Your application should install a file called: $KDEDIR/share/config/appname.knsrc * * The file could look like this for wallpapers: *
    [KNewStuff3]
-   ProvidersUrl=http://download.kde.org/ocs/providers.xml
+   ProvidersUrl=https://download.kde.org/ocs/providers.xml
    Categories=KDE Wallpaper 1920x1200,KDE Wallpaper 1600x1200
    StandardResource=wallpaper
    Uncompress=archive
  * 
* * Uncompress can be one of: always, never or archive: *
    *
  1. always: assume all downloaded files are archives and need to be extracted
  2. *
  3. never: never try to extract the file
  4. *
  5. archive: if the file is an archive, uncompress it, otherwise just pass it on
  6. *
  7. subdir: logic as archive, but decompress into a subdirectory named after the payload filename
  8. *
* * You have different options to set the target install directory: *
  1. StandardResource: not available in KF5, use XdgTargetDir instead.
  2. *
  3. TargetDir: since KF5, this is equivalent to XdgTargetDir. *
  4. XdgTargetDir: a directory in the $XDG_DATA_HOME directory such as .local/share/wallpapers. * This is what QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + name will return.
  5. *
* * @since 4.5 */ class KNEWSTUFF_EXPORT DownloadWidget : public QWidget { Q_OBJECT public: /** * Create a download widget that lets the user install, update and uninstall * contents. It will try to find a appname.knsrc file with the configuration. * Appname is the name of your application as provided in the about data-> * * @param parent the parent of the dialog */ explicit DownloadWidget(QWidget *parent = nullptr); /** * Create a download widget that lets the user install, update and uninstall * contents. Manually specify the name of a .knsrc file where the * KHotNewStuff configuration can be found. * * @param configFile the name of the configuration file * @param parent the parent of the dialog */ explicit DownloadWidget(const QString &configFile, QWidget *parent = nullptr); /** * destructor */ ~DownloadWidget(); /** * The list of entries with changed status (installed/uninstalled) * @return the list of entries */ KNS3::Entry::List changedEntries(); /** * The list of entries that have been newly installed * @return the list of entries */ KNS3::Entry::List installedEntries(); /** * Set the title for display purposes in the widget's title. * @param title the title of the application (or category or whatever) */ void setTitle(const QString &title); /** * Get the current title * @return the current title */ QString title() const; /** * @return the engine used by this download widget * @since 5.30 */ KNSCore::Engine *engine(); private: void init(const QString &configFile); DownloadWidgetPrivate *const d; Q_DISABLE_COPY(DownloadWidget) Q_PRIVATE_SLOT(d, void slotListViewListMode()) Q_PRIVATE_SLOT(d, void slotListViewIconMode()) Q_PRIVATE_SLOT(d, void slotProvidersLoaded()) Q_PRIVATE_SLOT(d, void slotEntriesLoaded(const KNSCore::EntryInternal::List &entries)) Q_PRIVATE_SLOT(d, void slotEntryChanged(const KNSCore::EntryInternal &entry)) Q_PRIVATE_SLOT(d, void slotShowDetails(const KNSCore::EntryInternal &entry)) Q_PRIVATE_SLOT(d, void slotShowOverview()) Q_PRIVATE_SLOT(d, void slotPayloadFailed(const KNSCore::EntryInternal &entry)) Q_PRIVATE_SLOT(d, void slotPayloadLoaded(QUrl url)) Q_PRIVATE_SLOT(d, void slotResetMessage()) Q_PRIVATE_SLOT(d, void slotNetworkTimeout()) Q_PRIVATE_SLOT(d, void sortingChanged()) Q_PRIVATE_SLOT(d, void slotSearchTextChanged()) Q_PRIVATE_SLOT(d, void slotUpdateSearch()) Q_PRIVATE_SLOT(d, void slotCategoryChanged(int)) Q_PRIVATE_SLOT(d, void slotInfo(QString provider, QString server, QString version)) Q_PRIVATE_SLOT(d, void slotError(const QString &message)) Q_PRIVATE_SLOT(d, void scrollbarValueChanged(int value)) friend class DownloadDialog; }; } #endif diff --git a/src/downloadwidget.ui b/src/downloadwidget.ui index 181ff6e6..02341fed 100644 --- a/src/downloadwidget.ui +++ b/src/downloadwidget.ui @@ -1,643 +1,643 @@ DownloadWidget 0 0 724 490 0 true 2 0 true QAbstractItemView::NoSelection QAbstractItemView::ScrollPerPixel 10 Provider: m_providerCombo QComboBox::AdjustToMinimumContentsLength Category: m_categoryCombo 0 0 Most downloads true true Newest Rating Installed Qt::Vertical QSizePolicy::Fixed 20 10 Qt::Vertical QSizePolicy::Fixed 20 10 Qt::Vertical 20 40 0 0 Order by: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Search: m_searchEdit Qt::Vertical QSizePolicy::Fixed 20 10 Enter search phrase here true Qt::Horizontal QSizePolicy::Fixed 9 20 true true true false m_listView true 0 0 684 392 0 0 0 100 0 100 100 0 0 100 0 100 100 0 0 100 0 100 100 0 0 0 0 Author: 0 0 true - <a href="http://opendesktop.org">Homepage</a> + <a href="https://opendesktop.org">Homepage</a> true 0 10 false Qt::Horizontal 40 20 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop true Qt::Vertical QSizePolicy::Fixed 20 12 Qt::Vertical QSizePolicy::Fixed 20 12 0 0 300 100 300 300 Qt::Vertical 20 0 0 20 0 20 16777215 20 QFrame::NoFrame QFrame::Raised 1 true Update true Uninstall Become a Fan Install KTitleWidget QWidget
ktitlewidget.h
KLineEdit QLineEdit
klineedit.h
KComboBox QComboBox
kcombobox.h
KNS3::ProgressIndicator QFrame
ui/progressindicator_p.h
1
KNS3::ItemsView QListView
ui/itemsview_p.h
KRatingWidget QFrame
kratingwidget.h
1
KNS3::ImagePreviewWidget QWidget
ui/imagepreviewwidget_p.h
1
diff --git a/src/kmoretools/kmoretoolspresets.cpp b/src/kmoretools/kmoretoolspresets.cpp index 4c2f3c5e..6c6ccf50 100644 --- a/src/kmoretools/kmoretoolspresets.cpp +++ b/src/kmoretools/kmoretoolspresets.cpp @@ -1,202 +1,201 @@ /* Copyright 2015 by Gregor Mi This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #include "kmoretoolspresets.h" #include "kmoretoolspresets_p.h" #include "knewstuff_debug.h" #include #include #include #define _ QStringLiteral class KmtServiceInfo { public: KmtServiceInfo(const QString &desktopEntryName, const QString &homepageUrl, int maxUrlArgCount, const QString &appstreamId) : desktopEntryName(desktopEntryName), homepageUrl(homepageUrl), maxUrlArgCount(maxUrlArgCount), appstreamId(appstreamId) { } public: QString desktopEntryName; QString homepageUrl; int maxUrlArgCount; QString appstreamId; }; // // todo later: add a property "maturity" with values "stable" > "new" > "incubating" or similar // KMoreToolsService* KMoreToolsPresets::registerServiceByDesktopEntryName(KMoreTools* kmt, const QString& desktopEntryName) { static QHash dict; #define ADD_ENTRY(desktopEntryName, maxUrlArgCount, homepageUrl, appstreamUrl) dict.insert(desktopEntryName, KmtServiceInfo(desktopEntryName, QLatin1String(homepageUrl), maxUrlArgCount, appstreamUrl)); // // definitions begin (sorted alphabetically): // .------ If one gives more URL arguments as // | specified here the program will not work. // | Note, that there are some desktop files where _too few_ // | arguments also lead to errors. Watch the console // v output for messages from the program. // ADD_ENTRY(QStringLiteral("angrysearch"), 0, "https://github.com/DoTheEvo/ANGRYsearch", QString()); ADD_ENTRY(QStringLiteral("com.uploadedlobster.peek"), 0, "https://github.com/phw/peek", QStringLiteral("com.uploadedlobster.peek.desktop")); // easy to use screen recorder, creates gif ADD_ENTRY(QStringLiteral("catfish"), 1, "http://www.twotoasts.de/index.php/catfish/", QStringLiteral("catfish")); - ADD_ENTRY(QStringLiteral("ding"), 0, "https://www-user.tu-chemnitz.de/~fri/ding/", QString()); // Offline dict, Online: http://dict.tu-chemnitz.de/dings.cgi + ADD_ENTRY(QStringLiteral("ding"), 0, "https://www-user.tu-chemnitz.de/~fri/ding/", QString()); // Offline dict, Online: https://dict.tu-chemnitz.de/dings.cgi ADD_ENTRY(QStringLiteral("disk"), 0, "https://en.opensuse.org/YaST_Disk_Controller", QString()); ADD_ENTRY(QStringLiteral("fontinst"), 0, "https://docs.kde.org/trunk5/en/kde-workspace/kcontrol/fontinst/", QString()); // good for previewing many fonts at once ADD_ENTRY(QStringLiteral("fontmatrix"), 0, "https://github.com/fontmatrix/fontmatrix", QString()); ADD_ENTRY(QStringLiteral("fsearch"), 0, "https://github.com/cboxdoerfer/fsearch", QString()); ADD_ENTRY(QStringLiteral("giggle"), 1, "https://wiki.gnome.org/Apps/giggle/", QStringLiteral("giggle.desktop")); // good for searching in history ADD_ENTRY(QStringLiteral("git-cola-folder-handler"), 1, "https://git-cola.github.io", QStringLiteral("git-cola.desktop")); ADD_ENTRY(QStringLiteral("git-cola-view-history.kmt-edition"), 1, "https://git-cola.github.io", QStringLiteral("git-cola.desktop")); - ADD_ENTRY(QStringLiteral("gitk.kmt-edition"), 1, "http://git-scm.com/docs/gitk", QString()); - ADD_ENTRY(QStringLiteral("qgit.kmt-edition"), 1, "http://libre.tibirna.org/projects/qgit", QString()); + ADD_ENTRY(QStringLiteral("gitk.kmt-edition"), 1, "https://git-scm.com/docs/gitk", QString()); + ADD_ENTRY(QStringLiteral("qgit.kmt-edition"), 1, "https://github.com/tibirna/qgit", QString()); ADD_ENTRY(QStringLiteral("gitg"), 1, "https://wiki.gnome.org/action/show/Apps/Gitg?action=show&redirect=Gitg", QStringLiteral("gitg.desktop")); ADD_ENTRY(QStringLiteral("gnome-search-tool"), 0, "https://help.gnome.org/users/gnome-search-tool/", QStringLiteral("gnome-search-tool.desktop")); // has good filtering options ADD_ENTRY(QStringLiteral("gucharmap"), 0, "https://wiki.gnome.org/action/show/Apps/Gucharmap", QStringLiteral("gucharmap.desktop")); - ADD_ENTRY(QStringLiteral("gparted"), 0, "http://gparted.org", QStringLiteral("gparted.desktop")); - ADD_ENTRY(QStringLiteral("htop"), 0, "http://hisham.hm/htop/", QStringLiteral("htop.desktop")); - ADD_ENTRY(QStringLiteral("hotshots"), 1, "http://sourceforge.net/projects/hotshots/", QString()); - ADD_ENTRY(QStringLiteral("kaption"), 0, "http://kde-apps.org/content/show.php/?content=139302", QString()); + ADD_ENTRY(QStringLiteral("gparted"), 0, "https://gparted.org", QStringLiteral("gparted.desktop")); + ADD_ENTRY(QStringLiteral("htop"), 0, "https://hisham.hm/htop/", QStringLiteral("htop.desktop")); + ADD_ENTRY(QStringLiteral("hotshots"), 1, "https://sourceforge.net/projects/hotshots/", QString()); + ADD_ENTRY(QStringLiteral("kaption"), 0, "https://www.linux-apps.com/content/show.php/?content=139302", QString()); ADD_ENTRY(QStringLiteral("kding"), 0, "", QString()); // Offline dict; unmaintained? ADD_ENTRY(QStringLiteral("org.kde.kmousetool"), 0, "https://www.kde.org/applications/utilities/kmousetool/", QStringLiteral("org.kde.kmousetool")); ADD_ENTRY(QStringLiteral("org.gnome.clocks"), 0, "https://wiki.gnome.org/Apps/Clocks", QStringLiteral("org.gnome.clocks.desktop")); ADD_ENTRY(QStringLiteral("org.kde.filelight"), 1, "https://utils.kde.org/projects/filelight", QStringLiteral("org.kde.filelight.desktop")); ADD_ENTRY(QStringLiteral("org.kde.kcharselect"), 0, "https://utils.kde.org/projects/kcharselect/", QStringLiteral("org.kde.kcharselect")); ADD_ENTRY(QStringLiteral("org.kde.kdf"), 0, "https://www.kde.org/applications/system/kdiskfree", QStringLiteral("org.kde.kdf")); ADD_ENTRY(QStringLiteral("org.kde.kfind"), 1, "https://www.kde.org/applications/utilities/kfind/", QStringLiteral("org.kde.kfind.desktop")); // has good filtering options ADD_ENTRY(QStringLiteral("org.kde.partitionmanager"), 0, "https://www.kde.org/applications/system/kdepartitionmanager/", QStringLiteral("org.kde.partitionmanager.desktop")); - ADD_ENTRY(QStringLiteral("org.kde.plasma.cuttlefish.kmt-edition"), 0, "http://vizzzion.org/blog/2015/02/say-hi-to-cuttlefish/", QStringLiteral("org.kde.plasma.cuttlefish")); + ADD_ENTRY(QStringLiteral("org.kde.plasma.cuttlefish.kmt-edition"), 0, "https://vizzzion.org/blog/2015/02/say-hi-to-cuttlefish/", QStringLiteral("org.kde.plasma.cuttlefish")); ADD_ENTRY(QStringLiteral("org.kde.ksysguard"), 0, "https://userbase.kde.org/KSysGuard", QStringLiteral("org.kde.ksysguard")); ADD_ENTRY(QStringLiteral("org.kde.ksystemlog"), 0, "https://www.kde.org/applications/system/ksystemlog/", QStringLiteral("org.kde.ksystemlog")); ADD_ENTRY(QStringLiteral("org.kde.ktimer"), 0, "https://www.kde.org/applications/utilities/ktimer/", QStringLiteral("org.kde.ktimer")); ADD_ENTRY(QStringLiteral("org.kde.spectacle"), 0, "https://www.kde.org/applications/graphics/spectacle", QStringLiteral("org.kde.spectacle.desktop")); - ADD_ENTRY(QStringLiteral("simplescreenrecorder"), 0, "http://www.maartenbaert.be/simplescreenrecorder/", QStringLiteral("simplescreenrecorder.desktop")); - ADD_ENTRY(QStringLiteral("shutter"), 0, "http://shutter-project.org", QStringLiteral("org.shutterproject.shutter")); // good for edit screenshot after capture + ADD_ENTRY(QStringLiteral("simplescreenrecorder"), 0, "https://www.maartenbaert.be/simplescreenrecorder/", QStringLiteral("simplescreenrecorder.desktop")); ADD_ENTRY(QStringLiteral("vokoscreen"), 0, "https://github.com/vkohaupt/vokoscreen", QString()); // feature-rich screen recorder - ADD_ENTRY(QStringLiteral("xfce4-taskmanager"), 0, "http://goodies.xfce.org/projects/applications/xfce4-taskmanager", QStringLiteral("xfce4-taskmanager.desktop")); + ADD_ENTRY(QStringLiteral("xfce4-taskmanager"), 0, "https://goodies.xfce.org/projects/applications/xfce4-taskmanager", QStringLiteral("xfce4-taskmanager.desktop")); // // ...definitions end // #undef ADD_ENTRY auto iter = dict.constFind(desktopEntryName); if (iter != dict.constEnd()) { auto kmtServiceInfo = *iter; const QString subdir = QStringLiteral("presets-kmoretools"); auto serviceLocatingMode = desktopEntryName.endsWith(QLatin1String(".kmt-edition")) ? KMoreTools::ServiceLocatingMode_ByProvidedExecLine : KMoreTools::ServiceLocatingMode_Default; auto service = kmt->registerServiceByDesktopEntryName(desktopEntryName, subdir, serviceLocatingMode); if (service) { // We might get nullptr in case of missing or broken .desktop files service->setHomepageUrl(QUrl(kmtServiceInfo.homepageUrl)); service->setMaxUrlArgCount(kmtServiceInfo.maxUrlArgCount); service->setAppstreamId(kmtServiceInfo.appstreamId); } return service; } else { qCDebug(KNEWSTUFF) << "KMoreToolsPresets::registerServiceByDesktopEntryName: " << desktopEntryName << "was not found. Return nullptr."; return nullptr; } } QList KMoreToolsPresets::registerServicesByGroupingNames(KMoreTools* kmt, const QStringList& groupingNames) { QString firstMoreSectionDesktopEntryName; return KMoreToolsPresetsPrivate::registerServicesByGroupingNames(&firstMoreSectionDesktopEntryName, kmt, groupingNames); } QList KMoreToolsPresetsPrivate::registerServicesByGroupingNames(QString* firstMoreSectionDesktopEntryName, KMoreTools* kmt, const QStringList& groupingNames) { static QHash> dict; // The corresponding desktop files are located here: // 'knewstuff/data/kmoretools-desktopfiles/' // Use KMoreToolsTest2::testDialogForGroupingNames to see if the settings // here are correct. // NOTE that the desktopentry names must be registered in // registerServiceByDesktopEntryName above. // For special handlings about naming in the menu etc. see kmoretoolsmenufactory.cpp/addItemsForGroupingNameWithSpecialHandling // // grouping definitions begin (sorted alphabetically): // dict.insert(_("disk-usage"), { _("org.kde.kdf"), _("org.kde.filelight") }); dict.insert(_("disk-partitions"), { _("gparted"), _("org.kde.partitionmanager"), _("disk") }); dict.insert(_("files-find"), { _("org.kde.kfind"), _("fsearch"), _("more:"), _("gnome-search-tool"), _("catfish"), _("angrysearch") }); dict.insert(_("font-tools"), { _("fontinst"), _("gucharmap"), _("more:"), _("org.kde.kcharselect"), _("fontmatrix") }); dict.insert(_("git-clients-for-folder"), { _("git-cola-folder-handler"), _("gitk.kmt-edition"), _("giggle"), _("qgit.kmt-edition"), _("gitg") }); dict.insert(_("git-clients-and-actions"), { _("git-cola-folder-handler"), _("git-cola-view-history.kmt-edition"), _("giggle"), _("gitk.kmt-edition"), _("qgit.kmt-edition"), _("gitg") }); dict.insert(_("icon-browser"), { _("org.kde.plasma.cuttlefish.kmt-edition") }); dict.insert(_("language-dictionary"), { _("ding"), _("kding") }); dict.insert(_("mouse-tools"), { _("org.kde.kmousetool") }); // todo: add program "xbanish" to remove mouse cursor while typing dict.insert(_("screenrecorder"), { _("com.uploadedlobster.peek"), _("simplescreenrecorder"), _("vokoscreen") }); dict.insert(_("screenshot-take"), { _("org.kde.spectacle"), _("shutter"), _("kaption"), _("hotshots") }); dict.insert(_("system-monitor-processes"), { _("org.kde.ksysguard"), _("more:"), _("htop"), _("xfce4-taskmanager") }); dict.insert(_("system-monitor-logs"), { _("org.kde.ksystemlog") }); dict.insert(_("time-countdown"), { _("org.gnome.clocks"), _("org.kde.ktimer") }); // // ...grouping definitions end // QList resultList; QSet alreadyUsedDesktopEntryNames; // including the "more:" keyword bool nextIsMore = false; for (const QString &groupingName : groupingNames) { auto iter = dict.constFind(groupingName); if (iter != dict.constEnd()) { for (const QString &desktopEntryName : qAsConst(*iter)) { if (!alreadyUsedDesktopEntryNames.contains(desktopEntryName)) { if (desktopEntryName == _("more:")) { nextIsMore = true; } else { if (nextIsMore) { // this will be only set once *firstMoreSectionDesktopEntryName = desktopEntryName; nextIsMore = false; } KMoreToolsService *kmtService = KMoreToolsPresets::registerServiceByDesktopEntryName(kmt, desktopEntryName); if (kmtService) { // Do not add null pointers caused by missing or broken .desktop files resultList << kmtService; } } } else { alreadyUsedDesktopEntryNames.insert(desktopEntryName); } } } else { qCWarning(KNEWSTUFF) << "KMoreToolsPresets::registerServicesByGroupingName: groupingName not found: " << groupingName; } } if (resultList.isEmpty()) { qCWarning(KNEWSTUFF) << "KMoreToolsPresets::registerServicesByGroupingName: " << groupingNames << ". Nothing found in this groupings. HINT: check for invalid grouping names."; } return resultList; }