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.
-#cmakedefine HAVE_BALOO
-#cmakedefine HAVE_KACTIVITIES
-#cmakedefine HAVE_KUSERFEEDBACK
-#cmakedefine HAVE_PACKAGEKIT
-#cmakedefine HAVE_TERMINAL
+#cmakedefine01 HAVE_BALOO
+#cmakedefine01 HAVE_KACTIVITIES
+#cmakedefine01 HAVE_KUSERFEEDBACK
+#cmakedefine01 HAVE_PACKAGEKIT
+#cmakedefine01 HAVE_TERMINAL
bool DolphinMainWindow::isInformationPanelEnabled() const
{
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
return actionCollection()->action(QStringLiteral("show_information_panel"))->isChecked();
#else
return false;
actionCollection()->setDefaultShortcut(openTerminalHere, Qt::SHIFT | Qt::ALT | Qt::Key_F4);
connect(openTerminalHere, &QAction::triggered, this, &DolphinMainWindow::openTerminalHere);
-#ifdef HAVE_TERMINAL
+#if HAVE_TERMINAL
QAction* focusTerminalPanel = actionCollection()->addAction(QStringLiteral("focus_terminal_panel"));
focusTerminalPanel->setText(i18nc("@action:inmenu Tools", "Focus Terminal Panel"));
focusTerminalPanel->setIcon(QIcon::fromTheme(QStringLiteral("swap-panels")));
infoDock->setObjectName(QStringLiteral("infoDock"));
infoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
InformationPanel* infoPanel = new InformationPanel(infoDock);
infoPanel->setCustomContextMenuActions({lockLayoutAction});
connect(infoPanel, &InformationPanel::urlActivated, this, &DolphinMainWindow::handleUrl);
const QString panelWhatsThis = xi18nc("@info:whatsthis", "<para>To show or "
"hide panels like this go to <interface>Control|Panels</interface> "
"or <interface>View|Panels</interface>.</para>");
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
actionCollection()->action(QStringLiteral("show_information_panel"))
->setWhatsThis(xi18nc("@info:whatsthis", "<para> This toggles the "
"<emphasis>information</emphasis> panel at the right side of the "
"This allows quick switching between any folders.</para>") + panelWhatsThis);
// Setup "Terminal"
-#ifdef HAVE_TERMINAL
+#if HAVE_TERMINAL
if (KAuthorized::authorize(QStringLiteral("shell_access"))) {
DolphinDockWidget* terminalDock = new DolphinDockWidget(i18nc("@title:window Shell terminal", "Terminal"));
terminalDock->setLocked(lock);
panelsMenu->setPopupMode(QToolButton::InstantPopup);
const KActionCollection* ac = actionCollection();
panelsMenu->addAction(ac->action(QStringLiteral("show_places_panel")));
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
panelsMenu->addAction(ac->action(QStringLiteral("show_information_panel")));
#endif
panelsMenu->addAction(ac->action(QStringLiteral("show_folders_panel")));
#include <kio/fileundomanager.h>
#include <kxmlguiwindow.h>
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
#include "panels/information/informationpanel.h"
#endif
#include "views/viewproperties.h"
#include "dolphin_detailsmodesettings.h"
-#ifdef HAVE_KACTIVITIES
+#if HAVE_KACTIVITIES
#include <KActivities/ResourceInstance>
#endif
#include <KFileItemActions>
m_statusBarTimer(nullptr),
m_statusBarTimestamp(),
m_autoGrabFocus(true)
-#ifdef HAVE_KACTIVITIES
+#if HAVE_KACTIVITIES
, m_activityResourceInstance(nullptr)
#endif
{
// Initialize kactivities resource instance
-#ifdef HAVE_KACTIVITIES
+#if HAVE_KACTIVITIES
m_activityResourceInstance = new KActivities::ResourceInstance(window()->winId(), url);
m_activityResourceInstance->setParent(this);
#endif
}
m_view->setActive(active);
-#ifdef HAVE_KACTIVITIES
+#if HAVE_KACTIVITIES
if (active) {
m_activityResourceInstance->notifyFocusedIn();
} else {
m_urlNavigator->setLocationUrl(newUrl);
}
-#ifdef HAVE_KACTIVITIES
+#if HAVE_KACTIVITIES
m_activityResourceInstance->setUri(newUrl);
#endif
}
#include <QPushButton>
#include <QWidget>
-#ifdef HAVE_KACTIVITIES
+#if HAVE_KACTIVITIES
namespace KActivities {
class ResourceInstance;
}
*/
std::unique_ptr<DolphinUrlNavigator::VisualState> m_urlNavigatorVisualState;
-#ifdef HAVE_KACTIVITIES
+#if HAVE_KACTIVITIES
private:
KActivities::ResourceInstance * m_activityResourceInstance;
#endif
#include <KPluginMetaData>
#include <KSharedConfig>
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
#include "private/kbaloorolesprovider.h"
#include <Baloo/File>
#include <Baloo/FileMonitor>
m_recentlyChangedItems(),
m_changedItems(),
m_directoryContentsCounter(nullptr)
- #ifdef HAVE_BALOO
+ #if HAVE_BALOO
, m_balooFileMonitor(nullptr)
#endif
{
m_resolvableRoles.insert("size");
m_resolvableRoles.insert("type");
m_resolvableRoles.insert("isExpandable");
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
m_resolvableRoles += KBalooRolesProvider::instance().roles();
#endif
if (m_roles != roles) {
m_roles = roles;
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
// 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)
// resolving will be done in KFileItemModelRolesUpdater::rolesData() and
const bool allItemsRemoved = (m_model->count() == 0);
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
if (m_balooFileMonitor) {
// Don't let the FileWatcher watch for removed items
if (allItemsRemoved) {
void KFileItemModelRolesUpdater::applyChangedBalooRoles(const QString& file)
{
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
const KFileItem item = m_model->fileItem(QUrl::fromLocalFile(file));
if (item.isNull()) {
void KFileItemModelRolesUpdater::applyChangedBalooRolesForItem(const KFileItem &item)
{
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
Baloo::File file(item.localPath());
file.load();
}
data.insert("iconOverlays", overlays);
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
if (m_balooFileMonitor) {
m_balooFileMonitor->addFile(item.localPath());
applyChangedBalooRolesForItem(item);
class PreviewJob;
}
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
namespace Baloo
{
class FileMonitor;
QList<KOverlayIconPlugin*> m_overlayIconsPlugin;
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
Baloo::FileMonitor* m_balooFileMonitor;
Baloo::IndexerConfig m_balooConfig;
#endif
#include "dolphinmainwindow.h"
#include "global.h"
#include "config-dolphin.h"
-#ifdef HAVE_KUSERFEEDBACK
+#if HAVE_KUSERFEEDBACK
#include "userfeedback/dolphinfeedbackprovider.h"
#endif
}
}
-#ifdef HAVE_KUSERFEEDBACK
+#if HAVE_KUSERFEEDBACK
auto feedbackProvider = DolphinFeedbackProvider::instance();
Q_UNUSED(feedbackProvider)
#endif
#include <QRegularExpression>
#include <config-dolphin.h>
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
#include <Baloo/Query>
#endif
namespace {
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
/** 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
*/
void DolphinQuery::parseBalooQuery()
{
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
const Baloo::Query query = Baloo::Query::fromSearchUrl(m_searchUrl);
m_includeFolder = query.includeFolder();
#include <KMoreToolsMenuFactory>
#include <KSeparator>
#include <config-dolphin.h>
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
#include <Baloo/Query>
#include <Baloo/IndexerConfig>
#endif
QUrl DolphinSearchBox::balooUrlForSearching() const
{
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
const QString text = m_searchInput->text();
Baloo::Query query;
bool DolphinSearchBox::isIndexingEnabled() const
{
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
const Baloo::IndexerConfig searchInfo;
return searchInfo.fileIndexingEnabled() && !searchPath().isEmpty() && searchInfo.shouldBeIndexed(searchPath().toLocalFile());
#else
Uninstall
};
-#ifdef HAVE_PACKAGEKIT
+#if HAVE_PACKAGEKIT
#include <PackageKit/Daemon>
#include <PackageKit/Details>
#include <PackageKit/Transaction>
return QDir(dataLocation).absoluteFilePath("kio/servicemenus");
}
-#ifdef HAVE_PACKAGEKIT
+#if HAVE_PACKAGEKIT
void packageKitInstall(const QString &fileName)
{
PackageKit::Transaction *transaction = PackageKit::Daemon::installFile(fileName, PackageKit::Transaction::TransactionFlagNone);
Q_NORETURN void packageKit(PackageOperation operation, const QString &fileName)
{
-#ifdef HAVE_PACKAGEKIT
+#if HAVE_PACKAGEKIT
QFileInfo fileInfo(fileName);
if (!fileInfo.exists()) {
fail(i18n("The file does not exist!"));
#include "trash/trashsettingspage.h"
#include "viewmodes/viewsettingspage.h"
#include "config-dolphin.h"
-#ifdef HAVE_KUSERFEEDBACK
+#if HAVE_KUSERFEEDBACK
#include "userfeedback/dolphinfeedbackprovider.h"
#include "userfeedback/userfeedbacksettingspage.h"
#endif
connect(trashSettingsPage, &TrashSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
}
-#ifdef HAVE_KUSERFEEDBACK
+#if HAVE_KUSERFEEDBACK
// User Feedback
UserFeedbackSettingsPage* feedbackSettingsPage = nullptr;
if (DolphinFeedbackProvider::instance()->isEnabled()) {
if (trashSettingsPage) {
m_pages.append(trashSettingsPage);
}
-#ifdef HAVE_KUSERFEEDBACK
+#if HAVE_KUSERFEEDBACK
if (feedbackSettingsPage) {
m_pages.append(feedbackSettingsPage);
}
topLayout->addItem(new QSpacerItem(0, Dolphin::VERTICAL_SPACER_HEIGHT, QSizePolicy::Fixed, QSizePolicy::Fixed));
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
// 'Show tooltips'
m_showToolTips = new QCheckBox(i18nc("@option:check", "Show tooltips"));
topLayout->addRow(i18nc("@title:group", "Miscellaneous: "), m_showToolTips);
// 'Show selection marker'
m_showSelectionToggle = new QCheckBox(i18nc("@option:check", "Show selection marker"));
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
topLayout->addRow(QString(), m_showSelectionToggle);
#else
topLayout->addRow(i18nc("@title:group", "Miscellaneous: "), m_showSelectionToggle);
connect(m_localViewProps, &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);
#endif
connect(m_showSelectionToggle, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed);
const bool useGlobalViewProps = m_globalViewProps->isChecked();
settings->setGlobalViewProps(useGlobalViewProps);
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
settings->setShowToolTips(m_showToolTips->isChecked());
#endif
settings->setShowSelectionToggle(m_showSelectionToggle->isChecked());
m_localViewProps->setChecked(!useGlobalViewProps);
m_globalViewProps->setChecked(useGlobalViewProps);
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
m_showToolTips->setChecked(GeneralSettings::showToolTips());
#endif
m_showSelectionToggle->setChecked(GeneralSettings::showSelectionToggle());
m_confirmEmptyTrash(nullptr),
m_confirmDelete(nullptr),
-#ifdef HAVE_TERMINAL
+#if HAVE_TERMINAL
m_confirmClosingTerminalRunningProgram(nullptr),
#endif
m_confirmClosingMultipleTabs = new QCheckBox(i18nc("@option:check Ask for confirmation in Dolphin when",
"Closing windows with multiple tabs"), this);
-#ifdef HAVE_TERMINAL
+#if HAVE_TERMINAL
m_confirmClosingTerminalRunningProgram = new QCheckBox(i18nc("@option:check Ask for confirmation when",
"Closing windows with a program running in the Terminal panel"), this);
#endif
topLayout->addWidget(confirmLabelDolphin);
topLayout->addWidget(m_confirmClosingMultipleTabs);
-#ifdef HAVE_TERMINAL
+#if HAVE_TERMINAL
topLayout->addWidget(m_confirmClosingTerminalRunningProgram);
#endif
connect(m_confirmScriptExecution, QOverload<int>::of(&QComboBox::currentIndexChanged), 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);
#endif
}
GeneralSettings* settings = GeneralSettings::self();
settings->setConfirmClosingMultipleTabs(m_confirmClosingMultipleTabs->isChecked());
-#ifdef HAVE_TERMINAL
+#if HAVE_TERMINAL
settings->setConfirmClosingTerminalRunningProgram(m_confirmClosingTerminalRunningProgram->isChecked());
#endif
m_confirmClosingMultipleTabs->setChecked(GeneralSettings::confirmClosingMultipleTabs());
-#ifdef HAVE_TERMINAL
+#if HAVE_TERMINAL
m_confirmClosingTerminalRunningProgram->setChecked(GeneralSettings::confirmClosingTerminalRunningProgram());
#endif
}
QCheckBox* m_confirmEmptyTrash;
QCheckBox* m_confirmDelete;
-#ifdef HAVE_TERMINAL
+#if HAVE_TERMINAL
QCheckBox* m_confirmClosingTerminalRunningProgram;
#endif
#include <KMessageBox>
#include <KWindowConfig>
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
#include <Baloo/IndexerConfig>
#endif
// Add checkboxes
bool indexingEnabled = false;
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
Baloo::IndexerConfig config;
indexingEnabled = config.fileIndexingEnabled();
#endif
#include "views/tooltips/tooltipmanager.h"
#include "zoomlevelinfo.h"
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
#include <Baloo/IndexerConfig>
#endif
#include <KColorScheme>
connect(selectionManager, &KItemListSelectionManager::selectionChanged,
this, &DolphinView::slotSelectionChanged);
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
m_toolTipManager = new ToolTipManager(this);
connect(m_toolTipManager, &ToolTipManager::urlActivated, this, &DolphinView::urlActivated);
#endif
const QList<QByteArray> visibleRolesSet = view->visibleRoles();
bool indexingEnabled = false;
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
Baloo::IndexerConfig config;
indexingEnabled = config.fileIndexingEnabled();
#endif
const QPoint pos = m_container->mapToGlobal(itemRect.topLeft().toPoint());
itemRect.moveTo(pos);
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
auto nativeParent = nativeParentWidget();
if (nativeParent) {
m_toolTipManager->showToolTip(item, itemRect, nativeParent->windowHandle());
void DolphinView::hideToolTip(const ToolTipManager::HideBehavior behavior)
{
if (GeneralSettings::showToolTips()) {
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
m_toolTipManager->hideToolTip(behavior);
#else
Q_UNUSED(behavior)
#include "views/zoomlevelinfo.h"
#include "kconfig_version.h"
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
#include <Baloo/IndexerConfig>
#endif
#include <KActionCollection>
QActionGroup* groupMenuGroup = nullptr;
bool indexingEnabled = false;
-#ifdef HAVE_BALOO
+#if HAVE_BALOO
Baloo::IndexerConfig config;
indexingEnabled = config.fileIndexingEnabled();
#endif