Use modules.
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
#include <QtNetwork/QNetworkReply>
|
||||
|
||||
Controller::Controller(QObject* parent) : QObject(parent) {
|
||||
tray->setIcon(QIcon(":/asset/img/icon.png"));
|
||||
tray->setIcon(QIcon(":/assets/img/icon.png"));
|
||||
tray->setToolTip("Spectral");
|
||||
connect(tray, &QSystemTrayIcon::activated,
|
||||
[this](QSystemTrayIcon::ActivationReason r) {
|
||||
|
||||
13
src/main.cpp
13
src/main.cpp
@@ -8,10 +8,10 @@
|
||||
#include "emojimodel.h"
|
||||
#include "imageitem.h"
|
||||
#include "imageprovider.h"
|
||||
#include "spectralroom.h"
|
||||
#include "messageeventmodel.h"
|
||||
#include "room.h"
|
||||
#include "roomlistmodel.h"
|
||||
#include "spectralroom.h"
|
||||
#include "userlistmodel.h"
|
||||
|
||||
#include "csapi/joining.h"
|
||||
@@ -47,11 +47,18 @@ int main(int argc, char *argv[]) {
|
||||
qmlRegisterUncreatableType<RoomMessageEvent>("Spectral", 0, 1,
|
||||
"RoomMessageEvent", "ENUM");
|
||||
qmlRegisterUncreatableType<RoomType>("Spectral", 0, 1, "RoomType", "ENUM");
|
||||
qmlRegisterSingletonType(QUrl("qrc:/qml/SpectralSettings.qml"),
|
||||
"Spectral.Settings", 0, 1, "MSettings");
|
||||
|
||||
qmlRegisterSingletonType(QUrl("qrc:/imports/Spectral/Setting/Setting.qml"),
|
||||
"Spectral.Setting", 0, 1, "MSettings");
|
||||
qmlRegisterSingletonType(
|
||||
QUrl("qrc:/imports/Spectral/Font/MaterialFont.qml"), "Spectral.Font",
|
||||
0, 1, "MaterialFont");
|
||||
qmlRegisterModule("qrc:/qml/component", 2, 0);
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
|
||||
engine.addImportPath("qrc:/imports");
|
||||
|
||||
ImageProvider *m_provider = new ImageProvider();
|
||||
|
||||
engine.rootContext()->setContextProperty("imageProvider", m_provider);
|
||||
|
||||
@@ -87,10 +87,12 @@ void MessageEventModel::setRoom(SpectralRoom* room) {
|
||||
{AboveEventTypeRole, AboveAuthorRole,
|
||||
AboveSectionRole, AboveTimeRole});
|
||||
}
|
||||
|
||||
for (auto i = m_currentRoom->maxTimelineIndex() - biggest;
|
||||
i <= m_currentRoom->maxTimelineIndex() - lowest; ++i)
|
||||
refreshLastUserEvents(i);
|
||||
});
|
||||
},
|
||||
Qt::QueuedConnection);
|
||||
connect(m_currentRoom, &Room::pendingEventAboutToAdd, this,
|
||||
[this] { beginInsertRows({}, 0, 0); });
|
||||
connect(m_currentRoom, &Room::pendingEventAdded, this,
|
||||
|
||||
Reference in New Issue
Block a user