Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support building without MCE support. #14

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/lib.pri
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ packagesExist(mlite$${QT_MAJOR_VERSION}) {
} else {
warning("mlite not available. Some functionality may not work as expected.")
}
PKGCONFIG += mlocale$${QT_MAJOR_VERSION} mce

packagesExist(mce) {
PKGCONFIG += mce
DEFINES += HAS_MCE
} else {
warning("mce not available. Some functionality may not work as expected.")
}

PKGCONFIG += mlocale$${QT_MAJOR_VERSION}
LIBS += -lphonenumber


Expand Down
8 changes: 6 additions & 2 deletions lib/seasidecache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@

#include <mlocale.h>

#ifdef HAS_MCE
#include <mce/dbus-names.h>
#include <mce/mode-names.h>
#endif
#include <phonenumbers/phonenumberutil.h>

QTVERSIT_USE_NAMESPACE
Expand Down Expand Up @@ -546,7 +548,7 @@ SeasideCache::SeasideCache()
this, &SeasideCache::displayLabelOrderChanged);
connect(config, &CacheConfiguration::sortPropertyChanged,
this, &SeasideCache::sortPropertyChanged);

#ifdef HAS_MCE
// Is this a GUI application? If so, we want to defer some processing when the display is off
if (qApp && qApp->property("applicationDisplayName").isValid()) {
// Only QGuiApplication has this property
Expand All @@ -555,7 +557,7 @@ SeasideCache::SeasideCache()
qWarning() << "Unable to connect to MCE displayStatusChanged signal";
}
}

#endif
QContactManager *mgr(manager());

// The contactsPresenceChanged signal is not exported by QContactManager, so we
Expand Down Expand Up @@ -3215,6 +3217,7 @@ void SeasideCache::sortPropertyChanged(const QString &sortProperty)

void SeasideCache::displayStatusChanged(const QString &status)
{
#ifdef HAS_MCE
const bool off = (status == QLatin1String(MCE_DISPLAY_OFF_STRING));
if (m_displayOff != off) {
m_displayOff = off;
Expand All @@ -3224,6 +3227,7 @@ void SeasideCache::displayStatusChanged(const QString &status)
requestUpdate();
}
}
#endif
}

int SeasideCache::importContacts(const QString &path)
Expand Down