Remove utils.sendFile(), useless wrapper

This commit is contained in:
miruka 2020-08-03 01:05:19 -04:00
parent 09ae0d7776
commit 040e966d27
3 changed files with 6 additions and 10 deletions

View File

@ -17,10 +17,10 @@ HFileDialogOpener {
for (const file of files) {
const path = Qt.resolvedUrl(file).replace(/^file:/, "")
utils.sendFile(userId, roomId, path, () => {
py.callClientCoro(userId, "send_file", [roomId, path], () => {
if (destroyWhenDone) destroy()
},
(type, args, error, traceback) => {
}, (type, args, error, traceback) => {
console.error(`python:\n${traceback}`)
if (destroyWhenDone) destroy()
})

View File

@ -25,7 +25,9 @@ HColumnPopup {
text: qsTr("Send")
icon.name: "confirm-uploading-file"
onClicked: {
utils.sendFile(popup.userId, popup.roomId, filePath)
py.callClientCoro(
popup.userId, "send_file", [popup.roomId, filePath],
)
popup.close()
}
}

View File

@ -498,12 +498,6 @@ QtObject {
}
function sendFile(userId, roomId, path, onSuccess, onError) {
py.callClientCoro(
userId, "send_file", [roomId, path], onSuccess, onError,
)
}
function sumChildrenImplicitWidths(visibleChildren, spacing=0) {
let sum = 0