KNewStuff
kmoretoolsmenufactory.cpp
98 qCDebug(KNEWSTUFF) << "Desktop file not installed:" << kmtService->desktopEntryName() << "=> Use desktop file provided by KMoreTools";
183 i18nc("@action:inmenu %1=\"$GenericName\"", "%1 - current folder", QStringLiteral("$GenericName"))));
191 i18nc("@action:inmenu %1=\"$GenericName\"", "%1 - current device", QStringLiteral("$GenericName"))));
204 i18nc("@action:inmenu %1=\"$GenericName\"", "%1 - all devices", QStringLiteral("$GenericName"))));
219 addItemsFromKmtServiceList(menuBuilder, menu, kmtServiceList, url, isMoreSection, firstMoreSectionDesktopEntryName);
230 menuBuilder->setInitialItemTextTemplate(QStringLiteral("$Name")); // just use the application name
237 if (url.isLocalFile()) { // this can only be done for local files, remote urls probably won't work for git clients anyway
239 // (this impl currently leads to wrong behaviour if the root dir of a git repo is chosen because it always goes one level up)
259 menuBuilder->setInitialItemTextTemplate(QStringLiteral("$Name")); // just use the application name
260 addItemsFromKmtServiceList(menuBuilder, menu, kmtServiceList, url, isMoreSection, firstMoreSectionDesktopEntryName);
271 menu->setAboutToShowAction([this, groupingNames, url](QMenu* m) { fillMenuFromGroupingNames(m, groupingNames, url); });
277 void KMoreToolsMenuFactory::fillMenuFromGroupingNames(QMenu* menu, const QStringList& groupingNames, const QUrl& url)
void setText(const QString &text)
A service described in a .desktop file (kmt-desktopfile) which will be called "registered service"...
Definition: kmoretools.h:361
void triggered(bool checked)
Define how the default structure of the menu should look like.
Definition: kmoretools.h:534
static List currentMountPoints(DetailsNeededFlags infoNeeded=BasicInfoNeeded)
void setParentWidget(QWidget *widget)
Set widget as the parent widget of the QMenu that will be created by createMenuFromGroupingNames().
Definition: kmoretoolsmenufactory.cpp:307
KMoreToolsMenuFactory(const QString &uniqueId)
Definition: kmoretoolsmenufactory.cpp:54
KService::Ptr installedService() const
Definition: kmoretools.cpp:264
bool isEmpty() const const
QAction * action() const
Case 1 KMoreToolsMenuBuilder::addMenuItem was called with KKmoreToolsService* argument.
Definition: kmoretools.cpp:752
void setInitialItemTextTemplate(const QString &templateText)
Affects addMenuItem() if called before it.
Definition: kmoretools.cpp:563
QString i18nc(const char *context, const char *text, const TYPE &arg...)
AutoHandlingEnabled
QString toLocalFile() const const
QList::iterator end()
KService::Ptr kmtProvidedService() const
Definition: kmoretools.cpp:269
KMoreToolsMenuItem * addMenuItem(KMoreToolsService *registeredService, KMoreTools::MenuSection defaultLocation=KMoreTools::MenuSection_Main)
Adds a registered service (which can installed or not) to the menu.
Definition: kmoretools.cpp:568
Ptr findByPath(const QString &path) const
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void fillMenuFromGroupingNames(QMenu *menu, const QStringList &groupingNames, const QUrl &url=QUrl())
See createMenuFromGroupingNames except that the menu is not created but you have to provide one yours...
Definition: kmoretoolsmenufactory.cpp:277
bool removeOne(const T &value)
void clear()
QMenu * createMenuFromGroupingNames(const QStringList &groupingNames, const QUrl &url=QUrl())
For each grouping name menu items will be created an appended to a lazy menu which is returned...
Definition: kmoretoolsmenufactory.cpp:264
QList::iterator begin()
void buildByAppendingToMenu(QMenu *menu, KMoreTools::ConfigureDialogAccessibleSetting configureDialogAccessibleSetting=KMoreTools::ConfigureDialogAccessible_Always, QMenu **outMoreMenu=nullptr)
Builds the actual menu and appends all items (main items, more submenu with a potential "not installe...
Definition: kmoretools.cpp:616
Helps to create user-configurable menus with tools which are potentially not yet installed.
Definition: kmoretools.h:161
The item is placed in the main section (default)
Definition: kmoretools.h:192
QUrl fromLocalFile(const QString &localFile)
bool isLocalFile() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 18 2021 22:43:50 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 18 2021 22:43:50 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.