xdg-open doesn't seem to work anymore on SFOS 4.4

This commit is contained in:
Sebastian Wolf 2022-04-24 20:55:06 +02:00
parent 1f589cc2da
commit 679426abc1
No known key found for this signature in database
GPG key ID: CEA9522B5F38A90A
3 changed files with 9 additions and 8 deletions

View file

@ -40,6 +40,13 @@ ApplicationWindow
}
}
Connections {
target: tdLibWrapper
onOpenFileExternally: {
Qt.openUrlExternally(filePath);
}
}
AppNotification {
id: appNotification
parent: pageStack.currentPage

View file

@ -1511,14 +1511,7 @@ void TDLibWrapper::copyFileToDownloads(const QString &filePath, bool openAfterCo
void TDLibWrapper::openFileOnDevice(const QString &filePath)
{
LOG("Open file on device:" << filePath);
QStringList argumentsList;
argumentsList.append(filePath);
bool successfullyStarted = QProcess::startDetached("xdg-open", argumentsList);
if (successfullyStarted) {
LOG("Successfully opened file " << filePath);
} else {
LOG("Error opening file " << filePath);
}
emit openFileExternally(filePath);
}
void TDLibWrapper::controlScreenSaver(bool enabled)

View file

@ -311,6 +311,7 @@ signals:
void messageInteractionInfoUpdated(qlonglong chatId, qlonglong messageId, const QVariantMap &updatedInfo);
void okReceived(const QString &request);
void sessionsReceived(const QVariantList &sessions);
void openFileExternally(const QString &filePath);
public slots:
void handleVersionDetected(const QString &version);