Commit 6f0c09b8 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Simplify checks for *_FOUND

`cmakedefine01` defines a 0 if the var is false or unset.
Consequently we do not need to check if the value is defined.

Also, if one ever removes the line by accident from the config file, the
build will fail with this MR.
parent a2ea426a
Pipeline #115213 passed with stage
in 3 minutes and 24 seconds
......@@ -6931,7 +6931,7 @@ void MediaPlayListProxyModelTest::enqueueSampleFiles()
QCOMPARE(newEntryInListSpy.count(), 0);
QCOMPARE(newUrlInListSpy.count(), 2);
#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND
#if KF5FileMetaData_FOUND
QCOMPARE(myPlayListProxyModel.data(myPlayListProxyModel.index(0, 0), MediaPlayList::TitleRole).toString(), QStringLiteral("Title"));
QCOMPARE(myPlayListProxyModel.data(myPlayListProxyModel.index(0, 0), MediaPlayList::AlbumRole).toString(), QStringLiteral("Test"));
QCOMPARE(myPlayListProxyModel.data(myPlayListProxyModel.index(0, 0), MediaPlayList::ArtistRole).toString(), QStringLiteral("Artist"));
......
......@@ -752,7 +752,7 @@ void MediaPlayListTest::enqueueSampleFiles()
QCOMPARE(newEntryInListSpy.count(), 0);
QCOMPARE(newUrlInListSpy.count(), 2);
#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND
#if KF5FileMetaData_FOUND
QCOMPARE(myPlayList.data(myPlayList.index(0, 0), MediaPlayList::TitleRole).toString(), QStringLiteral("Title"));
QCOMPARE(myPlayList.data(myPlayList.index(0, 0), MediaPlayList::AlbumRole).toString(), QStringLiteral("Test"));
QCOMPARE(myPlayList.data(myPlayList.index(0, 0), MediaPlayList::ArtistRole).toString(), QStringLiteral("Artist"));
......
......@@ -21,11 +21,11 @@
#include <KAuthorized>
#include <KLocalizedString>
#if defined KF5ConfigWidgets_FOUND && KF5ConfigWidgets_FOUND
#if KF5ConfigWidgets_FOUND
#include <KStandardAction>
#endif
#if defined KF5XmlGui_FOUND && KF5XmlGui_FOUND
#if defined KF5XmlGui_FOUND
#include <KActionCollection>
#include <KAboutApplicationDialog>
#include <KHelpMenu>
......@@ -36,7 +36,7 @@
#include <KColorSchemeManager>
#include <KAboutData>
#if defined KF5KIO_FOUND && KF5KIO_FOUND
#if KF5KIO_FOUND
#include <KIO/OpenFileManagerWindowJob>
#endif
......@@ -65,14 +65,14 @@ class ElisaApplicationPrivate
public:
explicit ElisaApplicationPrivate(QObject *parent)
#if defined KF5XmlGui_FOUND && KF5XmlGui_FOUND
#if KF5XmlGui_FOUND
: mCollection(parent)
#endif
{
Q_UNUSED(parent)
}
#if defined KF5XmlGui_FOUND && KF5XmlGui_FOUND
#if KF5XmlGui_FOUND
KActionCollection mCollection;
#endif
......@@ -134,7 +134,7 @@ void ElisaApplication::activateColorScheme(const QString &name)
void ElisaApplication::setupActions(const QString &actionName)
{
#if defined KF5XmlGui_FOUND && KF5XmlGui_FOUND
#if KF5XmlGui_FOUND
if (actionName == QLatin1String("file_quit")) {
auto quitAction = KStandardAction::quit(QCoreApplication::instance(), &QCoreApplication::quit, &d->mCollection);
d->mCollection.addAction(actionName, quitAction);
......@@ -282,7 +282,7 @@ void ElisaApplication::appHelpActivated()
void ElisaApplication::aboutApplication()
{
#if defined KF5XmlGui_FOUND && KF5XmlGui_FOUND
#if KF5XmlGui_FOUND
static QPointer<QDialog> dialog;
if (!dialog) {
dialog = new KAboutApplicationDialog(KAboutData::applicationData(), nullptr);
......@@ -294,7 +294,7 @@ void ElisaApplication::aboutApplication()
void ElisaApplication::reportBug()
{
#if defined KF5XmlGui_FOUND && KF5XmlGui_FOUND
#if KF5XmlGui_FOUND
static QPointer<QDialog> dialog;
if (!dialog) {
dialog = new KBugReport(KAboutData::applicationData(), nullptr);
......@@ -306,7 +306,7 @@ void ElisaApplication::reportBug()
void ElisaApplication::configureShortcuts()
{
#if defined KF5XmlGui_FOUND && KF5XmlGui_FOUND
#if KF5XmlGui_FOUND
KShortcutsDialog dlg(KShortcutsEditor::ApplicationAction, KShortcutsEditor::LetterShortcutsAllowed, nullptr);
dlg.setModal(true);
dlg.addCollection(&d->mCollection);
......@@ -508,7 +508,7 @@ void ElisaApplication::initializePlayer()
QAction * ElisaApplication::action(const QString& name)
{
#if defined KF5XmlGui_FOUND && KF5XmlGui_FOUND
#if KF5XmlGui_FOUND
auto resultAction = d->mCollection.action(name);
if (!resultAction) {
......@@ -553,7 +553,7 @@ bool ElisaApplication::eventFilter(QObject *object, QEvent *event)
void ElisaApplication::showInFolder(QUrl filePath)
{
#if defined KF5KIO_FOUND && KF5KIO_FOUND
#if KF5KIO_FOUND
KIO::highlightInFileManager({filePath});
#else
Q_UNUSED(filePath)
......
......@@ -8,7 +8,7 @@
#include "config-upnp-qt.h"
#if defined UPNPQT_FOUND && UPNPQT_FOUND
#if UPNPQT_FOUND
#include "upnp/upnpcontrolconnectionmanager.h"
#include "upnp/upnpcontrolmediaserver.h"
#include "upnp/upnpcontrolcontentdirectory.h"
......@@ -24,7 +24,7 @@
#include "upnpbasictypes.h"
#endif
#if defined KF5DBusAddons_FOUND && KF5DBusAddons_FOUND
#if KF5DBusAddons_FOUND
#include <KDBusService>
#endif
......@@ -52,18 +52,18 @@
#include "models/gridviewproxymodel.h"
#include "localFileConfiguration/elisaconfigurationdialog.h"
#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND
#if KF5FileMetaData_FOUND
#include "embeddedcoverageimageprovider.h"
#endif
#if defined KF5KIO_FOUND && KF5KIO_FOUND
#if KF5KIO_FOUND
#include "models/filebrowsermodel.h"
#include "models/filebrowserproxymodel.h"
#endif
#include "audiowrapper.h"
#if defined Qt5DBus_FOUND && Qt5DBus_FOUND
#if Qt5DBus_FOUND
#include "mpris2/mpris2.h"
#include "mpris2/mediaplayer2player.h"
#endif
......@@ -85,14 +85,14 @@ ElisaQmlTestPlugin::ElisaQmlTestPlugin(QObject *aParent)
void ElisaQmlTestPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
{
QQmlExtensionPlugin::initializeEngine(engine, uri);
#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND
#if KF5FileMetaData_FOUND
engine->addImageProvider(QStringLiteral("cover"), new EmbeddedCoverageImageProvider);
#endif
}
void ElisaQmlTestPlugin::registerTypes(const char *uri)
{
#if defined UPNPQT_FOUND && UPNPQT_FOUND
#if UPNPQT_FOUND
qmlRegisterType<UpnpSsdpEngine>(uri, 1, 0, "UpnpSsdpEngine");
qmlRegisterType<UpnpDiscoverAllMusic>(uri, 1, 0, "UpnpDiscoverAllMusic");
......@@ -133,7 +133,7 @@ void ElisaQmlTestPlugin::registerTypes(const char *uri)
qmlRegisterType<ViewsListData>(uri, 1, 0, "ViewsListData");
qmlRegisterType<GridViewProxyModel>(uri, 1, 0, "GridViewProxyModel");
#if defined KF5KIO_FOUND && KF5KIO_FOUND
#if KF5KIO_FOUND
qmlRegisterType<FileBrowserModel>(uri, 1, 0, "FileBrowserModel");
qmlRegisterType<FileBrowserProxyModel>(uri, 1, 0, "FileBrowserProxyModel");
#endif
......@@ -144,7 +144,7 @@ void ElisaQmlTestPlugin::registerTypes(const char *uri)
qmlRegisterUncreatableType<QAbstractProxyModel>(uri, 1, 0, "AbstractProxyModel", QStringLiteral("Abstract Qt type"));
qmlRegisterUncreatableType<DataTypes>(uri, 1, 0, "DataTypes", QStringLiteral("Abstract type not to be used in aml directtly"));
#if defined Qt5DBus_FOUND && Qt5DBus_FOUND
#if Qt5DBus_FOUND
qmlRegisterType<Mpris2>(uri, 1, 0, "Mpris2");
qRegisterMetaType<MediaPlayer2Player*>();
#endif
......@@ -199,11 +199,11 @@ void ElisaQmlTestPlugin::registerTypes(const char *uri)
auto newApplication = std::make_unique<ElisaApplication>();
#if defined KF5DBusAddons_FOUND && KF5DBusAddons_FOUND
#if KF5DBusAddons_FOUND
auto *elisaService = new KDBusService(KDBusService::Unique, newApplication.get());
#endif
#if defined KF5DBusAddons_FOUND && KF5DBusAddons_FOUND
#if KF5DBusAddons_FOUND
QObject::connect(elisaService, &KDBusService::activateActionRequested, newApplication.get(), &ElisaApplication::activateActionRequested);
QObject::connect(elisaService, &KDBusService::activateRequested, newApplication.get(), &ElisaApplication::activateRequested);
QObject::connect(elisaService, &KDBusService::openRequested, newApplication.get(), &ElisaApplication::openRequested);
......
......@@ -10,7 +10,7 @@
#include "abstractfile/indexercommon.h"
#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND
#if KF5FileMetaData_FOUND
#include <KFileMetaData/ExtractorCollection>
#include <KFileMetaData/Extractor>
......@@ -19,7 +19,7 @@
#include <KFileMetaData/Properties>
#include <KFileMetaData/EmbeddedImageData>
#if defined KF5Baloo_FOUND && KF5Baloo_FOUND
#if KF5Baloo_FOUND
#include <Baloo/File>
......@@ -36,7 +36,7 @@
class FileScannerPrivate
{
public:
#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND
#if KF5FileMetaData_FOUND
KFileMetaData::ExtractorCollection mAllExtractors;
KFileMetaData::PropertyMap mAllProperties;
......@@ -46,7 +46,7 @@ public:
QMimeDatabase mMimeDb;
#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND
#if KF5FileMetaData_FOUND
const QHash<KFileMetaData::Property::Property, DataTypes::ColumnsRoles> propertyTranslation = {
{KFileMetaData::Property::Artist, DataTypes::ColumnsRoles::ArtistRole},
{KFileMetaData::Property::AlbumArtist, DataTypes::ColumnsRoles::AlbumArtistRole},
......@@ -109,7 +109,7 @@ DataTypes::TrackDataType FileScanner::scanOneFile(const QUrl &scanFile, const QF
newTrack[DataTypes::RatingRole] = 0;
newTrack[DataTypes::ElementTypeRole] = ElisaUtils::Track;
#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND
#if KF5FileMetaData_FOUND
const auto &fileMimeType = d->mMimeDb.mimeTypeForFile(localFileName);
if (!fileMimeType.name().startsWith(QLatin1String("audio/"))) {
return newTrack;
......@@ -168,7 +168,7 @@ DataTypes::TrackDataType FileScanner::scanOneFile(const QUrl &scanFile)
DataTypes::TrackDataType FileScanner::scanOneBalooFile(const QUrl &scanFile, const QFileInfo &scanFileInfo)
{
DataTypes::TrackDataType newTrack;
#if defined KF5Baloo_FOUND && KF5Baloo_FOUND
#if KF5Baloo_FOUND
const auto &localFileName = scanFile.toLocalFile();
newTrack[DataTypes::FileModificationTime] = scanFileInfo.metadataChangeTime();
......@@ -195,7 +195,7 @@ DataTypes::TrackDataType FileScanner::scanOneBalooFile(const QUrl &scanFile, con
void FileScanner::scanProperties(const QString &localFileName, DataTypes::TrackDataType &trackData)
{
#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND
#if KF5FileMetaData_FOUND
if (d->mAllProperties.isEmpty()) {
return;
}
......@@ -279,7 +279,7 @@ QUrl FileScanner::searchForCoverFile(const QString &localFileName)
bool FileScanner::checkEmbeddedCoverImage(const QString &localFileName)
{
#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND
#if KF5FileMetaData_FOUND
const auto &imageData = d->mImageScanner.imageData(localFileName);
if (imageData.contains(KFileMetaData::EmbeddedImageData::FrontCover)) {
......
......@@ -10,7 +10,7 @@
#include "config-upnp-qt.h"
#include <QMimeDatabase>
#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND
#if KF5FileMetaData_FOUND
#include <KFileMetaData/WriterCollection>
#include <KFileMetaData/Writer>
......@@ -25,7 +25,7 @@ class FileWriterPrivate
{
public:
#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND
#if KF5FileMetaData_FOUND
KFileMetaData::WriterCollection mAllWriters;
const QHash<DataTypes::ColumnsRoles, KFileMetaData::Property::Property> mPropertyTranslation = {
......@@ -57,7 +57,7 @@ FileWriter::~FileWriter() = default;
bool FileWriter::writeSingleMetaDataToFile(const QUrl &url, const DataTypes::ColumnsRoles role, const QVariant &data)
{
#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND
#if KF5FileMetaData_FOUND
if (!url.isLocalFile()) {
return false;
......@@ -106,7 +106,7 @@ bool FileWriter::writeSingleMetaDataToFile(const QUrl &url, const DataTypes::Col
bool FileWriter::writeAllMetaDataToFile(const QUrl &url, const DataTypes::TrackDataType &data)
{
#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND
#if KF5FileMetaData_FOUND
if (!url.isLocalFile()) {
return false;
......
......@@ -14,7 +14,7 @@
//#define QT_QML_DEBUG
#if defined KF5Declarative_FOUND && KF5Declarative_FOUND
#if KF5Declarative_FOUND
#include <KDeclarative/KDeclarative>
#include <KQuickAddons/QtQuickSettings>
#endif
......@@ -24,7 +24,7 @@
#include <KAboutData>
#if defined KF5Crash_FOUND && KF5Crash_FOUND
#if KF5Crash_FOUND
#include <KCrash>
#endif
......@@ -41,13 +41,13 @@
#include <QQuickStyle>
#include <QQmlContext>
#if defined Qt5AndroidExtras_FOUND && Qt5AndroidExtras_FOUND
#if Qt5AndroidExtras_FOUND
#include <QAndroidService>
#endif
#include <memory>
#if defined Qt5AndroidExtras_FOUND && Qt5AndroidExtras_FOUND
#if Qt5AndroidExtras_FOUND
#include <QAndroidJniObject>
#include <QtAndroid>
#endif
......@@ -84,13 +84,13 @@ int main(int argc, char *argv[])
QApplication::setStyle(QStringLiteral("breeze"));
#endif
#if defined KF5Declarative_FOUND && KF5Declarative_FOUND
#if KF5Declarative_FOUND
KQuickAddons::QtQuickSettings::init();
#endif
KLocalizedString::setApplicationDomain("elisa");
#if defined Qt5AndroidExtras_FOUND && Qt5AndroidExtras_FOUND
#if Qt5AndroidExtras_FOUND
qInfo() << QCoreApplication::arguments();
QAndroidJniObject::callStaticMethod<void>("org/kde/elisa/ElisaService",
......@@ -99,7 +99,7 @@ int main(int argc, char *argv[])
QtAndroid::androidContext().object());
#endif
#if defined KF5Crash_FOUND && KF5Crash_FOUND
#if KF5Crash_FOUND
KCrash::initialize();
#endif
......@@ -139,7 +139,7 @@ int main(int argc, char *argv[])
engine.addImportPath(QStringLiteral("qrc:/imports"));
QQmlFileSelector selector(&engine);
#if defined KF5Declarative_FOUND && KF5Declarative_FOUND
#if KF5Declarative_FOUND
KDeclarative::KDeclarative decl;
decl.setDeclarativeEngine(&engine);
decl.setupEngine(&engine);
......
......@@ -17,7 +17,7 @@
#include "manageheaderbar.h"
#include "audiowrapper.h"
#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND
#if KF5FileMetaData_FOUND
#include <KFileMetaData/EmbeddedImageData>
#endif
......@@ -416,7 +416,7 @@ QVariantMap MediaPlayer2Player::getMetadataOfCurrentTrack()
if (m_manageHeaderBar->image().scheme() == QStringLiteral("image")) {
// adding a special case for image:// URLs that are only valid because Elisa installs a special handler for them
// converting those URL to data URLs with embedded image data
#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND
#if KF5FileMetaData_FOUND
KFileMetaData::EmbeddedImageData embeddedImage;
auto imageData = embeddedImage.imageData(m_manageHeaderBar->image().toString().mid(14));
......
......@@ -10,16 +10,16 @@
#include "indexersManager.h"
#if defined UPNPQT_FOUND && UPNPQT_FOUND
#if UPNPQT_FOUND
#include "upnp/upnplistener.h"
#endif
#if defined KF5Baloo_FOUND && KF5Baloo_FOUND
#if KF5Baloo_FOUND
#include "baloo/baloolistener.h"
#include "baloo/baloodetector.h"
#endif
#if defined Qt5AndroidExtras_FOUND && Qt5AndroidExtras_FOUND
#if Qt5AndroidExtras_FOUND
#include "android/androidmusiclistener.h"
#endif
......@@ -51,11 +51,11 @@ public:
QThread mListenerThread;
#if defined UPNPQT_FOUND && UPNPQT_FOUND
#if UPNPQT_FOUND
UpnpListener mUpnpListener;
#endif
#if defined KF5Baloo_FOUND && KF5Baloo_FOUND
#if KF5Baloo_FOUND
BalooDetector mBalooDetector;
BalooListener mBalooListener;
......@@ -63,7 +63,7 @@ public:
FileListener mFileListener;
#if defined Qt5AndroidExtras_FOUND && Qt5AndroidExtras_FOUND
#if Qt5AndroidExtras_FOUND
AndroidMusicListener mAndroidMusicListener;
#endif
......@@ -99,7 +99,7 @@ MusicListenersManager::MusicListenersManager(QObject *parent)
connect(&d->mDatabaseInterface, &DatabaseInterface::tracksAdded,
this, &MusicListenersManager::increaseImportedTracksCount);
#if defined KF5Baloo_FOUND && KF5Baloo_FOUND
#if KF5Baloo_FOUND
connect(&d->mBalooDetector, &BalooDetector::balooAvailabilityChanged,
this, &MusicListenersManager::balooAvailabilityChanged);
#endif
......@@ -320,7 +320,7 @@ void MusicListenersManager::configChanged()
currentConfiguration->read();
bool configurationHasChanged = false;
#if defined KF5Baloo_FOUND && KF5Baloo_FOUND
#if KF5Baloo_FOUND
if (d->mBalooIndexerAvailable && d->mBalooIndexerActive && d->mBalooListener.canHandleRootPaths() && !currentConfiguration->forceUsageOfFastFileSearch()) {
configurationHasChanged = true;
} else if (d->mBalooIndexerAvailable && !d->mBalooIndexerActive && d->mBalooListener.canHandleRootPaths() && currentConfiguration->forceUsageOfFastFileSearch()) {
......@@ -364,7 +364,7 @@ void MusicListenersManager::configChanged()
d->mFileListener.setAllRootPaths(allRootPaths);
#if defined KF5Baloo_FOUND && KF5Baloo_FOUND
#if KF5Baloo_FOUND
d->mBalooListener.setAllRootPaths(allRootPaths);
#endif
......@@ -372,7 +372,7 @@ void MusicListenersManager::configChanged()
testBalooIndexerAvailability();
}
#if defined KF5Baloo_FOUND && KF5Baloo_FOUND
#if KF5Baloo_FOUND
if (d->mBalooIndexerAvailable && !d->mBalooIndexerActive && d->mBalooListener.canHandleRootPaths() && currentConfiguration->forceUsageOfFastFileSearch()) {
qCDebug(orgKdeElisaIndexersManager()) << "trigger start of baloo file indexer";
QMetaObject::invokeMethod(d->mFileListener.fileListing(), "stop", Qt::BlockingQueuedConnection);
......@@ -391,7 +391,7 @@ void MusicListenersManager::configChanged()
if (d->mBalooIndexerActive) {
qCInfo(orgKdeElisaIndexersManager()) << "trigger init of baloo file indexer";
#if defined KF5Baloo_FOUND && KF5Baloo_FOUND
#if KF5Baloo_FOUND
QMetaObject::invokeMethod(d->mBalooListener.fileListing(), "init", Qt::QueuedConnection);
#endif
} else if (d->mFileSystemIndexerActive) {
......@@ -403,7 +403,7 @@ void MusicListenersManager::configChanged()
#endif
}
#if defined UPNPQT_FOUND && UPNPQT_FOUND
#if UPNPQT_FOUND
d->mUpnpListener.setDatabaseInterface(&d->mDatabaseInterface);
d->mUpnpListener.moveToThread(&d->mDatabaseThread);
connect(this, &MusicListenersManager::applicationIsTerminating,
......@@ -447,7 +447,7 @@ void MusicListenersManager::cleanedDatabase()
void MusicListenersManager::balooAvailabilityChanged()
{
#if defined KF5Baloo_FOUND && KF5Baloo_FOUND
#if KF5Baloo_FOUND
if (!d->mBalooDetector.balooAvailability() || !d->mBalooListener.canHandleRootPaths()) {
if (d->mBalooDetector.balooAvailability()) {
qCInfo(orgKdeElisaIndexersManager) << "Baloo indexer is available";
......@@ -457,7 +457,7 @@ void MusicListenersManager::balooAvailabilityChanged()
if (true) {
#endif
#if defined KF5Baloo_FOUND && KF5Baloo_FOUND
#if KF5Baloo_FOUND
if (!d->mBalooListener.canHandleRootPaths() && d->mBalooDetector.balooAvailability())
{
qCInfo(orgKdeElisaIndexersManager()) << "Baloo cannot handle all configured paths: falling back to plain filex indexer";
......@@ -482,7 +482,7 @@ void MusicListenersManager::balooAvailabilityChanged()
void MusicListenersManager::testBalooIndexerAvailability()
{
#if defined KF5Baloo_FOUND && KF5Baloo_FOUND
#if KF5Baloo_FOUND
d->mBalooDetector.checkBalooAvailability();
#else
qCInfo(orgKdeElisaIndexersManager) << "Baloo indexer is unavailable";
......@@ -545,7 +545,7 @@ void MusicListenersManager::startAndroidIndexing()
void MusicListenersManager::startBalooIndexing()
{
#if defined KF5Baloo_FOUND && KF5Baloo_FOUND
#if KF5Baloo_FOUND
d->mBalooListener.moveToThread(&d->mListenerThread);
d->mBalooListener.setDatabaseInterface(&d->mDatabaseInterface);
connect(this, &MusicListenersManager::applicationIsTerminating,
......
......@@ -12,7 +12,7 @@
#include <KLocalizedString>
#if defined Qt5DBus_FOUND && Qt5DBus_FOUND
#if Qt5DBus_FOUND
#include <QDBusConnection>
#include <QDBusMessage>
#include <QDBusPendingCall>
......@@ -46,7 +46,7 @@ public:
PowerManagementInterface::PowerManagementInterface(QObject *parent) : QObject(parent), d(std::make_unique<PowerManagementInterfacePrivate>())
{
#if defined Qt5DBus_FOUND && Qt5DBus_FOUND
#if Qt5DBus_FOUND
auto sessionBus = QDBusConnection::sessionBus();
sessionBus.connect(QStringLiteral("org.freedesktop.PowerManagement.Inhibit"),
......@@ -101,7 +101,7 @@ void PowerManagementInterface::hostSleepInhibitChanged()
void PowerManagementInterface::inhibitDBusCallFinishedPlasmaWorkspace(QDBusPendingCallWatcher *aWatcher)
{
#if defined Qt5DBus_FOUND && Qt5DBus_FOUND
#if Qt5DBus_FOUND
QDBusPendingReply<uint> reply = *aWatcher;
if (reply.isError()) {
} else {
......@@ -116,7 +116,7 @@ void PowerManagementInterface::inhibitDBusCallFinishedPlasmaWorkspace(QDBusPendi
void PowerManagementInterface::uninhibitDBusCallFinishedPlasmaWorkspace(QDBusPendingCallWatcher *aWatcher)
{
#if defined Qt5DBus_FOUND && Qt5DBus_FOUND
#if Qt5DBus_FOUND
QDBusPendingReply<> reply = *aWatcher;
if (reply.isError()) {
qCDebug(orgKdeElisaPowerManagement()) << "PowerManagementInterface::uninhibitDBusCallFinished" << reply.error();
......@@ -131,7 +131,7 @@ void PowerManagementInterface::uninhibitDBusCallFinishedPlasmaWorkspace(QDBusPen
void PowerManagementInterface::inhibitDBusCallFinishedGnomeWorkspace(QDBusPendingCallWatcher *aWatcher)
{
#if defined Qt5DBus_FOUND && Qt5DBus_FOUND
#if Qt5DBus_FOUND
QDBusPendingReply<uint> reply = *aWatcher;
if (reply.isError()) {
qCDebug(orgKdeElisaPowerManagement()) << "PowerManagementInterface::inhibitDBusCallFinishedGnomeWorkspace" << reply.error();
......@@ -147,7 +147,7 @@ void PowerManagementInterface::inhibitDBusCallFinishedGnomeWorkspace(QDBusPendin
void PowerManagementInterface::uninhibitDBusCallFinishedGnomeWorkspace(QDBusPendingCallWatcher *aWatcher)
{
#if defined Qt5DBus_FOUND && Qt5DBus_FOUND
#if Qt5DBus_FOUND
QDBusPendingReply<> reply = *aWatcher;
if (reply.isError()) {
qCDebug(orgKdeElisaPowerManagement()) << "PowerManagementInterface::uninhibitDBusCallFinished" << reply.error();
......@@ -162,7 +162,7 @@ void PowerManagementInterface::uninhibitDBusCallFinishedGnomeWorkspace(QDBusPend
void PowerManagementInterface::inhibitSleepPlasmaWorkspace()
{
#if defined Qt5DBus_FOUND && Qt5DBus_FOUND
#if Qt5DBus_FOUND
auto sessionBus = QDBusConnection::sessionBus();
auto inhibitCall = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.PowerManagement.Inhibit"),
......@@ -183,7 +183,7 @@ void PowerManagementInterface::inhibitSleepPlasmaWorkspace()
void PowerManagementInterface::uninhibitSleepPlasmaWorkspace()
{
#if defined Qt5DBus_FOUND && Qt5DBus_FOUND
#if Qt5DBus_FOUND
auto sessionBus = QDBusConnection::sessionBus();
auto uninhibitCall = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.PowerManagement.Inhibit"),
......@@ -204,7 +204,7 @@ void PowerManagementInterface::uninhibitSleepPlasmaWorkspace()
void PowerManagementInterface::inhibitSleepGnomeWorkspace()
{
#if defined Qt5DBus_FOUND && Qt5DBus_FOUND
#if Qt5DBus_FOUND
auto sessionBus = QDBusConnection::sessionBus();
auto inhibitCall = QDBusMessage::createMethodCall(QStringLiteral("org.gnome.SessionManager"),
......@@ -233,7 +233,7 @@ void PowerManagementInterface::inhibitSleepGnomeWorkspace()
void PowerManagementInterface::uninhibitSleepGnomeWorkspace()
{
#if defined Qt5DBus_FOUND && Qt5DBus_FOUND
#if Qt5DBus_FOUND
auto sessionBus = QDBusConnection::sessionBus();
auto uninhibitCall = QDBusMessage::createMethodCall(QStringLiteral("org.gnome.SessionManager"),
......
......@@ -13,7 +13,7 @@
#include "models/datamodel.h"
#include "models/gridviewproxymodel.h"
#if defined KF5KIO_FOUND && KF5KIO_FOUND
#if KF5KIO_FOUND
#include "models/filebrowsermodel.h"
#include "models/filebrowserproxymodel.h"
#endif
......@@ -290,7 +290,7 @@ void ViewManager::openViewFromData(const ViewParameters &viewParamaters)
{
case FileBrowserModel:
{
#if defined KF5KIO_FOUND && KF5KIO_FOUND
#if KF5KIO_FOUND
newModel = new ::FileBrowserModel;
auto *realProxyModel = new FileBrowserProxyModel;
proxyModel = realProxyModel;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment