Changeset View
Changeset View
Standalone View
Standalone View
src/kmoretools/kmoretools.cpp
Show First 20 Lines • Show All 199 Lines • ▼ Show 20 Line(s) | |||||
200 | public: | 200 | public: | ||
201 | QString kmtDesktopfileSubdir; | 201 | QString kmtDesktopfileSubdir; | ||
202 | QString desktopEntryName; | 202 | QString desktopEntryName; | ||
203 | KService::Ptr installedService; | 203 | KService::Ptr installedService; | ||
204 | KService::Ptr kmtDesktopfile; | 204 | KService::Ptr kmtDesktopfile; | ||
205 | QUrl homepageUrl; | 205 | QUrl homepageUrl; | ||
206 | int maxUrlArgCount = 0; | 206 | int maxUrlArgCount = 0; | ||
207 | bool isInstalled = false; | 207 | bool isInstalled = false; | ||
208 | QString appstreamId; | ||||
208 | 209 | | |||
209 | 210 | | |||
210 | public: | 211 | public: | ||
211 | QString getServiceName() | 212 | QString getServiceName() | ||
212 | { | 213 | { | ||
213 | if (installedService) { | 214 | if (installedService) { | ||
214 | return installedService->name(); | 215 | return installedService->name(); | ||
215 | } else { | 216 | } else { | ||
▲ Show 20 Lines • Show All 147 Lines • ▼ Show 20 Line(s) | |||||
363 | void KMoreToolsService::setExec(const QString& exec) | 364 | void KMoreToolsService::setExec(const QString& exec) | ||
364 | { | 365 | { | ||
365 | auto service = installedService(); | 366 | auto service = installedService(); | ||
366 | if (service) { | 367 | if (service) { | ||
367 | service->setExec(exec); | 368 | service->setExec(exec); | ||
368 | } | 369 | } | ||
369 | } | 370 | } | ||
370 | 371 | | |||
372 | QString KMoreToolsService::appstreamId() const | ||||
373 | { | ||||
374 | return d->appstreamId; | ||||
375 | } | ||||
376 | | ||||
377 | void KMoreToolsService::setAppstreamId(const QString& id) | ||||
378 | { | ||||
379 | d->appstreamId = id; | ||||
380 | } | ||||
381 | | ||||
382 | | ||||
371 | // ------------------------------------------------------------------------------------------------ | 383 | // ------------------------------------------------------------------------------------------------ | ||
372 | // ------------------------------------------------------------------------------------------------ | 384 | // ------------------------------------------------------------------------------------------------ | ||
373 | 385 | | |||
374 | const QString configFile = QStringLiteral("kmoretoolsrc"); | 386 | const QString configFile = QStringLiteral("kmoretoolsrc"); | ||
375 | const QString configKey = QStringLiteral("menu_structure"); | 387 | const QString configKey = QStringLiteral("menu_structure"); | ||
376 | 388 | | |||
377 | class KMoreToolsMenuBuilderPrivate | 389 | class KMoreToolsMenuBuilderPrivate | ||
378 | { | 390 | { | ||
▲ Show 20 Lines • Show All 266 Lines • ▼ Show 20 Line(s) | 647 | if (!mstruct.moreItems.isEmpty() || !mstruct.notInstalledServices.isEmpty()) { | |||
645 | 657 | | |||
646 | if (!mstruct.notInstalledServices.isEmpty()) { | 658 | if (!mstruct.notInstalledServices.isEmpty()) { | ||
647 | //qDebug() << "notInstalledItems not empty => build 'Not installed' section"; | 659 | //qDebug() << "notInstalledItems not empty => build 'Not installed' section"; | ||
648 | moreMenu->addSection(i18nc("@action:inmenu", "Not installed:")); | 660 | moreMenu->addSection(i18nc("@action:inmenu", "Not installed:")); | ||
649 | 661 | | |||
650 | Q_FOREACH (auto registeredService, mstruct.notInstalledServices) { | 662 | Q_FOREACH (auto registeredService, mstruct.notInstalledServices) { | ||
651 | 663 | | |||
652 | QMenu* submenuForNotInstalled = KmtNotInstalledUtil::createSubmenuForNotInstalledApp( | 664 | QMenu* submenuForNotInstalled = KmtNotInstalledUtil::createSubmenuForNotInstalledApp( | ||
653 | registeredService->formatString(QStringLiteral("$Name")), menu, registeredService->icon(), registeredService->homepageUrl()); | 665 | registeredService->formatString(QStringLiteral("$Name")), menu, registeredService->icon(), registeredService->homepageUrl(), registeredService->appstreamId()); | ||
654 | moreMenu->addMenu(submenuForNotInstalled); | 666 | moreMenu->addMenu(submenuForNotInstalled); | ||
655 | } | 667 | } | ||
656 | } | 668 | } | ||
657 | } | 669 | } | ||
658 | 670 | | |||
659 | if (moreMenu->isEmpty()) { | 671 | if (moreMenu->isEmpty()) { | ||
660 | if (outMoreMenu) { | 672 | if (outMoreMenu) { | ||
661 | *outMoreMenu = nullptr; | 673 | *outMoreMenu = nullptr; | ||
▲ Show 20 Lines • Show All 133 Lines • Show Last 20 Lines |