Changeset View
Changeset View
Standalone View
Standalone View
sidebar/module_manager.cpp
Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Line(s) | |||||
144 | void ModuleManager::setModuleIcon(const QString &fileName, const QString &icon) | 144 | void ModuleManager::setModuleIcon(const QString &fileName, const QString &icon) | ||
145 | { | 145 | { | ||
146 | KConfig desktopFile(m_localPath + fileName, KConfig::SimpleConfig); | 146 | KConfig desktopFile(m_localPath + fileName, KConfig::SimpleConfig); | ||
147 | KConfigGroup ksc(&desktopFile, "Desktop Entry"); | 147 | KConfigGroup ksc(&desktopFile, "Desktop Entry"); | ||
148 | ksc.writePathEntry("Icon", icon); | 148 | ksc.writePathEntry("Icon", icon); | ||
149 | ksc.sync(); | 149 | ksc.sync(); | ||
150 | } | 150 | } | ||
151 | 151 | | |||
152 | void ModuleManager::setShowHiddenFolders(const QString &fileName, const bool &newState) | ||||
153 | { | ||||
154 | KConfig desktopFile(m_localPath + fileName, KConfig::SimpleConfig); | ||||
155 | KConfigGroup ksc(&desktopFile, "Desktop Entry"); | ||||
156 | ksc.writeEntry("ShowHiddenFolders", newState); | ||||
157 | ksc.sync(); | ||||
158 | } | ||||
159 | | ||||
152 | void ModuleManager::removeModule(const QString &fileName) | 160 | void ModuleManager::removeModule(const QString &fileName) | ||
153 | { | 161 | { | ||
154 | // Remove the local file (if it exists) | 162 | // Remove the local file (if it exists) | ||
155 | QFile f(m_localPath + fileName); | 163 | QFile f(m_localPath + fileName); | ||
156 | f.remove(); | 164 | f.remove(); | ||
157 | 165 | | |||
158 | // Mark module as deleted (so that we skip global file, if there's one) | 166 | // Mark module as deleted (so that we skip global file, if there's one) | ||
159 | QStringList deletedModules = m_config->readEntry("DeletedModules", QStringList()); | 167 | QStringList deletedModules = m_config->readEntry("DeletedModules", QStringList()); | ||
▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines |