Skip to content

Commit

Permalink
Merge branch 'master' into feature/syncWithCaseClashNames
Browse files Browse the repository at this point in the history
  • Loading branch information
mgallien authored Jan 25, 2023
2 parents 7cebb6a + 5c42da4 commit 94605d2
Show file tree
Hide file tree
Showing 63 changed files with 7,276 additions and 5,978 deletions.
8 changes: 0 additions & 8 deletions src/gui/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,6 @@ Application::Application(int &argc, char **argv)

setQuitOnLastWindowClosed(false);

_theme->setSystrayUseMonoIcons(cfg.monoIcons());
connect(_theme, &Theme::systrayUseMonoIconsChanged, this, &Application::slotUseMonoIconsChanged);

// Setting up the gui class will allow tray notifications for the
// setup that follows, like folder setup
_gui = new ownCloudGui(this);
Expand Down Expand Up @@ -571,11 +568,6 @@ void Application::setupLogging()
qCInfo(lcApplication) << "Arguments:" << qApp->arguments();
}

void Application::slotUseMonoIconsChanged(bool)
{
_gui->slotComputeOverallSyncStatus();
}

void Application::slotParseMessage(const QString &msg, QObject *)
{
if (msg.startsWith(QLatin1String("MSG_PARSEOPTIONS:"))) {
Expand Down
1 change: 0 additions & 1 deletion src/gui/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ public slots:
protected slots:
void slotParseMessage(const QString &, QObject *);
void slotCheckConnection();
void slotUseMonoIconsChanged(bool);
void slotCleanup();
void slotAccountStateAdded(OCC::AccountState *accountState);
void slotAccountStateRemoved(OCC::AccountState *accountState);
Expand Down
10 changes: 0 additions & 10 deletions src/gui/generalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ GeneralSettings::GeneralSettings(QWidget *parent)
//slotUpdateInfo();

// misc
connect(_ui->monoIconsCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings);
connect(_ui->crashreporterCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings);
connect(_ui->newFolderLimitCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings);
connect(_ui->newFolderLimitSpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &GeneralSettings::saveMiscSettings);
Expand Down Expand Up @@ -216,10 +215,6 @@ GeneralSettings::GeneralSettings(QWidget *parent)
_ui->horizontalLayout_3->getContentsMargins(&m0, &m1, &m2, &m3);
_ui->horizontalLayout_3->setContentsMargins(0, m1, m2, m3);

// OEM themes are not obliged to ship mono icons, so there
// is no point in offering an option
_ui->monoIconsCheckBox->setVisible(Theme::instance()->monoIconsAvailable());

connect(_ui->ignoredFilesButton, &QAbstractButton::clicked, this, &GeneralSettings::slotIgnoreFilesEditor);
connect(_ui->debugArchiveButton, &QAbstractButton::clicked, this, &GeneralSettings::slotCreateDebugArchive);

Expand All @@ -246,7 +241,6 @@ void GeneralSettings::loadMiscSettings()
{
QScopedValueRollback<bool> scope(_currentlyLoading, true);
ConfigFile cfgFile;
_ui->monoIconsCheckBox->setChecked(cfgFile.monoIcons());
_ui->serverNotificationsCheckBox->setChecked(cfgFile.optionalServerNotifications());
_ui->callNotificationsCheckBox->setEnabled(_ui->serverNotificationsCheckBox->isEnabled());
_ui->callNotificationsCheckBox->setChecked(cfgFile.showCallNotifications());
Expand All @@ -256,7 +250,6 @@ void GeneralSettings::loadMiscSettings()
_ui->newFolderLimitCheckBox->setChecked(newFolderLimit.first);
_ui->newFolderLimitSpinBox->setValue(newFolderLimit.second);
_ui->newExternalStorage->setChecked(cfgFile.confirmExternalStorage());
_ui->monoIconsCheckBox->setChecked(cfgFile.monoIcons());
}

#if defined(BUILD_UPDATER)
Expand Down Expand Up @@ -420,9 +413,6 @@ void GeneralSettings::saveMiscSettings()
if (_currentlyLoading)
return;
ConfigFile cfgFile;
bool isChecked = _ui->monoIconsCheckBox->isChecked();
cfgFile.setMonoIcons(isChecked);
Theme::instance()->setSystrayUseMonoIcons(isChecked);
cfgFile.setCrashReporter(_ui->crashreporterCheckBox->isChecked());

cfgFile.setNewBigFolderSizeLimit(_ui->newFolderLimitCheckBox->isChecked(),
Expand Down
13 changes: 1 addition & 12 deletions src/gui/generalsettings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>556</width>
<height>563</height>
<height>573</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -66,16 +66,6 @@
<string>General Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0">
<widget class="QCheckBox" name="monoIconsCheckBox">
<property name="toolTip">
<string>For System Tray</string>
</property>
<property name="text">
<string>Use &amp;Monochrome Icons</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="autostartCheckBox">
<property name="text">
Expand Down Expand Up @@ -343,7 +333,6 @@
<tabstops>
<tabstop>autostartCheckBox</tabstop>
<tabstop>serverNotificationsCheckBox</tabstop>
<tabstop>monoIconsCheckBox</tabstop>
<tabstop>ignoredFilesButton</tabstop>
<tabstop>newFolderLimitCheckBox</tabstop>
<tabstop>newFolderLimitSpinBox</tabstop>
Expand Down
18 changes: 0 additions & 18 deletions src/libsync/configfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ static constexpr char remotePollIntervalC[] = "remotePollInterval";
static constexpr char forceSyncIntervalC[] = "forceSyncInterval";
static constexpr char fullLocalDiscoveryIntervalC[] = "fullLocalDiscoveryInterval";
static constexpr char notificationRefreshIntervalC[] = "notificationRefreshInterval";
static constexpr char monoIconsC[] = "monoIcons";
static constexpr char promptDeleteC[] = "promptDeleteAllFiles";
static constexpr char crashReporterC[] = "crashReporter";
static constexpr char optionalServerNotificationsC[] = "optionalServerNotifications";
Expand Down Expand Up @@ -947,23 +946,6 @@ void ConfigFile::setPromptDeleteFiles(bool promptDeleteFiles)
settings.setValue(QLatin1String(promptDeleteC), promptDeleteFiles);
}

bool ConfigFile::monoIcons() const
{
QSettings settings(configFile(), QSettings::IniFormat);
bool monoDefault = false; // On Mac we want bw by default
#ifdef Q_OS_MAC
// OEM themes are not obliged to ship mono icons
monoDefault = QByteArrayLiteral("Nextcloud") == QByteArrayLiteral(APPLICATION_NAME);
#endif
return settings.value(QLatin1String(monoIconsC), monoDefault).toBool();
}

void ConfigFile::setMonoIcons(bool useMonoIcons)
{
QSettings settings(configFile(), QSettings::IniFormat);
settings.setValue(QLatin1String(monoIconsC), useMonoIcons);
}

bool ConfigFile::crashReporter() const
{
QSettings settings(configFile(), QSettings::IniFormat);
Expand Down
3 changes: 0 additions & 3 deletions src/libsync/configfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ class OWNCLOUDSYNC_EXPORT ConfigFile
*/
[[nodiscard]] std::chrono::milliseconds fullLocalDiscoveryInterval() const;

[[nodiscard]] bool monoIcons() const;
void setMonoIcons(bool);

[[nodiscard]] bool promptDeleteFiles() const;
void setPromptDeleteFiles(bool promptDeleteFiles);

Expand Down
17 changes: 0 additions & 17 deletions src/libsync/theme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,23 +480,6 @@ QString Theme::systrayIconFlavor(bool mono) const
return flavor;
}

void Theme::setSystrayUseMonoIcons(bool mono)
{
_mono = mono;
emit systrayUseMonoIconsChanged(mono);
}

bool Theme::systrayUseMonoIcons() const
{
return _mono;
}

bool Theme::monoIconsAvailable() const
{
QString themeDir = QString(Theme::themePrefix) + QString::fromLatin1("%1/").arg(Theme::instance()->systrayIconFlavor(true));
return QDir(themeDir).exists();
}

QString Theme::updateCheckUrl() const
{
return APPLICATION_UPDATE_URL;
Expand Down
16 changes: 0 additions & 16 deletions src/libsync/theme.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,21 +340,6 @@ class OWNCLOUDSYNC_EXPORT Theme : public QObject
*/
virtual QString aboutDetails() const;

/**
* Define if the systray icons should be using mono design
*/
void setSystrayUseMonoIcons(bool mono);

/**
* Retrieve wether to use mono icons for systray
*/
bool systrayUseMonoIcons() const;

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

/**
* @brief Where to check for new Updates.
*/
Expand Down Expand Up @@ -612,7 +597,6 @@ public slots:
Theme();

signals:
void systrayUseMonoIconsChanged(bool);
void systemPaletteChanged(const QPalette &palette);
void darkModeChanged();
void overrideServerUrlChanged();
Expand Down
Loading

0 comments on commit 94605d2

Please sign in to comment.