Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 64520fc5 authored by Marco Martin's avatar Marco Martin

use KDeclarative to access i18n()

parent 4374ead7
......@@ -34,6 +34,7 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Config
DocTools
Package
Declarative
OPTIONAL_COMPONENTS
KHtml
QUIET
......
......@@ -15,6 +15,7 @@ target_link_libraries(systemsettings_sidebar_mode systemsettingsview
KF5::Service
KF5::XmlGui
KF5::Package
KF5::Declarative
Qt5::Qml
Qt5::Quick
Qt5::QuickWidgets
......
......@@ -41,6 +41,7 @@
#include <KActionCollection>
#include <KPackage/Package>
#include <KPackage/PackageLoader>
#include <KDeclarative/KDeclarative>
#include <QStandardItemModel>
#include <QQuickWidget>
#include <QQmlEngine>
......@@ -62,6 +63,7 @@ public:
QStandardItemModel * subCategoryModel;
QWidget * mainWidget;
QHBoxLayout * mainLayout;
KDeclarative::KDeclarative kdeclarative;
MenuProxyModel * proxyModel;
KAboutData * aboutIcon;
ModuleView * moduleView;
......@@ -232,6 +234,10 @@ void SidebarMode::initWidget()
d->quickWidget->engine()->rootContext()->setContextProperty("systemsettings", this);
d->package = KPackage::PackageLoader::self()->loadPackage("KPackage/GenericQML");
d->package.setPath(QStringLiteral("org.kde.systemsettings.sidebar"));
d->kdeclarative.setDeclarativeEngine(d->quickWidget->engine());
d->kdeclarative.setupBindings();
d->quickWidget->setSource(d->package.filePath("mainscript"));
//FIXME
d->quickWidget->setFixedWidth(240);
......
......@@ -26,6 +26,7 @@ Kirigami.PageRow {
id: root
initialPage: mainColumn
Component.onCompleted: searchField.forceActiveFocus()
Kirigami.ScrollablePage {
id: mainColumn
header: Item {
......@@ -54,6 +55,7 @@ Kirigami.PageRow {
}
}
QtControls.TextField {
id: searchField
focus: true
Layout.fillWidth: true
placeholderText: i18n("Search...")
......
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