Skip to content

Commit

Permalink
Move check for mono icons into separate function
Browse files Browse the repository at this point in the history
  • Loading branch information
tsparber authored and guruz committed Apr 26, 2017
1 parent 4202387 commit 72a3e08
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/gui/generalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ GeneralSettings::GeneralSettings(QWidget *parent) :

// OEM themes are not obliged to ship mono icons, so there
// is no point in offering an option
QString themeDir = QString::fromLatin1(":/client/theme/%1/")
.arg(Theme::instance()->systrayIconFlavor(true));
_ui->monoIconsCheckBox->setVisible(QDir(themeDir).exists());
_ui->monoIconsCheckBox->setVisible(Theme::instance()->monoIconsAvailable());

connect(_ui->ignoredFilesButton, SIGNAL(clicked()), SLOT(slotIgnoreFilesEditor()));

Expand Down
6 changes: 6 additions & 0 deletions src/libsync/theme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,12 @@ bool Theme::systrayUseMonoIcons() const
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
{
return QLatin1String("https://updates.owncloud.com/client/");
Expand Down
5 changes: 5 additions & 0 deletions src/libsync/theme.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ class OWNCLOUDSYNC_EXPORT Theme : public QObject
*/
bool systrayUseMonoIcons() const;

/**
* Check if mono icons are available
*/
bool monoIconsAvailable() const;

/**
* @brief Where to check for new Updates.
*/
Expand Down

0 comments on commit 72a3e08

Please sign in to comment.