support kdeclarative both <5.45 and >=5.45

pull/5/head
Michail Vourlakos 6 years ago
parent 86a7eddba5
commit 0b07b58abc

@ -44,6 +44,12 @@ if(X11_FOUND AND XCB_XCB_FOUND)
set(HAVE_X11 ON)
endif()
string(REGEX MATCH "\\.([^]]+)\\." KF5_VERSION_MINOR ${KF5_VERSION})
string(REGEX REPLACE "\\." "" KF5_VERSION_MINOR ${KF5_VERSION_MINOR})
message(STATUS "KF5 VERSION : ${KF5_VERSION}")
message(STATUS "KF5 VERSION MINOR : ${KF5_VERSION_MINOR}")
include(ECMQMLModules)
ecm_find_qmlmodule(QtQuick 2.7)
ecm_find_qmlmodule(QtQuick.Layouts 1.3)

@ -3,6 +3,8 @@
#cmakedefine01 HAVE_X11
#cmakedefine KF5_VERSION_MINOR @KF5_VERSION_MINOR@
#cmakedefine VERSION "@VERSION@"
#cmakedefine WEBSITE "@WEBSITE@"

@ -21,6 +21,7 @@
#include "infoview.h"
// local
#include <config-latte.h>
#include "wm/abstractwindowinterface.h"
#include "view/panelshadows_p.h"
@ -81,9 +82,13 @@ void InfoView::init()
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(engine());
kdeclarative.setTranslationDomain(QStringLiteral("latte-dock"));
#if KF5_VERSION_MINOR >= 45
kdeclarative.setupContext();
kdeclarative.setupEngine(engine());
// kdeclarative.setupBindings();
#else
kdeclarative.setupBindings();
#endif
auto source = QUrl::fromLocalFile(m_corona->kPackage().filePath("infoviewui"));
setSource(source);

@ -21,6 +21,7 @@
#include "primaryconfigview.h"
// local
#include <config-latte.h>
#include "secondaryconfigview.h"
#include "../panelshadows_p.h"
#include "../view.h"
@ -152,9 +153,12 @@ void PrimaryConfigView::init()
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(engine());
kdeclarative.setTranslationDomain(QStringLiteral("latte-dock"));
#if KF5_VERSION_MINOR >= 45
kdeclarative.setupContext();
kdeclarative.setupEngine(engine());
//kdeclarative.setupBindings();
#else
kdeclarative.setupBindings();
#endif
QByteArray tempFilePath = "lattedockconfigurationui";

@ -20,6 +20,7 @@
#include "secondaryconfigview.h"
// local
#include <config-latte.h>
#include "primaryconfigview.h"
#include "../panelshadows_p.h"
#include "../view.h"
@ -121,9 +122,12 @@ void SecondaryConfigView::init()
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(engine());
kdeclarative.setTranslationDomain(QStringLiteral("latte-dock"));
#if KF5_VERSION_MINOR >= 45
kdeclarative.setupContext();
kdeclarative.setupEngine(engine());
//kdeclarative.setupBindings();
#else
kdeclarative.setupBindings();
#endif
QByteArray tempFilePath = "lattedocksecondaryconfigurationui";

Loading…
Cancel
Save