Commit a3c1fecd authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile without kf5 deprecated methods

parent 0b6ee1f2
......@@ -29,6 +29,7 @@ find_package(KF5 REQUIRED COMPONENTS
)
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000)
endif()
add_subdirectory(src)
......
......@@ -34,7 +34,6 @@
#include "logging.h"
K_PLUGIN_FACTORY(KCMCronFactory, registerPlugin<KCMCron>();)
K_EXPORT_PLUGIN(KCMCronFactory("kcron"))
class KCMCronPrivate {
public:
......
......@@ -10,7 +10,7 @@
***************************************************************************/
#include "taskEditorDialog.h"
#include "kwidgetsaddons_version.h"
#include <QLabel>
#include <QLayout>
......@@ -552,12 +552,17 @@ QGroupBox* TaskEditorDialog::createHoursGroup(QWidget* main) {
void TaskEditorDialog::setupTitleWidget(const QString& comment, KTitleWidget::MessageType messageType) {
titleWidget->setComment(comment, messageType);
#if KWIDGETSADDONS_VERSION < QT_VERSION_CHECK(5, 63, 0)
if (messageType == KTitleWidget::ErrorMessage)
titleWidget->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-error")), KTitleWidget::ImageRight);
else
titleWidget->setPixmap(QIcon::fromTheme(QStringLiteral("system-run")), KTitleWidget::ImageRight);
#else
if (messageType == KTitleWidget::ErrorMessage)
titleWidget->setIcon(QIcon::fromTheme(QStringLiteral("dialog-error")), KTitleWidget::ImageRight);
else
titleWidget->setIcon(QIcon::fromTheme(QStringLiteral("system-run")), KTitleWidget::ImageRight);
#endif
}
void TaskEditorDialog::slotEnabledChanged() {
......
......@@ -10,7 +10,7 @@
***************************************************************************/
#include "variableEditorDialog.h"
#include "kwidgetsaddons_version.h"
#include <QLabel>
#include <QComboBox>
#include <QGridLayout>
......@@ -153,14 +153,25 @@ void VariableEditorDialog::setupTitleWidget(const QString& comment, KTitleWidget
//krazy:exclude=doublequote_chars
if (comment.isEmpty()) {
titleWidget->setComment(i18n("<i>This variable will be used by scheduled tasks.</i>"));
#if KWIDGETSADDONS_VERSION < QT_VERSION_CHECK(5, 63, 0)
titleWidget->setPixmap(QIcon::fromTheme(QStringLiteral("text-plain")), KTitleWidget::ImageRight);
#else
titleWidget->setIcon(QIcon::fromTheme(QStringLiteral("text-plain")), KTitleWidget::ImageRight);
#endif
}
else {
titleWidget->setComment(comment, messageType);
if (messageType == KTitleWidget::ErrorMessage)
#if KWIDGETSADDONS_VERSION < QT_VERSION_CHECK(5, 63, 0)
if (messageType == KTitleWidget::ErrorMessage)
titleWidget->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-error")), KTitleWidget::ImageRight);
else
titleWidget->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-information")), KTitleWidget::ImageRight);
#else
if (messageType == KTitleWidget::ErrorMessage)
titleWidget->setIcon(QIcon::fromTheme(QStringLiteral("dialog-error")), KTitleWidget::ImageRight);
else
titleWidget->setIcon(QIcon::fromTheme(QStringLiteral("dialog-information")), KTitleWidget::ImageRight);
#endif
}
}
......
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