Only ask for URL opening confirmation for QR codes
BUG: 484870
This commit is contained in:
@@ -38,7 +38,7 @@ Kirigami.Page {
|
||||
formats: Prison.Format.QRCode | Prison.Format.Aztec
|
||||
onResultChanged: {
|
||||
if (result.text.length > 0 && result.text != scanner.previousText) {
|
||||
RoomManager.resolveResource(result.text, "");
|
||||
RoomManager.resolveResource(result.text, "qr");
|
||||
scanner.previousText = result.text;
|
||||
}
|
||||
root.closeDialog();
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "neochatconnection.h"
|
||||
#include "neochatroom.h"
|
||||
#include "spacehierarchycache.h"
|
||||
#include "urlhelper.h"
|
||||
|
||||
#include <KLocalizedString>
|
||||
#include <QDesktopServices>
|
||||
@@ -124,6 +125,11 @@ void RoomManager::resolveResource(const QString &idOrUri, const QString &action)
|
||||
return;
|
||||
}
|
||||
|
||||
if (uri.type() == Uri::NonMatrix && action == "qr"_ls) {
|
||||
Q_EMIT externalUrl(uri.toUrl());
|
||||
return;
|
||||
}
|
||||
|
||||
if (uri.type() != Uri::NonMatrix) {
|
||||
if (!m_connection) {
|
||||
return;
|
||||
@@ -325,7 +331,7 @@ void RoomManager::knockRoom(Quotient::Connection *account, const QString &roomAl
|
||||
|
||||
bool RoomManager::visitNonMatrix(const QUrl &url)
|
||||
{
|
||||
Q_EMIT externalUrl(url);
|
||||
UrlHelper().openUrl(url);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user