mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-24 23:28:09 +00:00
feat(src/app/App): add a convertUrlToLocalPath function
This commit is contained in:
parent
be46f8cf6c
commit
65bfcb984b
6 changed files with 11 additions and 10 deletions
|
|
@ -261,6 +261,10 @@ void App::smartShowWindow (QQuickWindow *window) {
|
|||
window->requestActivate();
|
||||
}
|
||||
|
||||
QString App::convertUrlToLocalPath (const QUrl &url) {
|
||||
return QDir::toNativeSeparators(url.toLocalFile());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool App::hasFocus () const {
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@ public:
|
|||
|
||||
Q_INVOKABLE static void smartShowWindow (QQuickWindow *window);
|
||||
|
||||
Q_INVOKABLE static QString convertUrlToLocalPath (const QUrl &url);
|
||||
|
||||
public slots:
|
||||
void quit ();
|
||||
|
||||
|
|
|
|||
|
|
@ -428,12 +428,7 @@ void ChatModel::downloadFile (int id, const QString &downloadPath) {
|
|||
return;
|
||||
}
|
||||
|
||||
message->setFileTransferFilepath(
|
||||
::Utils::qStringToLinphoneString(downloadPath.startsWith("file://")
|
||||
? downloadPath.mid(sizeof("file://") - 1)
|
||||
: downloadPath
|
||||
)
|
||||
);
|
||||
message->setFileTransferFilepath(::Utils::qStringToLinphoneString(downloadPath));
|
||||
message->setListener(mMessageHandlers);
|
||||
|
||||
if (message->downloadFile() < 0)
|
||||
|
|
|
|||
|
|
@ -98,6 +98,6 @@ int main (int argc, char *argv[]) {
|
|||
// ---------------------------------------------------------------------------
|
||||
|
||||
app.initContentApp();
|
||||
qInfo() << "Running app...";
|
||||
qInfo() << QStringLiteral("Running app...");
|
||||
return app.exec();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ Row {
|
|||
selectExisting: false
|
||||
title: qsTr('downloadFileTitle')
|
||||
|
||||
onAccepted: proxyModel.downloadFile(index, fileUrl)
|
||||
onAccepted: proxyModel.downloadFile(index, App.convertUrlToLocalPath(fileUrl))
|
||||
}
|
||||
|
||||
anchors.fill: parent
|
||||
|
|
|
|||
|
|
@ -117,8 +117,8 @@ function cancel () {
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
function setAvatar (path) {
|
||||
contactEdit._vcard.avatar = path.match(/^(?:file:\/\/)?(.*)$/)[1]
|
||||
function setAvatar (url) {
|
||||
contactEdit._vcard.avatar = Linphone.App.convertUrlToLocalPath(url)
|
||||
}
|
||||
|
||||
function setUsername (username) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue