Skip to content
Snippets Groups Projects
Commit 8d3ab300 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Open url using QDesktopServices from Qml

This fixes some weirdness on some platforms, where Qt.openUrlExternally
does weird stuff.
parent d72eb5eb
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ TextEdit {
timelineManager.setHistoryView(match[1])
chat.positionViewAtIndex(chat.model.idToIndex(match[2]), ListView.Contain)
}
else Qt.openUrlExternally(link)
else timelineManager.openLink(link)
}
MouseArea
{
......
#include "TimelineViewManager.h"
#include <QDesktopServices>
#include <QMetaType>
#include <QPalette>
#include <QQmlContext>
......@@ -219,6 +220,12 @@ TimelineViewManager::openImageOverlay(QString mxcUrl, QString eventId) const
});
}
void
TimelineViewManager::openLink(QString link) const
{
QDesktopServices::openUrl(link);
}
void
TimelineViewManager::updateReadReceipts(const QString &room_id,
const std::vector<QString> &event_ids)
......
......@@ -47,6 +47,8 @@ public:
Q_INVOKABLE QString userPresence(QString id) const;
Q_INVOKABLE QString userStatus(QString id) const;
Q_INVOKABLE void openLink(QString link) const;
signals:
void clearRoomMessageCount(QString roomid);
void updateRoomsLastMessage(QString roomid, const DescInfo &info);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment