mirror of
https://github.com/MatMoul/plasma-containmentactions-customdesktopmenu.git
synced 2024-12-23 06:26:11 +00:00
Implement show by name option
This commit is contained in:
parent
2f66f5cabc
commit
09a62ab6ea
@ -122,7 +122,11 @@ void CustomDesktopMenu::parseConfig()
|
||||
// .desktop file
|
||||
if(KDesktopFile::isDesktopFile(cfgLine) == true) {
|
||||
KDesktopFile desktopFile(cfgLine);
|
||||
action = new QAction(QIcon::fromTheme(desktopFile.readIcon()), desktopFile.readName(), this);
|
||||
QString text = desktopFile.name();
|
||||
if (!m_showAppsByName && !desktopFile.readGenericName().isEmpty()) {
|
||||
text = desktopFile.readGenericName();
|
||||
}
|
||||
action = new QAction(QIcon::fromTheme(desktopFile.readIcon()), text, this);
|
||||
action->setData(cfgLine);
|
||||
connect(action, &QAction::triggered, [action](){
|
||||
KService::Ptr service = KService::serviceByDesktopPath(action->data().toString());
|
||||
@ -179,7 +183,11 @@ void CustomDesktopMenu::fillPrograms(const QString& path)
|
||||
if(p->isType(KST_KService)) {
|
||||
if(KDesktopFile::isDesktopFile(p->entryPath()) == true) {
|
||||
KDesktopFile desktopFile(p->entryPath());
|
||||
action = new QAction(QIcon::fromTheme(desktopFile.readIcon()), desktopFile.readName(), this);
|
||||
QString text = p->name();
|
||||
if (!m_showAppsByName && !desktopFile.readGenericName().isEmpty()) {
|
||||
text = desktopFile.readGenericName();
|
||||
}
|
||||
action = new QAction(QIcon::fromTheme(desktopFile.readIcon()), text, this);
|
||||
action->setData(p->entryPath());
|
||||
connect(action, &QAction::triggered, [action](){
|
||||
KService::Ptr service = KService::serviceByDesktopPath(action->data().toString());
|
||||
|
Loading…
Reference in New Issue
Block a user