Changeset View
Changeset View
Standalone View
Standalone View
menuinfo.cpp
Show First 20 Lines • Show All 175 Lines • ▼ Show 20 Line(s) | |||||
176 | 176 | | |||
177 | void MenuFolderInfo::save(MenuFile *menuFile) | 177 | void MenuFolderInfo::save(MenuFile *menuFile) | ||
178 | { | 178 | { | ||
179 | if (s_deletedApps) { | 179 | if (s_deletedApps) { | ||
180 | // Remove hotkeys for applications that have been deleted | 180 | // Remove hotkeys for applications that have been deleted | ||
181 | for (QStringList::ConstIterator it = s_deletedApps->constBegin(); | 181 | for (QStringList::ConstIterator it = s_deletedApps->constBegin(); | ||
182 | it != s_deletedApps->constEnd(); ++it) { | 182 | it != s_deletedApps->constEnd(); ++it) { | ||
183 | // The shorcut is deleted if we set a empty sequence | 183 | // The shorcut is deleted if we set a empty sequence | ||
184 | GlobalAccel::changeMenuEntryShortcut(*it, QKeySequence()); | 184 | GlobalAccel::changeMenuEntryShortcut(KService::serviceByStorageId(*it), QKeySequence()); | ||
185 | } | 185 | } | ||
186 | delete s_deletedApps; | 186 | delete s_deletedApps; | ||
187 | s_deletedApps = nullptr; | 187 | s_deletedApps = nullptr; | ||
188 | } | 188 | } | ||
189 | 189 | | |||
190 | if (dirty) { | 190 | if (dirty) { | ||
191 | QString local = KDesktopFile::locateLocal(directoryFile); | 191 | QString local = KDesktopFile::locateLocal(directoryFile); | ||
192 | 192 | | |||
▲ Show 20 Lines • Show All 126 Lines • ▼ Show 20 Line(s) | |||||
319 | 319 | | |||
320 | void MenuEntryInfo::save() | 320 | void MenuEntryInfo::save() | ||
321 | { | 321 | { | ||
322 | if (dirty) { | 322 | if (dirty) { | ||
323 | m_desktopFile->sync(); | 323 | m_desktopFile->sync(); | ||
324 | dirty = false; | 324 | dirty = false; | ||
325 | } | 325 | } | ||
326 | if (shortcutDirty) { | 326 | if (shortcutDirty) { | ||
327 | GlobalAccel::changeMenuEntryShortcut(service->storageId(), shortCut); | 327 | GlobalAccel::changeMenuEntryShortcut(service, shortCut); | ||
328 | shortcutDirty = false; | 328 | shortcutDirty = false; | ||
329 | } | 329 | } | ||
330 | } | 330 | } | ||
331 | 331 | | |||
332 | void MenuEntryInfo::setCaption(const QString &_caption) | 332 | void MenuEntryInfo::setCaption(const QString &_caption) | ||
333 | { | 333 | { | ||
334 | if (caption == _caption) { | 334 | if (caption == _caption) { | ||
335 | return; | 335 | return; | ||
Show All 23 Lines | 353 | { | |||
359 | setDirty(); | 359 | setDirty(); | ||
360 | desktopFile()->desktopGroup().writeEntry("Icon", icon); | 360 | desktopFile()->desktopGroup().writeEntry("Icon", icon); | ||
361 | } | 361 | } | ||
362 | 362 | | |||
363 | QKeySequence MenuEntryInfo::shortcut() | 363 | QKeySequence MenuEntryInfo::shortcut() | ||
364 | { | 364 | { | ||
365 | if (!shortcutLoaded) { | 365 | if (!shortcutLoaded) { | ||
366 | shortcutLoaded = true; | 366 | shortcutLoaded = true; | ||
367 | shortCut = GlobalAccel::getMenuEntryShortcut(service->storageId()); | 367 | shortCut = GlobalAccel::getMenuEntryShortcut(service); | ||
368 | } | 368 | } | ||
369 | return shortCut; | 369 | return shortCut; | ||
370 | } | 370 | } | ||
371 | 371 | | |||
372 | static void freeShortcut(const QKeySequence &shortCut) | 372 | static void freeShortcut(const QKeySequence &shortCut) | ||
373 | { | 373 | { | ||
374 | if (!shortCut.isEmpty()) { | 374 | if (!shortCut.isEmpty()) { | ||
375 | QString shortcutKey = shortCut.toString(); | 375 | QString shortcutKey = shortCut.toString(); | ||
▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines |