Fix crashing when logging out.

That's a complex issue. Yay!
This commit is contained in:
Black Hat
2018-09-09 21:13:43 +08:00
parent 7c426e254b
commit 5c55856df3
8 changed files with 105 additions and 132 deletions

View File

@@ -2,70 +2,37 @@ import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.2
import QtQuick.Layouts 1.3
import Matrique 0.1
import Matrique.Settings 0.1
import "component"
import "form"
Page {
// Page {
// id: accountForm
// parent: null
// padding: 64
// ColumnLayout {
// RowLayout {
// Layout.preferredHeight: 60
// ImageStatus {
// Layout.preferredWidth: height
// Layout.fillHeight: true
// source: matriqueController.isLogin ? connection.localUser && connection.localUser.avatarUrl ? "image://mxc/" + connection.localUser.avatarUrl : "" : "qrc:/asset/img/avatar.png"
// displayText: matriqueController.isLogin && connection.localUser.displayName ? connection.localUser.displayName : ""
// }
// ColumnLayout {
// Layout.fillWidth: true
// Layout.fillHeight: true
// Label {
// font.pointSize: 18
// text: matriqueController.isLogin ? connection.localUser.displayName : ""
// }
// Label {
// font.pointSize: 12
// text: matriqueController.isLogin ? connection.localUser.id : ""
// }
// }
// }
// Button {
// text: "Logout"
// highlighted: true
// onClicked: {
// matriqueController.logout()
// Qt.quit()
// }
// }
// }
// }
Page{
property alias listModel: accountSettingsListView.model
Page {
id: accountForm
parent: null
// Button {
// flat: true
// highlighted: true
// text: "Login"
padding: 64
// onClicked: stackView.push(loginPage)
// }
ListView {
anchors.fill: parent
id: accountSettingsListView
spacing: 0
delegate: RowLayout{
Label {
text: accountID
}
ItemDelegate {
text: "Logout"
onClicked: matriqueController.logout(connection);
}
}
}
}
Page {