File: main.cpp

package info (click to toggle)
neochat 25.04.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,424 kB
  • sloc: cpp: 27,289; xml: 704; python: 263; makefile: 12; sh: 1
file content (30 lines) | stat: -rw-r--r-- 1,024 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// SPDX-FileCopyrightText: 2024 James Graham <james.h.graham@protonmail.com>
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL

#include <QApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>

#include <KLocalizedString>

#include "memtesttimelinemodel.h"
#include "models/messagefiltermodel.h"

using namespace Qt::StringLiterals;

int main(int argc, char **argv)
{
    QApplication app(argc, argv);

    KLocalizedString::setApplicationDomain(QByteArrayLiteral("neochat"));

    QQmlApplicationEngine engine;
    engine.loadFromModule("org.kde.neochat.timeline-memtest", "Main");

    MemTestTimelineModel *memTestTimelineModel = new MemTestTimelineModel;
    MessageFilterModel *messageFilterModel = new MessageFilterModel(nullptr, memTestTimelineModel);
    engine.rootContext()->setContextProperty(u"memTestTimelineModel"_s, memTestTimelineModel);
    engine.rootContext()->setContextProperty(u"messageFilterModel"_s, messageFilterModel);

    return app.exec();
}