[knotification] compile without deprecated methods
ClosedPublic

Authored by mlaurent on Mar 1 2019, 9:36 PM.

Details

Summary

compile without deprecated method

Test Plan

autotest ok

Diff Detail

Repository
R289 KNotifications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mlaurent created this revision.Mar 1 2019, 9:36 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 1 2019, 9:36 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
mlaurent requested review of this revision.Mar 1 2019, 9:36 PM
dfaure accepted this revision.Mar 2 2019, 11:02 PM
This revision is now accepted and ready to land.Mar 2 2019, 11:02 PM
This revision was automatically updated to reflect the committed changes.

This change has broken builds on macOS.
Please see https://binary-factory.kde.org/view/MacOS/job/Kig_Nightly_macos/407/console

Whilst not documented in the Qt Documentation, the qmacfunctions.h header (which is what is included by #include <QtMac>) has the following:

#ifdef Q_OS_OSX
#if QT_DEPRECATED_SINCE(5, 12)
QT_DEPRECATED_X("Use NSApp.dockTile.badgeLabel") Q_MACEXTRAS_EXPORT void setBadgeLabelText(const QString &text);
QT_DEPRECATED_X("Use NSApp.dockTile.badgeLabel") Q_MACEXTRAS_EXPORT QString badgeLabelText();

QT_DEPRECATED_X("Use QPixmap::toImage, QImage::toCGImage, and -[NSImage initWithCGImage:size:]")
Q_MACEXTRAS_EXPORT NSImage *toNSImage(const QPixmap &pixmap);
#endif

Thoughts on the best way forward for macOS builds?

This change due to being in a Framework has KOed all Binary Factory builds for macOS.

aacid added a subscriber: aacid.Apr 28 2019, 4:28 PM

This change has broken builds on macOS.
Please see https://binary-factory.kde.org/view/MacOS/job/Kig_Nightly_macos/407/console

Whilst not documented in the Qt Documentation, the qmacfunctions.h header (which is what is included by #include <QtMac>) has the following:

#ifdef Q_OS_OSX
 #if QT_DEPRECATED_SINCE(5, 12)
 QT_DEPRECATED_X("Use NSApp.dockTile.badgeLabel") Q_MACEXTRAS_EXPORT void setBadgeLabelText(const QString &text);
 QT_DEPRECATED_X("Use NSApp.dockTile.badgeLabel") Q_MACEXTRAS_EXPORT QString badgeLabelText();
 
 QT_DEPRECATED_X("Use QPixmap::toImage, QImage::toCGImage, and -[NSImage initWithCGImage:size:]")
 Q_MACEXTRAS_EXPORT NSImage *toNSImage(const QPixmap &pixmap);
 #endif

Thoughts on the best way forward for macOS builds?

i guess add an
#undef QT_DISABLE_DEPRECATED_BEFORE
inside the
#ifdef Q_OS_MACOS
of src/kstatusnotifieritem.cpp would get us going?

+1 with albert idea.
Or in CMakeLists.txt
if (NOT APPLE)

add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00)

endif()

As I can't compile against MacOsX we can exclude it. It will fix when we will switch to qt6 by os dev.

I'm fine with either fix, any objection to that being committed directly?

"I'm fine with either fix, any objection to that being committed directly?"
no problem for me

aacid added a comment.Apr 30 2019, 9:40 PM

I'm fine with either fix, any objection to that being committed directly?

Sorry if you were waiting for me, sure just go ahead

dfaure added a comment.May 8 2019, 8:39 AM

OK, it looks like everyone is waiting on everyone else in this discussion.

Done now: https://commits.kde.org/knotifications/adc20218571941d19281ad81520aec62e195b355