Changeset View
Changeset View
Standalone View
Standalone View
src/kshortcutschemeseditor.cpp
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | |||||
45 | { | 45 | { | ||
46 | KConfigGroup group(KSharedConfig::openConfig(), "Shortcut Schemes"); | 46 | KConfigGroup group(KSharedConfig::openConfig(), "Shortcut Schemes"); | ||
47 | 47 | | |||
48 | QStringList schemes; | 48 | QStringList schemes; | ||
49 | schemes << QStringLiteral("Default"); | 49 | schemes << QStringLiteral("Default"); | ||
50 | // List files in the shortcuts subdir, each one is a scheme. See KShortcutSchemesHelper::{shortcutSchemeFileName,exportActionCollection} | 50 | // List files in the shortcuts subdir, each one is a scheme. See KShortcutSchemesHelper::{shortcutSchemeFileName,exportActionCollection} | ||
51 | const QStringList shortcutsDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QCoreApplication::applicationName() + QLatin1String("/shortcuts"), QStandardPaths::LocateDirectory); | 51 | const QStringList shortcutsDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QCoreApplication::applicationName() + QLatin1String("/shortcuts"), QStandardPaths::LocateDirectory); | ||
52 | qCDebug(DEBUG_KXMLGUI) << "shortcut scheme dirs:" << shortcutsDirs; | 52 | qCDebug(DEBUG_KXMLGUI) << "shortcut scheme dirs:" << shortcutsDirs; | ||
53 | Q_FOREACH (const QString &dir, shortcutsDirs) { | 53 | for (const QString &dir : shortcutsDirs) { | ||
54 | Q_FOREACH (const QString &file, QDir(dir).entryList(QDir::Files | QDir::NoDotAndDotDot)) { | 54 | Q_FOREACH (const QString &file, QDir(dir).entryList(QDir::Files | QDir::NoDotAndDotDot)) { | ||
55 | qCDebug(DEBUG_KXMLGUI) << "shortcut scheme file:" << file; | 55 | qCDebug(DEBUG_KXMLGUI) << "shortcut scheme file:" << file; | ||
56 | schemes << file; | 56 | schemes << file; | ||
57 | } | 57 | } | ||
58 | } | 58 | } | ||
59 | 59 | | |||
60 | const QString currentScheme = group.readEntry("Current Scheme", "Default"); | 60 | const QString currentScheme = group.readEntry("Current Scheme", "Default"); | ||
61 | qCDebug(DEBUG_KXMLGUI) << "Current Scheme" << currentScheme; | 61 | qCDebug(DEBUG_KXMLGUI) << "Current Scheme" << currentScheme; | ||
▲ Show 20 Lines • Show All 149 Lines • Show Last 20 Lines |