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