Move feature macro declaration to build scripts

PR #18825.
This commit is contained in:
Chocobo1 2023-04-10 13:38:00 +08:00 committed by GitHub
parent 4a66d705b8
commit 5dcc14153f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 34 additions and 31 deletions

View file

@ -40,6 +40,7 @@
#include "base/preferences.h"
#include "base/unicodestrings.h"
#include "gui/addnewtorrentdialog.h"
#include "gui/desktopintegration.h"
#include "gui/mainwindow.h"
#include "interfaces/iguiapplication.h"
@ -82,7 +83,7 @@ namespace
RESOLVE_COUNTRIES,
PROGRAM_NOTIFICATIONS,
TORRENT_ADDED_NOTIFICATIONS,
#ifdef QBT_USES_CUSTOMDBUSNOTIFICATIONS
#ifdef QBT_USES_DBUS
NOTIFICATION_TIMEOUT,
#endif
CONFIRM_REMOVE_ALL_TAGS,
@ -282,7 +283,7 @@ void AdvancedSettings::saveAdvancedSettings() const
session->setStopTrackerTimeout(m_spinBoxStopTrackerTimeout.value());
// Program notification
app()->desktopIntegration()->setNotificationsEnabled(m_checkBoxProgramNotifications.isChecked());
#ifdef QBT_USES_CUSTOMDBUSNOTIFICATIONS
#ifdef QBT_USES_DBUS
app()->desktopIntegration()->setNotificationTimeout(m_spinBoxNotificationTimeout.value());
#endif
app()->setTorrentAddedNotificationsEnabled(m_checkBoxTorrentAddedNotifications.isChecked());
@ -332,7 +333,7 @@ void AdvancedSettings::updateCacheSpinSuffix(const int value)
}
#endif
#ifdef QBT_USES_CUSTOMDBUSNOTIFICATIONS
#ifdef QBT_USES_DBUS
void AdvancedSettings::updateNotificationTimeoutSuffix(const int value)
{
if (value == 0)
@ -728,7 +729,7 @@ void AdvancedSettings::loadAdvancedSettings()
// Torrent added notifications
m_checkBoxTorrentAddedNotifications.setChecked(app()->isTorrentAddedNotificationsEnabled());
addRow(TORRENT_ADDED_NOTIFICATIONS, tr("Display notifications for added torrents"), &m_checkBoxTorrentAddedNotifications);
#ifdef QBT_USES_CUSTOMDBUSNOTIFICATIONS
#ifdef QBT_USES_DBUS
// Notification timeout
m_spinBoxNotificationTimeout.setMinimum(-1);
m_spinBoxNotificationTimeout.setMaximum(std::numeric_limits<int>::max());