Add list with all apps to config for debugging purposes

This commit is contained in:
Sebastian Kügler 2015-06-19 21:28:00 -07:00
parent 0e5ce58bbe
commit d197736adc

View file

@ -80,6 +80,12 @@ void ApplicationListModel::loadApplications()
{ {
auto cfg = KSharedConfig::openConfig("applications-blacklistrc"); auto cfg = KSharedConfig::openConfig("applications-blacklistrc");
auto blgroup = KConfigGroup(cfg, QStringLiteral("Applications")); auto blgroup = KConfigGroup(cfg, QStringLiteral("Applications"));
// This is only temporary to get a clue what those apps' desktop files are called
// I'll remove it once I've done a blacklist
QStringList bl;
QStringList blacklist = blgroup.readEntry("blacklist", QStringList()); QStringList blacklist = blgroup.readEntry("blacklist", QStringList());
beginResetModel(); beginResetModel();
@ -109,11 +115,16 @@ void ApplicationListModel::loadApplications()
if (entry->property("Exec").isValid()) { if (entry->property("Exec").isValid()) {
KService::Ptr service(static_cast<KService* >(entry.data())); KService::Ptr service(static_cast<KService* >(entry.data()));
qDebug() << " desktopEntryName: " << service->desktopEntryName();
if (service->isApplication() && if (service->isApplication() &&
!blacklist.contains(service->desktopEntryName() + QStringLiteral(".desktop")) && !blacklist.contains(service->desktopEntryName() + QStringLiteral(".desktop")) &&
service->showOnCurrentPlatform() && service->showOnCurrentPlatform() &&
!service->property("Terminal", QVariant::Bool).toBool()) { !service->property("Terminal", QVariant::Bool).toBool()) {
bl << service->desktopEntryName();
data.name = service->name(); data.name = service->name();
data.icon = service->icon(); data.icon = service->icon();
data.storageId = service->storageId(); data.storageId = service->storageId();
@ -131,6 +142,9 @@ void ApplicationListModel::loadApplications()
} }
} }
blgroup.writeEntry("allapps", bl);
cfg.sync();
std::sort(unorderedList.begin(), unorderedList.end(), appNameLessThan); std::sort(unorderedList.begin(), unorderedList.end(), appNameLessThan);
m_applicationList << orderedList.values(); m_applicationList << orderedList.values();
m_applicationList << unorderedList; m_applicationList << unorderedList;