Changeset View
Changeset View
Standalone View
Standalone View
gemini/Theme.cpp
Show First 20 Lines • Show All 317 Lines • ▼ Show 20 Line(s) | 317 | } else { | |||
---|---|---|---|---|---|
318 | qWarning() << "Unable to find icon" << url; | 318 | qWarning() << "Unable to find icon" << url; | ||
319 | } | 319 | } | ||
320 | } | 320 | } | ||
321 | } | 321 | } | ||
322 | 322 | | |||
323 | return QUrl::fromLocalFile(url); | 323 | return QUrl::fromLocalFile(url); | ||
324 | } | 324 | } | ||
325 | 325 | | |||
326 | QIcon Theme::iconActual(const QString& name) | ||||
327 | { | ||||
328 | return QIcon(icon(name).toLocalFile()); | ||||
329 | } | ||||
330 | | ||||
326 | QString Theme::imagePath() const | 331 | QString Theme::imagePath() const | ||
327 | { | 332 | { | ||
328 | return d->imagePath; | 333 | return d->imagePath; | ||
329 | } | 334 | } | ||
330 | 335 | | |||
331 | void Theme::setImagePath(const QString& newValue) | 336 | void Theme::setImagePath(const QString& newValue) | ||
332 | { | 337 | { | ||
333 | if(newValue != d->imagePath) { | 338 | if(newValue != d->imagePath) { | ||
Show All 29 Lines | 363 | #ifdef Q_OS_WIN | |||
363 | QString absolute = appdir.absolutePath(); | 368 | QString absolute = appdir.absolutePath(); | ||
364 | DWORD rv = ::GetShortPathName((wchar_t*)absolute.utf16(), buffer, 1024); | 369 | DWORD rv = ::GetShortPathName((wchar_t*)absolute.utf16(), buffer, 1024); | ||
365 | rv = ::GetLongPathName(buffer, buffer, 1024); | 370 | rv = ::GetLongPathName(buffer, buffer, 1024); | ||
366 | QString correctedPath((QChar *)buffer); | 371 | QString correctedPath((QChar *)buffer); | ||
367 | appdir.setPath(correctedPath); | 372 | appdir.setPath(correctedPath); | ||
368 | 373 | | |||
369 | // for now, the app in bin/ and we still use the env.bat script | 374 | // for now, the app in bin/ and we still use the env.bat script | ||
370 | appdir.cdUp(); | 375 | appdir.cdUp(); | ||
371 | qml = QString("%1/share/apps/calligragemini/themes/%2/theme.qml").arg(appdir.canonicalPath(), id); | 376 | qml = QString("%1/bin/data/calligragemini/themes/%2/theme.qml").arg(appdir.canonicalPath(), id); | ||
372 | #else | 377 | #else | ||
373 | const QString qmlFileSubPath = QStringLiteral("calligragemini/themes/") + id + QStringLiteral("/theme.qml"); | 378 | const QString qmlFileSubPath = QStringLiteral("calligragemini/themes/") + id + QStringLiteral("/theme.qml"); | ||
374 | qml = QStandardPaths::locate(QStandardPaths::GenericDataLocation, qmlFileSubPath); | 379 | qml = QStandardPaths::locate(QStandardPaths::GenericDataLocation, qmlFileSubPath); | ||
375 | #endif | 380 | #endif | ||
376 | 381 | | |||
377 | QQmlComponent themeComponent(QmlGlobalEngine::instance()->engine(), parent); | 382 | QQmlComponent themeComponent(QmlGlobalEngine::instance()->engine(), parent); | ||
378 | themeComponent.loadUrl(QUrl::fromLocalFile(qml)); | 383 | themeComponent.loadUrl(QUrl::fromLocalFile(qml)); | ||
379 | 384 | | |||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |