Compare commits

..

1 Commits

Author SHA1 Message Date
Tobias Fella
097096590b Fix QML warning 2023-08-30 00:06:41 +02:00
8 changed files with 20 additions and 20 deletions

View File

@@ -145,7 +145,7 @@ void CompletionModel::updateCompletion()
m_filterModel->setFullText(m_fullText);
m_filterModel->setFilterText(m_text);
m_filterModel->invalidate();
} else if (text().startsWith(QLatin1Char(':')) && text().size() > 1 && !text()[1].isUpper()
} else if (text().startsWith(QLatin1Char(':')) && !text()[1].isUpper()
&& (m_fullText.indexOf(QLatin1Char(':'), 1) == -1
|| (m_fullText.indexOf(QLatin1Char(' ')) != -1 && m_fullText.indexOf(QLatin1Char(':'), 1) > m_fullText.indexOf(QLatin1Char(' '), 1)))) {
m_filterModel->setSourceModel(m_emojiModel);

View File

@@ -31,15 +31,15 @@ Kirigami.Page {
imageDoc.crop(selectionTool.selectionX / ratioX, selectionTool.selectionY / ratioY, selectionTool.selectionWidth / ratioX, selectionTool.selectionHeight / ratioY);
}
actions: [
Kirigami.Action {
actions {
left: Kirigami.Action {
id: undoAction
text: i18nc("@action:button Undo modification", "Undo")
icon.name: "edit-undo"
onTriggered: imageDoc.undo();
visible: imageDoc.edited
},
Kirigami.Action {
}
main: Kirigami.Action {
id: okAction
text: i18nc("@action:button Accept image modification", "Accept")
icon.name: "dialog-ok"
@@ -54,7 +54,7 @@ Kirigami.Page {
}
}
}
]
}

View File

@@ -122,10 +122,10 @@ Kirigami.ScrollablePage {
title: i18nc("@title:window", "Add server")
onOpened: if (!serverUrlField.isValidServer && !opened) {
onSheetOpenChanged: if (!serverUrlField.isValidServer && !sheetOpen) {
serverField.currentIndex = 0
server = serverField.currentValue
} else if (opened) {
} else if (sheetOpen) {
serverUrlField.forceActiveFocus()
}

View File

@@ -40,7 +40,7 @@ RowLayout {
text: i18n("Create a Space")
icon.name: "list-add"
onTriggered: {
let dialog = createSpaceDialog.createObject(applicationWindow().overlay);
let dialog = createSpaceDialog.createObject(root.overlay);
dialog.open()
}
}

View File

@@ -161,7 +161,7 @@ Kirigami.Page {
ItemSelectionModel {
id: itemSelection
model: root.roomListModel
onCurrentChanged: listView.currentIndex = sortFilterRoomListModel.mapFromSource(current).row
onCurrentChanged: (current) => listView.currentIndex = sortFilterRoomListModel.mapFromSource(current).row
}
model: SortFilterRoomListModel {

View File

@@ -27,13 +27,13 @@ Kirigami.Page {
focus: true
padding: 0
actions: [
Kirigami.Action {
actions {
main: Kirigami.Action {
visible: Kirigami.Settings.isMobile || !applicationWindow().pageStack.wideMode
icon.name: "view-right-new"
onTriggered: applicationWindow().openRoomDrawer()
}
]
}
KeyNavigation.left: pageStack.get(0)

View File

@@ -31,12 +31,12 @@ Kirigami.ScrollablePage {
title: roomInformation.title
actions: [
Kirigami.Action {
actions {
main: Kirigami.Action {
icon.name: "settings-configure"
onTriggered: applicationWindow().pageStack.pushDialogLayer('qrc:/Categories.qml', {room: root.room}, { title: i18n("Room Settings") })
}
]
}
RoomInformation {
id: roomInformation

View File

@@ -21,9 +21,9 @@ Registration::Registration()
{
auto server = new QTcpServer(this);
server->listen(QHostAddress("127.0.0.1"_ls), 20847);
connect(server, &QTcpServer::newConnection, this, [this, server]() {
connect(server, &QTcpServer::newConnection, this, [=]() {
auto conn = server->nextPendingConnection();
connect(conn, &QIODevice::readyRead, this, [this, conn]() {
connect(conn, &QIODevice::readyRead, this, [=]() {
auto code =
"HTTP/1.0 200\nContent-type: text/html\n\n<html><head><script src=\"https://www.google.com/recaptcha/api.js\" async defer></script></head><body style=\"background: #00000000\"><center><div class=\"g-recaptcha\" data-sitekey=\"%1\"></div></center></body></html>"_ls
.arg(m_recaptchaSiteKey);
@@ -86,7 +86,7 @@ void Registration::registerAccount()
};
}
auto job = m_connection->callApi<NeoChatRegisterJob>("user"_ls, authData, m_username, m_password, QString(), QString(), true);
connect(job, &BaseJob::result, this, [this, job]() {
connect(job, &BaseJob::result, this, [=]() {
if (job->status() == BaseJob::Success) {
setNextStep("loading"_ls);
auto connection = new NeoChatConnection(this);
@@ -332,7 +332,7 @@ void Registration::registerEmail()
data.sendAttempt = 0;
auto job = m_connection->callApi<RequestTokenToRegisterEmailJob>(data);
connect(job, &BaseJob::finished, this, [this, job]() {
connect(job, &BaseJob::finished, this, [=]() {
m_sid = job->jsonData()["sid"_ls].toString();
});
}