mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 11:29:50 +02:00
Add hifi:// clickable links to chat
The handling also needed to be updated to handle domains correctly - just routing to goToURL instead of gTo fixes this.
This commit is contained in:
parent
6762d4d63c
commit
fdaa42b219
2 changed files with 2 additions and 4 deletions
|
@ -984,9 +984,7 @@ void Menu::goToUser(const QString& user) {
|
||||||
/// Open a url, shortcutting any "hifi" scheme URLs to the local application.
|
/// Open a url, shortcutting any "hifi" scheme URLs to the local application.
|
||||||
void Menu::openUrl(const QUrl& url) {
|
void Menu::openUrl(const QUrl& url) {
|
||||||
if (url.scheme() == "hifi") {
|
if (url.scheme() == "hifi") {
|
||||||
QString path = url.toString(QUrl::RemoveScheme);
|
goToURL(url.toString());
|
||||||
path = path.remove(QRegExp("^:?/*"));
|
|
||||||
goTo(path);
|
|
||||||
} else {
|
} else {
|
||||||
QDesktopServices::openUrl(url);
|
QDesktopServices::openUrl(url);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
const int NUM_MESSAGES_TO_TIME_STAMP = 20;
|
const int NUM_MESSAGES_TO_TIME_STAMP = 20;
|
||||||
|
|
||||||
const QRegularExpression regexLinks("((?:(?:ftp)|(?:https?))://\\S+)");
|
const QRegularExpression regexLinks("((?:(?:ftp)|(?:https?)|(?:hifi))://\\S+)");
|
||||||
const QRegularExpression regexHifiLinks("([#@]\\S+)");
|
const QRegularExpression regexHifiLinks("([#@]\\S+)");
|
||||||
const QString mentionSoundsPath("/sounds/mention/");
|
const QString mentionSoundsPath("/sounds/mention/");
|
||||||
const QString mentionRegex("@(\\b%1\\b)");
|
const QString mentionRegex("@(\\b%1\\b)");
|
||||||
|
|
Loading…
Reference in a new issue