Skip to content

Commit

Permalink
Bump KF and/or QT versions in ecm_set_disabled_deprecation_versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Montel committed Nov 20, 2024
1 parent 1bef7cc commit 46e7027
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ ecm_find_qmlmodule(Qt.labs.platform 1.1)
add_definitions(-DTRANSLATION_DOMAIN=\"filelight\")

ecm_set_disabled_deprecation_versions(QT 6.8.0
KF 6.7
KF 6.8.0
)
add_definitions(-DQT_NO_CONTEXTLESS_CONNECT)
include_directories(src)
Expand Down
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ target_link_libraries(filelight
Qt6::QuickControls2
filelightInternal
)
if(TARGET KF6::I18nQml)
target_link_libraries(filelight
KF6::I18nQml
)
endif()

if(APPLE)
set_target_properties(filelight PROPERTIES
Expand Down
9 changes: 8 additions & 1 deletion src/mainContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
***********************************************************************/

#include "mainContext.h"

#include "ki18n_version.h"
#if KI18N_VERSION >= QT_VERSION_CHECK(6, 8, 0)
#include <KLocalizedQmlContext>
#endif
#include <KAboutData>
#include <KIO/Global> // upUrl
#include <KLocalizedString>
Expand Down Expand Up @@ -54,7 +57,11 @@ MainContext::MainContext(QObject *parent)

auto engine = new QQmlApplicationEngine(this);

#if KI18N_VERSION < QT_VERSION_CHECK(6, 8, 0)
static auto l10nContext = new KLocalizedContext(engine);
#else
static auto l10nContext = new KLocalizedQmlContext(engine);
#endif
l10nContext->setTranslationDomain(QStringLiteral(TRANSLATION_DOMAIN));
engine->rootContext()->setContextObject(l10nContext);

Expand Down

0 comments on commit 46e7027

Please sign in to comment.