Changeset View
Changeset View
Standalone View
Standalone View
src/themeconfig.cpp
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | 42 | { | |||
---|---|---|---|---|---|
65 | prepareInitialTheme(); | 65 | prepareInitialTheme(); | ||
66 | } | 66 | } | ||
67 | 67 | | |||
68 | ThemeConfig::~ThemeConfig() | 68 | ThemeConfig::~ThemeConfig() | ||
69 | { | 69 | { | ||
70 | delete configUi; | 70 | delete configUi; | ||
71 | } | 71 | } | ||
72 | 72 | | |||
73 | QVariantMap ThemeConfig::save() | 73 | void ThemeConfig::save(QVariantMap &args) | ||
74 | { | 74 | { | ||
75 | QModelIndex index = configUi->themesListView->currentIndex(); | 75 | QModelIndex index = configUi->themesListView->currentIndex(); | ||
76 | if (!index.isValid()) { | 76 | if (!index.isValid()) { | ||
77 | return QVariantMap(); | 77 | return; | ||
78 | } | 78 | } | ||
79 | 79 | | |||
80 | QVariantMap args; | | |||
81 | | ||||
82 | args[QStringLiteral("kde_settings.conf/Theme/Current")] = index.data(ThemesModel::IdRole); | 80 | args[QStringLiteral("kde_settings.conf/Theme/Current")] = index.data(ThemesModel::IdRole); | ||
83 | 81 | | |||
84 | if (!mThemeConfigPath.isEmpty()) { | 82 | if (!mThemeConfigPath.isEmpty()) { | ||
85 | if (!mBackgroundPath.isEmpty()) { | 83 | if (!mBackgroundPath.isEmpty()) { | ||
86 | args[QStringLiteral("theme.conf.user/General/background")] = mBackgroundPath; | 84 | args[QStringLiteral("theme.conf.user/General/background")] = mBackgroundPath; | ||
87 | args[QStringLiteral("theme.conf.user/General/type")] = QStringLiteral("image"); | 85 | args[QStringLiteral("theme.conf.user/General/type")] = QStringLiteral("image"); | ||
88 | } else { | 86 | } else { | ||
89 | args[QStringLiteral("theme.conf.user/General/type")] = QStringLiteral("color"); | 87 | args[QStringLiteral("theme.conf.user/General/type")] = QStringLiteral("color"); | ||
90 | } | 88 | } | ||
91 | } | 89 | } | ||
92 | return args; | | |||
93 | } | 90 | } | ||
94 | 91 | | |||
95 | QString ThemeConfig::themeConfigPath() const | 92 | QString ThemeConfig::themeConfigPath() const | ||
96 | { | 93 | { | ||
97 | return mThemeConfigPath; | 94 | return mThemeConfigPath; | ||
98 | } | 95 | } | ||
99 | 96 | | |||
100 | void ThemeConfig::prepareInitialTheme() | 97 | void ThemeConfig::prepareInitialTheme() | ||
▲ Show 20 Lines • Show All 140 Lines • Show Last 20 Lines |