mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 20:44:14 +02:00
Merge pull request #3292 from Atlante45/fix_for_custom_URL_schemes
Fix for custom URL schemes
This commit is contained in:
commit
adef45538c
2 changed files with 3 additions and 4 deletions
|
@ -814,9 +814,8 @@ bool Application::event(QEvent* event) {
|
|||
QFileOpenEvent* fileEvent = static_cast<QFileOpenEvent*>(event);
|
||||
bool isHifiSchemeURL = !fileEvent->url().isEmpty() && fileEvent->url().toLocalFile().startsWith(CUSTOM_URL_SCHEME);
|
||||
if (isHifiSchemeURL) {
|
||||
Menu::getInstance()->goTo(fileEvent->url().toString());
|
||||
Menu::getInstance()->goToURL(fileEvent->url().toLocalFile());
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
return QApplication::event(event);
|
||||
|
|
|
@ -1153,8 +1153,8 @@ void Menu::goTo() {
|
|||
}
|
||||
|
||||
bool Menu::goToURL(QString location) {
|
||||
if (location.startsWith(CUSTOM_URL_SCHEME + "//")) {
|
||||
QStringList urlParts = location.remove(0, CUSTOM_URL_SCHEME.length() + 2).split('/', QString::SkipEmptyParts);
|
||||
if (location.startsWith(CUSTOM_URL_SCHEME + "/")) {
|
||||
QStringList urlParts = location.remove(0, CUSTOM_URL_SCHEME.length()).split('/', QString::SkipEmptyParts);
|
||||
|
||||
if (urlParts.count() > 1) {
|
||||
// if url has 2 or more parts, the first one is domain name
|
||||
|
|
Loading…
Reference in a new issue