Enable lazy loading by default.

Also fixes undefined error when not logged in.
This commit is contained in:
Black Hat 2018-08-19 20:45:40 +08:00
parent cfe34e5303
commit 4d97fe6901
9 changed files with 24 additions and 19 deletions

BIN
asset/img/icon.icns Normal file

Binary file not shown.

BIN
asset/img/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -46,6 +46,24 @@ unix:target.path = $$PREFIX/bin
win32:target.path = $$PREFIX
!isEmpty(target.path): INSTALLS += target
unix:!mac {
metainfo.files = $$PWD/org.eu.encom.matrique.appdata.xml
metainfo.path = $$PREFIX/share/metainfo
desktop.files = $$PWD/org.eu.encom.matrique.desktop
desktop.path = $$PREFIX/share/applications
icons.files = $$PWD/icons/org.eu.encom.matrique.png
icons.path = $$PREFIX/share/icons/hicolor/128x128/apps
INSTALLS += metainfo desktop icons
}
win32 {
RC_ICONS = asset/img/icon.ico
}
mac {
ICON = asset/img/icon.icns
}
DISTFILES += \
ChatForm.qml \
LoginForm.qml \
@ -69,13 +87,3 @@ HEADERS += \
src/imageproviderconnection.h \
src/emojimodel.h \
src/matriqueroom.h
unix:!mac {
metainfo.files = $$PWD/org.eu.encom.matrique.appdata.xml
metainfo.path = $$PREFIX/share/metainfo
desktop.files = $$PWD/org.eu.encom.matrique.desktop
desktop.path = $$PREFIX/share/applications
icons.files = $$PWD/icons/org.eu.encom.matrique.png
icons.path = $$PREFIX/share/icons/hicolor/128x128/apps
INSTALLS += metainfo desktop mime icons
}

View File

@ -6,15 +6,13 @@ import Matrique 0.1
import "qrc:/qml/form"
Page {
property var connection
property alias connection: roomListModel.connection
id: page
RoomListModel {
id: roomListModel
connection: page.connection
onRoomAdded: setting.lazyLoad ? {} : room.getPreviousContent(20)
onNewMessage: window.active ? {} : matriqueController.showMessage(roomName, content, icon)
}

View File

@ -240,6 +240,4 @@ Item {
}
}
}
onCurrentRoomChanged: setting.lazyLoad && currentRoom && !currentRoom.timelineSize ? currentRoom.getPreviousContent(20) : {}
}

View File

@ -10,6 +10,7 @@ Page {
Switch {
id: lazyLoadSwitch
text: "Lazy load at initial sync"
checked: true
}
Switch {
id: asyncMessageDelegateSwitch

View File

@ -73,7 +73,7 @@ ApplicationWindow {
parent: null
connection: matriqueController.isLogin ? window.connection : undefined
connection: matriqueController.isLogin ? window.connection : null
}
Setting {

View File

@ -32,5 +32,7 @@
<file>qml/component/EmojiPicker.qml</file>
<file>qml/component/EmojiButton.qml</file>
<file>qml/component/AutoImage.qml</file>
<file>asset/img/icon.ico</file>
<file>asset/img/icon.icns</file>
</qresource>
</RCC>

View File

@ -14,9 +14,7 @@ RoomListModel::RoomListModel(QObject* parent) : QAbstractListModel(parent) {}
RoomListModel::~RoomListModel() {}
void RoomListModel::setConnection(Connection* connection) {
Q_ASSERT(connection);
if (connection == m_connection) return;
if (!connection && connection == m_connection) return;
using QMatrixClient::Room;
m_connection = connection;