Move check for mono icons into separate function

This commit is contained in:
Tommy Sparber 2016-10-10 12:38:05 +02:00 committed by Markus Goetz
parent 4202387c52
commit 72a3e08907
3 changed files with 12 additions and 3 deletions

View file

@ -83,9 +83,7 @@ GeneralSettings::GeneralSettings(QWidget *parent) :
// OEM themes are not obliged to ship mono icons, so there // OEM themes are not obliged to ship mono icons, so there
// is no point in offering an option // is no point in offering an option
QString themeDir = QString::fromLatin1(":/client/theme/%1/") _ui->monoIconsCheckBox->setVisible(Theme::instance()->monoIconsAvailable());
.arg(Theme::instance()->systrayIconFlavor(true));
_ui->monoIconsCheckBox->setVisible(QDir(themeDir).exists());
connect(_ui->ignoredFilesButton, SIGNAL(clicked()), SLOT(slotIgnoreFilesEditor())); connect(_ui->ignoredFilesButton, SIGNAL(clicked()), SLOT(slotIgnoreFilesEditor()));

View file

@ -265,6 +265,12 @@ bool Theme::systrayUseMonoIcons() const
return _mono; return _mono;
} }
bool Theme::monoIconsAvailable() const
{
QString themeDir = QString::fromLatin1(":/client/theme/%1/").arg(Theme::instance()->systrayIconFlavor(true));
return QDir(themeDir).exists();
}
QString Theme::updateCheckUrl() const QString Theme::updateCheckUrl() const
{ {
return QLatin1String("https://updates.owncloud.com/client/"); return QLatin1String("https://updates.owncloud.com/client/");

View file

@ -201,6 +201,11 @@ public:
*/ */
bool systrayUseMonoIcons() const; bool systrayUseMonoIcons() const;
/**
* Check if mono icons are available
*/
bool monoIconsAvailable() const;
/** /**
* @brief Where to check for new Updates. * @brief Where to check for new Updates.
*/ */