Use cmakedefine01

This way we get a build time warning if the var isn't defined at all, e.g.
a missing check_include_files() CMake call.
This commit is contained in:
Ahmad Samir 2022-06-11 19:16:13 +02:00
parent 8a0003bfbc
commit 28a74d1780
18 changed files with 64 additions and 64 deletions

View file

@ -1,5 +1,5 @@
#cmakedefine HAVE_BALOO #cmakedefine01 HAVE_BALOO
#cmakedefine HAVE_KACTIVITIES #cmakedefine01 HAVE_KACTIVITIES
#cmakedefine HAVE_KUSERFEEDBACK #cmakedefine01 HAVE_KUSERFEEDBACK
#cmakedefine HAVE_PACKAGEKIT #cmakedefine01 HAVE_PACKAGEKIT
#cmakedefine HAVE_TERMINAL #cmakedefine01 HAVE_TERMINAL

View file

@ -267,7 +267,7 @@ bool DolphinMainWindow::isFoldersPanelEnabled() const
bool DolphinMainWindow::isInformationPanelEnabled() const bool DolphinMainWindow::isInformationPanelEnabled() const
{ {
#ifdef HAVE_BALOO #if HAVE_BALOO
return actionCollection()->action(QStringLiteral("show_information_panel"))->isChecked(); return actionCollection()->action(QStringLiteral("show_information_panel"))->isChecked();
#else #else
return false; return false;
@ -1770,7 +1770,7 @@ void DolphinMainWindow::setupActions()
actionCollection()->setDefaultShortcut(openTerminalHere, Qt::SHIFT | Qt::ALT | Qt::Key_F4); actionCollection()->setDefaultShortcut(openTerminalHere, Qt::SHIFT | Qt::ALT | Qt::Key_F4);
connect(openTerminalHere, &QAction::triggered, this, &DolphinMainWindow::openTerminalHere); connect(openTerminalHere, &QAction::triggered, this, &DolphinMainWindow::openTerminalHere);
#ifdef HAVE_TERMINAL #if HAVE_TERMINAL
QAction* focusTerminalPanel = actionCollection()->addAction(QStringLiteral("focus_terminal_panel")); QAction* focusTerminalPanel = actionCollection()->addAction(QStringLiteral("focus_terminal_panel"));
focusTerminalPanel->setText(i18nc("@action:inmenu Tools", "Focus Terminal Panel")); focusTerminalPanel->setText(i18nc("@action:inmenu Tools", "Focus Terminal Panel"));
focusTerminalPanel->setIcon(QIcon::fromTheme(QStringLiteral("swap-panels"))); focusTerminalPanel->setIcon(QIcon::fromTheme(QStringLiteral("swap-panels")));
@ -1897,7 +1897,7 @@ void DolphinMainWindow::setupDockWidgets()
infoDock->setObjectName(QStringLiteral("infoDock")); infoDock->setObjectName(QStringLiteral("infoDock"));
infoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); infoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
#ifdef HAVE_BALOO #if HAVE_BALOO
InformationPanel* infoPanel = new InformationPanel(infoDock); InformationPanel* infoPanel = new InformationPanel(infoDock);
infoPanel->setCustomContextMenuActions({lockLayoutAction}); infoPanel->setCustomContextMenuActions({lockLayoutAction});
connect(infoPanel, &InformationPanel::urlActivated, this, &DolphinMainWindow::handleUrl); connect(infoPanel, &InformationPanel::urlActivated, this, &DolphinMainWindow::handleUrl);
@ -1921,7 +1921,7 @@ void DolphinMainWindow::setupDockWidgets()
const QString panelWhatsThis = xi18nc("@info:whatsthis", "<para>To show or " const QString panelWhatsThis = xi18nc("@info:whatsthis", "<para>To show or "
"hide panels like this go to <interface>Control|Panels</interface> " "hide panels like this go to <interface>Control|Panels</interface> "
"or <interface>View|Panels</interface>.</para>"); "or <interface>View|Panels</interface>.</para>");
#ifdef HAVE_BALOO #if HAVE_BALOO
actionCollection()->action(QStringLiteral("show_information_panel")) actionCollection()->action(QStringLiteral("show_information_panel"))
->setWhatsThis(xi18nc("@info:whatsthis", "<para> This toggles the " ->setWhatsThis(xi18nc("@info:whatsthis", "<para> This toggles the "
"<emphasis>information</emphasis> panel at the right side of the " "<emphasis>information</emphasis> panel at the right side of the "
@ -1973,7 +1973,7 @@ void DolphinMainWindow::setupDockWidgets()
"This allows quick switching between any folders.</para>") + panelWhatsThis); "This allows quick switching between any folders.</para>") + panelWhatsThis);
// Setup "Terminal" // Setup "Terminal"
#ifdef HAVE_TERMINAL #if HAVE_TERMINAL
if (KAuthorized::authorize(QStringLiteral("shell_access"))) { if (KAuthorized::authorize(QStringLiteral("shell_access"))) {
DolphinDockWidget* terminalDock = new DolphinDockWidget(i18nc("@title:window Shell terminal", "Terminal")); DolphinDockWidget* terminalDock = new DolphinDockWidget(i18nc("@title:window Shell terminal", "Terminal"));
terminalDock->setLocked(lock); terminalDock->setLocked(lock);
@ -2098,7 +2098,7 @@ void DolphinMainWindow::setupDockWidgets()
panelsMenu->setPopupMode(QToolButton::InstantPopup); panelsMenu->setPopupMode(QToolButton::InstantPopup);
const KActionCollection* ac = actionCollection(); const KActionCollection* ac = actionCollection();
panelsMenu->addAction(ac->action(QStringLiteral("show_places_panel"))); panelsMenu->addAction(ac->action(QStringLiteral("show_places_panel")));
#ifdef HAVE_BALOO #if HAVE_BALOO
panelsMenu->addAction(ac->action(QStringLiteral("show_information_panel"))); panelsMenu->addAction(ac->action(QStringLiteral("show_information_panel")));
#endif #endif
panelsMenu->addAction(ac->action(QStringLiteral("show_folders_panel"))); panelsMenu->addAction(ac->action(QStringLiteral("show_folders_panel")));

View file

@ -15,7 +15,7 @@
#include <kio/fileundomanager.h> #include <kio/fileundomanager.h>
#include <kxmlguiwindow.h> #include <kxmlguiwindow.h>
#ifdef HAVE_BALOO #if HAVE_BALOO
#include "panels/information/informationpanel.h" #include "panels/information/informationpanel.h"
#endif #endif

View file

@ -17,7 +17,7 @@
#include "views/viewproperties.h" #include "views/viewproperties.h"
#include "dolphin_detailsmodesettings.h" #include "dolphin_detailsmodesettings.h"
#ifdef HAVE_KACTIVITIES #if HAVE_KACTIVITIES
#include <KActivities/ResourceInstance> #include <KActivities/ResourceInstance>
#endif #endif
#include <KFileItemActions> #include <KFileItemActions>
@ -54,7 +54,7 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
m_statusBarTimer(nullptr), m_statusBarTimer(nullptr),
m_statusBarTimestamp(), m_statusBarTimestamp(),
m_autoGrabFocus(true) m_autoGrabFocus(true)
#ifdef HAVE_KACTIVITIES #if HAVE_KACTIVITIES
, m_activityResourceInstance(nullptr) , m_activityResourceInstance(nullptr)
#endif #endif
{ {
@ -214,7 +214,7 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
// Initialize kactivities resource instance // Initialize kactivities resource instance
#ifdef HAVE_KACTIVITIES #if HAVE_KACTIVITIES
m_activityResourceInstance = new KActivities::ResourceInstance(window()->winId(), url); m_activityResourceInstance = new KActivities::ResourceInstance(window()->winId(), url);
m_activityResourceInstance->setParent(this); m_activityResourceInstance->setParent(this);
#endif #endif
@ -237,7 +237,7 @@ void DolphinViewContainer::setActive(bool active)
} }
m_view->setActive(active); m_view->setActive(active);
#ifdef HAVE_KACTIVITIES #if HAVE_KACTIVITIES
if (active) { if (active) {
m_activityResourceInstance->notifyFocusedIn(); m_activityResourceInstance->notifyFocusedIn();
} else { } else {
@ -530,7 +530,7 @@ void DolphinViewContainer::setUrl(const QUrl& newUrl)
m_urlNavigator->setLocationUrl(newUrl); m_urlNavigator->setLocationUrl(newUrl);
} }
#ifdef HAVE_KACTIVITIES #if HAVE_KACTIVITIES
m_activityResourceInstance->setUri(newUrl); m_activityResourceInstance->setUri(newUrl);
#endif #endif
} }

View file

@ -19,7 +19,7 @@
#include <QPushButton> #include <QPushButton>
#include <QWidget> #include <QWidget>
#ifdef HAVE_KACTIVITIES #if HAVE_KACTIVITIES
namespace KActivities { namespace KActivities {
class ResourceInstance; class ResourceInstance;
} }
@ -428,7 +428,7 @@ private:
*/ */
std::unique_ptr<DolphinUrlNavigator::VisualState> m_urlNavigatorVisualState; std::unique_ptr<DolphinUrlNavigator::VisualState> m_urlNavigatorVisualState;
#ifdef HAVE_KACTIVITIES #if HAVE_KACTIVITIES
private: private:
KActivities::ResourceInstance * m_activityResourceInstance; KActivities::ResourceInstance * m_activityResourceInstance;
#endif #endif

View file

@ -21,7 +21,7 @@
#include <KPluginMetaData> #include <KPluginMetaData>
#include <KSharedConfig> #include <KSharedConfig>
#ifdef HAVE_BALOO #if HAVE_BALOO
#include "private/kbaloorolesprovider.h" #include "private/kbaloorolesprovider.h"
#include <Baloo/File> #include <Baloo/File>
#include <Baloo/FileMonitor> #include <Baloo/FileMonitor>
@ -83,7 +83,7 @@ KFileItemModelRolesUpdater::KFileItemModelRolesUpdater(KFileItemModel* model, QO
m_recentlyChangedItems(), m_recentlyChangedItems(),
m_changedItems(), m_changedItems(),
m_directoryContentsCounter(nullptr) m_directoryContentsCounter(nullptr)
#ifdef HAVE_BALOO #if HAVE_BALOO
, m_balooFileMonitor(nullptr) , m_balooFileMonitor(nullptr)
#endif #endif
{ {
@ -114,7 +114,7 @@ KFileItemModelRolesUpdater::KFileItemModelRolesUpdater(KFileItemModel* model, QO
m_resolvableRoles.insert("size"); m_resolvableRoles.insert("size");
m_resolvableRoles.insert("type"); m_resolvableRoles.insert("type");
m_resolvableRoles.insert("isExpandable"); m_resolvableRoles.insert("isExpandable");
#ifdef HAVE_BALOO #if HAVE_BALOO
m_resolvableRoles += KBalooRolesProvider::instance().roles(); m_resolvableRoles += KBalooRolesProvider::instance().roles();
#endif #endif
@ -267,7 +267,7 @@ void KFileItemModelRolesUpdater::setRoles(const QSet<QByteArray>& roles)
if (m_roles != roles) { if (m_roles != roles) {
m_roles = roles; m_roles = roles;
#ifdef HAVE_BALOO #if HAVE_BALOO
// Check whether there is at least one role that must be resolved // Check whether there is at least one role that must be resolved
// with the help of Baloo. If this is the case, a (quite expensive) // with the help of Baloo. If this is the case, a (quite expensive)
// resolving will be done in KFileItemModelRolesUpdater::rolesData() and // resolving will be done in KFileItemModelRolesUpdater::rolesData() and
@ -397,7 +397,7 @@ void KFileItemModelRolesUpdater::slotItemsRemoved(const KItemRangeList& itemRang
const bool allItemsRemoved = (m_model->count() == 0); const bool allItemsRemoved = (m_model->count() == 0);
#ifdef HAVE_BALOO #if HAVE_BALOO
if (m_balooFileMonitor) { if (m_balooFileMonitor) {
// Don't let the FileWatcher watch for removed items // Don't let the FileWatcher watch for removed items
if (allItemsRemoved) { if (allItemsRemoved) {
@ -826,7 +826,7 @@ void KFileItemModelRolesUpdater::resolveRecentlyChangedItems()
void KFileItemModelRolesUpdater::applyChangedBalooRoles(const QString& file) void KFileItemModelRolesUpdater::applyChangedBalooRoles(const QString& file)
{ {
#ifdef HAVE_BALOO #if HAVE_BALOO
const KFileItem item = m_model->fileItem(QUrl::fromLocalFile(file)); const KFileItem item = m_model->fileItem(QUrl::fromLocalFile(file));
if (item.isNull()) { if (item.isNull()) {
@ -842,7 +842,7 @@ void KFileItemModelRolesUpdater::applyChangedBalooRoles(const QString& file)
void KFileItemModelRolesUpdater::applyChangedBalooRolesForItem(const KFileItem &item) void KFileItemModelRolesUpdater::applyChangedBalooRolesForItem(const KFileItem &item)
{ {
#ifdef HAVE_BALOO #if HAVE_BALOO
Baloo::File file(item.localPath()); Baloo::File file(item.localPath());
file.load(); file.load();
@ -1352,7 +1352,7 @@ QHash<QByteArray, QVariant> KFileItemModelRolesUpdater::rolesData(const KFileIte
} }
data.insert("iconOverlays", overlays); data.insert("iconOverlays", overlays);
#ifdef HAVE_BALOO #if HAVE_BALOO
if (m_balooFileMonitor) { if (m_balooFileMonitor) {
m_balooFileMonitor->addFile(item.localPath()); m_balooFileMonitor->addFile(item.localPath());
applyChangedBalooRolesForItem(item); applyChangedBalooRolesForItem(item);

View file

@ -30,7 +30,7 @@ namespace KIO {
class PreviewJob; class PreviewJob;
} }
#ifdef HAVE_BALOO #if HAVE_BALOO
namespace Baloo namespace Baloo
{ {
class FileMonitor; class FileMonitor;
@ -416,7 +416,7 @@ private:
QList<KOverlayIconPlugin*> m_overlayIconsPlugin; QList<KOverlayIconPlugin*> m_overlayIconsPlugin;
#ifdef HAVE_BALOO #if HAVE_BALOO
Baloo::FileMonitor* m_balooFileMonitor; Baloo::FileMonitor* m_balooFileMonitor;
Baloo::IndexerConfig m_balooConfig; Baloo::IndexerConfig m_balooConfig;
#endif #endif

View file

@ -13,7 +13,7 @@
#include "dolphinmainwindow.h" #include "dolphinmainwindow.h"
#include "global.h" #include "global.h"
#include "config-dolphin.h" #include "config-dolphin.h"
#ifdef HAVE_KUSERFEEDBACK #if HAVE_KUSERFEEDBACK
#include "userfeedback/dolphinfeedbackprovider.h" #include "userfeedback/dolphinfeedbackprovider.h"
#endif #endif
@ -238,7 +238,7 @@ int main(int argc, char **argv)
} }
} }
#ifdef HAVE_KUSERFEEDBACK #if HAVE_KUSERFEEDBACK
auto feedbackProvider = DolphinFeedbackProvider::instance(); auto feedbackProvider = DolphinFeedbackProvider::instance();
Q_UNUSED(feedbackProvider) Q_UNUSED(feedbackProvider)
#endif #endif

View file

@ -9,12 +9,12 @@
#include <QRegularExpression> #include <QRegularExpression>
#include <config-dolphin.h> #include <config-dolphin.h>
#ifdef HAVE_BALOO #if HAVE_BALOO
#include <Baloo/Query> #include <Baloo/Query>
#endif #endif
namespace { namespace {
#ifdef HAVE_BALOO #if HAVE_BALOO
/** Checks if a given term in the Baloo::Query::searchString() is a special search term /** Checks if a given term in the Baloo::Query::searchString() is a special search term
* @return: the specific search token of the term, or an empty QString() if none is found * @return: the specific search token of the term, or an empty QString() if none is found
*/ */
@ -99,7 +99,7 @@ bool DolphinQuery::supportsScheme(const QString& urlScheme)
void DolphinQuery::parseBalooQuery() void DolphinQuery::parseBalooQuery()
{ {
#ifdef HAVE_BALOO #if HAVE_BALOO
const Baloo::Query query = Baloo::Query::fromSearchUrl(m_searchUrl); const Baloo::Query query = Baloo::Query::fromSearchUrl(m_searchUrl);
m_includeFolder = query.includeFolder(); m_includeFolder = query.includeFolder();

View file

@ -16,7 +16,7 @@
#include <KMoreToolsMenuFactory> #include <KMoreToolsMenuFactory>
#include <KSeparator> #include <KSeparator>
#include <config-dolphin.h> #include <config-dolphin.h>
#ifdef HAVE_BALOO #if HAVE_BALOO
#include <Baloo/Query> #include <Baloo/Query>
#include <Baloo/IndexerConfig> #include <Baloo/IndexerConfig>
#endif #endif
@ -464,7 +464,7 @@ QString DolphinSearchBox::queryTitle(const QString& text) const
QUrl DolphinSearchBox::balooUrlForSearching() const QUrl DolphinSearchBox::balooUrlForSearching() const
{ {
#ifdef HAVE_BALOO #if HAVE_BALOO
const QString text = m_searchInput->text(); const QString text = m_searchInput->text();
Baloo::Query query; Baloo::Query query;
@ -534,7 +534,7 @@ void DolphinSearchBox::updateFacetsVisible()
bool DolphinSearchBox::isIndexingEnabled() const bool DolphinSearchBox::isIndexingEnabled() const
{ {
#ifdef HAVE_BALOO #if HAVE_BALOO
const Baloo::IndexerConfig searchInfo; const Baloo::IndexerConfig searchInfo;
return searchInfo.fileIndexingEnabled() && !searchPath().isEmpty() && searchInfo.shouldBeIndexed(searchPath().toLocalFile()); return searchInfo.fileIndexingEnabled() && !searchPath().isEmpty() && searchInfo.shouldBeIndexed(searchPath().toLocalFile());
#else #else

View file

@ -29,7 +29,7 @@ enum PackageOperation {
Uninstall Uninstall
}; };
#ifdef HAVE_PACKAGEKIT #if HAVE_PACKAGEKIT
#include <PackageKit/Daemon> #include <PackageKit/Daemon>
#include <PackageKit/Details> #include <PackageKit/Details>
#include <PackageKit/Transaction> #include <PackageKit/Transaction>
@ -53,7 +53,7 @@ QString getServiceMenusDir()
return QDir(dataLocation).absoluteFilePath("kio/servicemenus"); return QDir(dataLocation).absoluteFilePath("kio/servicemenus");
} }
#ifdef HAVE_PACKAGEKIT #if HAVE_PACKAGEKIT
void packageKitInstall(const QString &fileName) void packageKitInstall(const QString &fileName)
{ {
PackageKit::Transaction *transaction = PackageKit::Daemon::installFile(fileName, PackageKit::Transaction::TransactionFlagNone); PackageKit::Transaction *transaction = PackageKit::Daemon::installFile(fileName, PackageKit::Transaction::TransactionFlagNone);
@ -111,7 +111,7 @@ void packageKitUninstall(const QString &fileName)
Q_NORETURN void packageKit(PackageOperation operation, const QString &fileName) Q_NORETURN void packageKit(PackageOperation operation, const QString &fileName)
{ {
#ifdef HAVE_PACKAGEKIT #if HAVE_PACKAGEKIT
QFileInfo fileInfo(fileName); QFileInfo fileInfo(fileName);
if (!fileInfo.exists()) { if (!fileInfo.exists()) {
fail(i18n("The file does not exist!")); fail(i18n("The file does not exist!"));

View file

@ -15,7 +15,7 @@
#include "trash/trashsettingspage.h" #include "trash/trashsettingspage.h"
#include "viewmodes/viewsettingspage.h" #include "viewmodes/viewsettingspage.h"
#include "config-dolphin.h" #include "config-dolphin.h"
#ifdef HAVE_KUSERFEEDBACK #if HAVE_KUSERFEEDBACK
#include "userfeedback/dolphinfeedbackprovider.h" #include "userfeedback/dolphinfeedbackprovider.h"
#include "userfeedback/userfeedbacksettingspage.h" #include "userfeedback/userfeedbacksettingspage.h"
#endif #endif
@ -105,7 +105,7 @@ DolphinSettingsDialog::DolphinSettingsDialog(const QUrl& url, QWidget* parent, K
connect(trashSettingsPage, &TrashSettingsPage::changed, this, &DolphinSettingsDialog::enableApply); connect(trashSettingsPage, &TrashSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
} }
#ifdef HAVE_KUSERFEEDBACK #if HAVE_KUSERFEEDBACK
// User Feedback // User Feedback
UserFeedbackSettingsPage* feedbackSettingsPage = nullptr; UserFeedbackSettingsPage* feedbackSettingsPage = nullptr;
if (DolphinFeedbackProvider::instance()->isEnabled()) { if (DolphinFeedbackProvider::instance()->isEnabled()) {
@ -124,7 +124,7 @@ DolphinSettingsDialog::DolphinSettingsDialog(const QUrl& url, QWidget* parent, K
if (trashSettingsPage) { if (trashSettingsPage) {
m_pages.append(trashSettingsPage); m_pages.append(trashSettingsPage);
} }
#ifdef HAVE_KUSERFEEDBACK #if HAVE_KUSERFEEDBACK
if (feedbackSettingsPage) { if (feedbackSettingsPage) {
m_pages.append(feedbackSettingsPage); m_pages.append(feedbackSettingsPage);
} }

View file

@ -65,7 +65,7 @@ BehaviorSettingsPage::BehaviorSettingsPage(const QUrl& url, QWidget* parent) :
topLayout->addItem(new QSpacerItem(0, Dolphin::VERTICAL_SPACER_HEIGHT, QSizePolicy::Fixed, QSizePolicy::Fixed)); topLayout->addItem(new QSpacerItem(0, Dolphin::VERTICAL_SPACER_HEIGHT, QSizePolicy::Fixed, QSizePolicy::Fixed));
#ifdef HAVE_BALOO #if HAVE_BALOO
// 'Show tooltips' // 'Show tooltips'
m_showToolTips = new QCheckBox(i18nc("@option:check", "Show tooltips")); m_showToolTips = new QCheckBox(i18nc("@option:check", "Show tooltips"));
topLayout->addRow(i18nc("@title:group", "Miscellaneous: "), m_showToolTips); topLayout->addRow(i18nc("@title:group", "Miscellaneous: "), m_showToolTips);
@ -73,7 +73,7 @@ BehaviorSettingsPage::BehaviorSettingsPage(const QUrl& url, QWidget* parent) :
// 'Show selection marker' // 'Show selection marker'
m_showSelectionToggle = new QCheckBox(i18nc("@option:check", "Show selection marker")); m_showSelectionToggle = new QCheckBox(i18nc("@option:check", "Show selection marker"));
#ifdef HAVE_BALOO #if HAVE_BALOO
topLayout->addRow(QString(), m_showSelectionToggle); topLayout->addRow(QString(), m_showSelectionToggle);
#else #else
topLayout->addRow(i18nc("@title:group", "Miscellaneous: "), m_showSelectionToggle); topLayout->addRow(i18nc("@title:group", "Miscellaneous: "), m_showSelectionToggle);
@ -96,7 +96,7 @@ BehaviorSettingsPage::BehaviorSettingsPage(const QUrl& url, QWidget* parent) :
connect(m_localViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); connect(m_localViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed);
connect(m_globalViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); connect(m_globalViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed);
#ifdef HAVE_BALOO #if HAVE_BALOO
connect(m_showToolTips, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); connect(m_showToolTips, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed);
#endif #endif
connect(m_showSelectionToggle, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); connect(m_showSelectionToggle, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed);
@ -119,7 +119,7 @@ void BehaviorSettingsPage::applySettings()
const bool useGlobalViewProps = m_globalViewProps->isChecked(); const bool useGlobalViewProps = m_globalViewProps->isChecked();
settings->setGlobalViewProps(useGlobalViewProps); settings->setGlobalViewProps(useGlobalViewProps);
#ifdef HAVE_BALOO #if HAVE_BALOO
settings->setShowToolTips(m_showToolTips->isChecked()); settings->setShowToolTips(m_showToolTips->isChecked());
#endif #endif
settings->setShowSelectionToggle(m_showSelectionToggle->isChecked()); settings->setShowSelectionToggle(m_showSelectionToggle->isChecked());
@ -153,7 +153,7 @@ void BehaviorSettingsPage::loadSettings()
m_localViewProps->setChecked(!useGlobalViewProps); m_localViewProps->setChecked(!useGlobalViewProps);
m_globalViewProps->setChecked(useGlobalViewProps); m_globalViewProps->setChecked(useGlobalViewProps);
#ifdef HAVE_BALOO #if HAVE_BALOO
m_showToolTips->setChecked(GeneralSettings::showToolTips()); m_showToolTips->setChecked(GeneralSettings::showToolTips());
#endif #endif
m_showSelectionToggle->setChecked(GeneralSettings::showSelectionToggle()); m_showSelectionToggle->setChecked(GeneralSettings::showSelectionToggle());

View file

@ -37,7 +37,7 @@ ConfirmationsSettingsPage::ConfirmationsSettingsPage(QWidget* parent) :
m_confirmEmptyTrash(nullptr), m_confirmEmptyTrash(nullptr),
m_confirmDelete(nullptr), m_confirmDelete(nullptr),
#ifdef HAVE_TERMINAL #if HAVE_TERMINAL
m_confirmClosingTerminalRunningProgram(nullptr), m_confirmClosingTerminalRunningProgram(nullptr),
#endif #endif
@ -61,7 +61,7 @@ ConfirmationsSettingsPage::ConfirmationsSettingsPage(QWidget* parent) :
m_confirmClosingMultipleTabs = new QCheckBox(i18nc("@option:check Ask for confirmation in Dolphin when", m_confirmClosingMultipleTabs = new QCheckBox(i18nc("@option:check Ask for confirmation in Dolphin when",
"Closing windows with multiple tabs"), this); "Closing windows with multiple tabs"), this);
#ifdef HAVE_TERMINAL #if HAVE_TERMINAL
m_confirmClosingTerminalRunningProgram = new QCheckBox(i18nc("@option:check Ask for confirmation when", m_confirmClosingTerminalRunningProgram = new QCheckBox(i18nc("@option:check Ask for confirmation when",
"Closing windows with a program running in the Terminal panel"), this); "Closing windows with a program running in the Terminal panel"), this);
#endif #endif
@ -83,7 +83,7 @@ ConfirmationsSettingsPage::ConfirmationsSettingsPage(QWidget* parent) :
topLayout->addWidget(confirmLabelDolphin); topLayout->addWidget(confirmLabelDolphin);
topLayout->addWidget(m_confirmClosingMultipleTabs); topLayout->addWidget(m_confirmClosingMultipleTabs);
#ifdef HAVE_TERMINAL #if HAVE_TERMINAL
topLayout->addWidget(m_confirmClosingTerminalRunningProgram); topLayout->addWidget(m_confirmClosingTerminalRunningProgram);
#endif #endif
@ -100,7 +100,7 @@ ConfirmationsSettingsPage::ConfirmationsSettingsPage(QWidget* parent) :
connect(m_confirmScriptExecution, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ConfirmationsSettingsPage::changed); connect(m_confirmScriptExecution, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ConfirmationsSettingsPage::changed);
connect(m_confirmClosingMultipleTabs, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); connect(m_confirmClosingMultipleTabs, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed);
#ifdef HAVE_TERMINAL #if HAVE_TERMINAL
connect(m_confirmClosingTerminalRunningProgram, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); connect(m_confirmClosingTerminalRunningProgram, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed);
#endif #endif
} }
@ -135,7 +135,7 @@ void ConfirmationsSettingsPage::applySettings()
GeneralSettings* settings = GeneralSettings::self(); GeneralSettings* settings = GeneralSettings::self();
settings->setConfirmClosingMultipleTabs(m_confirmClosingMultipleTabs->isChecked()); settings->setConfirmClosingMultipleTabs(m_confirmClosingMultipleTabs->isChecked());
#ifdef HAVE_TERMINAL #if HAVE_TERMINAL
settings->setConfirmClosingTerminalRunningProgram(m_confirmClosingTerminalRunningProgram->isChecked()); settings->setConfirmClosingTerminalRunningProgram(m_confirmClosingTerminalRunningProgram->isChecked());
#endif #endif
@ -175,7 +175,7 @@ void ConfirmationsSettingsPage::loadSettings()
m_confirmClosingMultipleTabs->setChecked(GeneralSettings::confirmClosingMultipleTabs()); m_confirmClosingMultipleTabs->setChecked(GeneralSettings::confirmClosingMultipleTabs());
#ifdef HAVE_TERMINAL #if HAVE_TERMINAL
m_confirmClosingTerminalRunningProgram->setChecked(GeneralSettings::confirmClosingTerminalRunningProgram()); m_confirmClosingTerminalRunningProgram->setChecked(GeneralSettings::confirmClosingTerminalRunningProgram());
#endif #endif
} }

View file

@ -37,7 +37,7 @@ private:
QCheckBox* m_confirmEmptyTrash; QCheckBox* m_confirmEmptyTrash;
QCheckBox* m_confirmDelete; QCheckBox* m_confirmDelete;
#ifdef HAVE_TERMINAL #if HAVE_TERMINAL
QCheckBox* m_confirmClosingTerminalRunningProgram; QCheckBox* m_confirmClosingTerminalRunningProgram;
#endif #endif

View file

@ -19,7 +19,7 @@
#include <KMessageBox> #include <KMessageBox>
#include <KWindowConfig> #include <KWindowConfig>
#ifdef HAVE_BALOO #if HAVE_BALOO
#include <Baloo/IndexerConfig> #include <Baloo/IndexerConfig>
#endif #endif
@ -108,7 +108,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
// Add checkboxes // Add checkboxes
bool indexingEnabled = false; bool indexingEnabled = false;
#ifdef HAVE_BALOO #if HAVE_BALOO
Baloo::IndexerConfig config; Baloo::IndexerConfig config;
indexingEnabled = config.fileIndexingEnabled(); indexingEnabled = config.fileIndexingEnabled();
#endif #endif

View file

@ -25,7 +25,7 @@
#include "views/tooltips/tooltipmanager.h" #include "views/tooltips/tooltipmanager.h"
#include "zoomlevelinfo.h" #include "zoomlevelinfo.h"
#ifdef HAVE_BALOO #if HAVE_BALOO
#include <Baloo/IndexerConfig> #include <Baloo/IndexerConfig>
#endif #endif
#include <KColorScheme> #include <KColorScheme>
@ -209,7 +209,7 @@ DolphinView::DolphinView(const QUrl& url, QWidget* parent) :
connect(selectionManager, &KItemListSelectionManager::selectionChanged, connect(selectionManager, &KItemListSelectionManager::selectionChanged,
this, &DolphinView::slotSelectionChanged); this, &DolphinView::slotSelectionChanged);
#ifdef HAVE_BALOO #if HAVE_BALOO
m_toolTipManager = new ToolTipManager(this); m_toolTipManager = new ToolTipManager(this);
connect(m_toolTipManager, &ToolTipManager::urlActivated, this, &DolphinView::urlActivated); connect(m_toolTipManager, &ToolTipManager::urlActivated, this, &DolphinView::urlActivated);
#endif #endif
@ -1076,7 +1076,7 @@ void DolphinView::slotHeaderContextMenuRequested(const QPointF& pos)
const QList<QByteArray> visibleRolesSet = view->visibleRoles(); const QList<QByteArray> visibleRolesSet = view->visibleRoles();
bool indexingEnabled = false; bool indexingEnabled = false;
#ifdef HAVE_BALOO #if HAVE_BALOO
Baloo::IndexerConfig config; Baloo::IndexerConfig config;
indexingEnabled = config.fileIndexingEnabled(); indexingEnabled = config.fileIndexingEnabled();
#endif #endif
@ -1224,7 +1224,7 @@ void DolphinView::slotItemHovered(int index)
const QPoint pos = m_container->mapToGlobal(itemRect.topLeft().toPoint()); const QPoint pos = m_container->mapToGlobal(itemRect.topLeft().toPoint());
itemRect.moveTo(pos); itemRect.moveTo(pos);
#ifdef HAVE_BALOO #if HAVE_BALOO
auto nativeParent = nativeParentWidget(); auto nativeParent = nativeParentWidget();
if (nativeParent) { if (nativeParent) {
m_toolTipManager->showToolTip(item, itemRect, nativeParent->windowHandle()); m_toolTipManager->showToolTip(item, itemRect, nativeParent->windowHandle());
@ -1666,7 +1666,7 @@ void DolphinView::updateViewState()
void DolphinView::hideToolTip(const ToolTipManager::HideBehavior behavior) void DolphinView::hideToolTip(const ToolTipManager::HideBehavior behavior)
{ {
if (GeneralSettings::showToolTips()) { if (GeneralSettings::showToolTips()) {
#ifdef HAVE_BALOO #if HAVE_BALOO
m_toolTipManager->hideToolTip(behavior); m_toolTipManager->hideToolTip(behavior);
#else #else
Q_UNUSED(behavior) Q_UNUSED(behavior)

View file

@ -14,7 +14,7 @@
#include "views/zoomlevelinfo.h" #include "views/zoomlevelinfo.h"
#include "kconfig_version.h" #include "kconfig_version.h"
#ifdef HAVE_BALOO #if HAVE_BALOO
#include <Baloo/IndexerConfig> #include <Baloo/IndexerConfig>
#endif #endif
#include <KActionCollection> #include <KActionCollection>
@ -355,7 +355,7 @@ QActionGroup* DolphinViewActionHandler::createFileItemRolesActionGroup(const QSt
QActionGroup* groupMenuGroup = nullptr; QActionGroup* groupMenuGroup = nullptr;
bool indexingEnabled = false; bool indexingEnabled = false;
#ifdef HAVE_BALOO #if HAVE_BALOO
Baloo::IndexerConfig config; Baloo::IndexerConfig config;
indexingEnabled = config.fileIndexingEnabled(); indexingEnabled = config.fileIndexingEnabled();
#endif #endif