Add KConfigXt configs
This commit is contained in:
@@ -20,7 +20,8 @@ add_executable(neochat
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(neochat PRIVATE ${CMAKE_BINARY_DIR})
|
target_include_directories(neochat PRIVATE ${CMAKE_BINARY_DIR})
|
||||||
target_link_libraries(neochat PRIVATE Qt5::Quick Qt5::Qml Qt5::Gui Qt5::Network Qt5::QuickControls2 KF5::I18n KF5::Kirigami2 KF5::Notifications KF5::ConfigCore KF5::CoreAddons Quotient cmark::cmark)
|
target_link_libraries(neochat PRIVATE Qt5::Quick Qt5::Qml Qt5::Gui Qt5::Network Qt5::QuickControls2 KF5::I18n KF5::Kirigami2 KF5::Notifications KF5::ConfigCore KF5::ConfigGui KF5::CoreAddons Quotient cmark::cmark)
|
||||||
|
kconfig_add_kcfg_files(neochat GENERATE_MOC neochatconfig.kcfgc)
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
target_link_libraries(neochat PRIVATE Qt5::Svg OpenSSL::SSL)
|
target_link_libraries(neochat PRIVATE Qt5::Svg OpenSSL::SSL)
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include "trayicon.h"
|
#include "trayicon.h"
|
||||||
#include "userdirectorylistmodel.h"
|
#include "userdirectorylistmodel.h"
|
||||||
#include "userlistmodel.h"
|
#include "userlistmodel.h"
|
||||||
|
#include "neochatconfig.h"
|
||||||
|
|
||||||
using namespace Quotient;
|
using namespace Quotient;
|
||||||
|
|
||||||
@@ -59,9 +60,11 @@ int main(int argc, char *argv[])
|
|||||||
app.setWindowIcon(QIcon(":/assets/img/icon.png"));
|
app.setWindowIcon(QIcon(":/assets/img/icon.png"));
|
||||||
|
|
||||||
Clipboard clipboard;
|
Clipboard clipboard;
|
||||||
|
NeoChatConfig config;
|
||||||
|
|
||||||
qmlRegisterSingletonInstance("org.kde.neochat", 1, 0, "Controller", &Controller::instance());
|
qmlRegisterSingletonInstance("org.kde.neochat", 1, 0, "Controller", &Controller::instance());
|
||||||
qmlRegisterSingletonInstance("org.kde.neochat", 1, 0, "Clipboard", &clipboard);
|
qmlRegisterSingletonInstance("org.kde.neochat", 1, 0, "Clipboard", &clipboard);
|
||||||
|
qmlRegisterSingletonInstance("org.kde.neochat", 1, 0, "Config", &config);
|
||||||
qmlRegisterType<AccountListModel>("org.kde.neochat", 1, 0, "AccountListModel");
|
qmlRegisterType<AccountListModel>("org.kde.neochat", 1, 0, "AccountListModel");
|
||||||
qmlRegisterType<RoomListModel>("org.kde.neochat", 1, 0, "RoomListModel");
|
qmlRegisterType<RoomListModel>("org.kde.neochat", 1, 0, "RoomListModel");
|
||||||
qmlRegisterType<UserListModel>("org.kde.neochat", 1, 0, "UserListModel");
|
qmlRegisterType<UserListModel>("org.kde.neochat", 1, 0, "UserListModel");
|
||||||
|
|||||||
15
src/neochatconfig.kcfg
Normal file
15
src/neochatconfig.kcfg
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
|
||||||
|
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
|
||||||
|
<group name="General">
|
||||||
|
<entry name="CollapsedSections" type="StringList">
|
||||||
|
<label>Collapsed sections in the room list</label>
|
||||||
|
</entry>
|
||||||
|
<entry name="OpenRoom" type="String">
|
||||||
|
<label>Latest opened room.</label>
|
||||||
|
</entry>
|
||||||
|
</group>
|
||||||
|
</kcfg>
|
||||||
|
|
||||||
8
src/neochatconfig.kcfgc
Normal file
8
src/neochatconfig.kcfgc
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# SPDX-FileCopyrightText: (C) 2020 Carl Schwan <carl@carlschwan.eu>
|
||||||
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
|
File=neochatconfig.kcfg
|
||||||
|
ClassName=NeoChatConfig
|
||||||
|
Mutators=true
|
||||||
|
DefaultValueGetters=true
|
||||||
|
GenerateProperties=true
|
||||||
|
ParentInConstructor=true
|
||||||
Reference in New Issue
Block a user