Changeset View
Changeset View
Standalone View
Standalone View
Modules/about-distro/src/Module.cpp
Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Line(s) | |||||
143 | void Module::loadSoftware() | 143 | void Module::loadSoftware() | ||
144 | { | 144 | { | ||
145 | // NOTE: do not include globals, otherwise kdeglobals could provide values | 145 | // NOTE: do not include globals, otherwise kdeglobals could provide values | ||
146 | // even though we only explicitly want them from our own config. | 146 | // even though we only explicitly want them from our own config. | ||
147 | KSharedConfig::Ptr config = KSharedConfig::openConfig(QStringLiteral("kcm-about-distrorc"), | 147 | KSharedConfig::Ptr config = KSharedConfig::openConfig(QStringLiteral("kcm-about-distrorc"), | ||
148 | KConfig::NoGlobals); | 148 | KConfig::NoGlobals); | ||
149 | KConfigGroup cg = KConfigGroup(config, "General"); | 149 | KConfigGroup cg = KConfigGroup(config, "General"); | ||
150 | 150 | | |||
151 | const QString logoPath = cg.readEntry("LogoPath", QStringLiteral("start-here-kde")); | 151 | OSRelease os; | ||
152 | | ||||
153 | QString logoPath = cg.readEntry("LogoPath", os.logo); | ||||
apol: Put os.logo as the fallback? | |||||
sitter: hm, yeah, I do wonder why I wrote it the way I did. | |||||
154 | if (logoPath.isEmpty()) { | ||||
155 | logoPath = QStringLiteral("start-here-kde"); | ||||
156 | } | ||||
152 | const QPixmap logo = QIcon::fromTheme(logoPath).pixmap(128, 128); | 157 | const QPixmap logo = QIcon::fromTheme(logoPath).pixmap(128, 128); | ||
153 | ui->logoLabel->setPixmap(logo); | 158 | ui->logoLabel->setPixmap(logo); | ||
154 | 159 | | |||
155 | OSRelease os; | | |||
156 | // We allow overriding of the OS name for branding purposes. | 160 | // We allow overriding of the OS name for branding purposes. | ||
157 | // For example OS Ubuntu may be rebranded as Kubuntu. Also Kubuntu Active | 161 | // For example OS Ubuntu may be rebranded as Kubuntu. Also Kubuntu Active | ||
158 | // as a product brand is different from Kubuntu. | 162 | // as a product brand is different from Kubuntu. | ||
159 | const QString distroName = cg.readEntry("Name", os.name); | 163 | const QString distroName = cg.readEntry("Name", os.name); | ||
160 | const QString versionId = cg.readEntry("Version", os.versionId); | 164 | const QString versionId = cg.readEntry("Version", os.versionId); | ||
161 | const QString distroNameVersion = QStringLiteral("%1 %2").arg(distroName, versionId); | 165 | const QString distroNameVersion = QStringLiteral("%1 %2").arg(distroName, versionId); | ||
162 | ui->nameVersionLabel->setText(distroNameVersion); | 166 | ui->nameVersionLabel->setText(distroNameVersion); | ||
163 | 167 | | |||
▲ Show 20 Lines • Show All 145 Lines • Show Last 20 Lines |
Put os.logo as the fallback?