mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 09:23:17 +02:00
currentShareableAddress wont return file: urls. copy-current-address menu item uses non-shareable version
This commit is contained in:
parent
3bc764a020
commit
81ba875ad2
1 changed files with 11 additions and 3 deletions
|
@ -60,6 +60,7 @@ QUrl AddressManager::currentFacingAddress() const {
|
|||
}
|
||||
|
||||
QUrl AddressManager::currentShareableAddress(bool domainOnly) const {
|
||||
QUrl shareableAddress;
|
||||
if (!_shareablePlaceName.isEmpty()) {
|
||||
// if we have a shareable place name use that instead of whatever the current host is
|
||||
QUrl hifiURL;
|
||||
|
@ -71,10 +72,16 @@ QUrl AddressManager::currentShareableAddress(bool domainOnly) const {
|
|||
hifiURL.setPath(currentPath());
|
||||
}
|
||||
|
||||
return hifiURL;
|
||||
shareableAddress = hifiURL;
|
||||
} else {
|
||||
return currentAddress(domainOnly);
|
||||
shareableAddress = currentAddress(domainOnly);
|
||||
}
|
||||
|
||||
if (shareableAddress.scheme() == URL_SCHEME_HIFI) {
|
||||
return QUrl(); // file: urls aren't shareable
|
||||
}
|
||||
|
||||
return shareableAddress;
|
||||
}
|
||||
|
||||
QUrl AddressManager::currentFacingShareableAddress() const {
|
||||
|
@ -288,6 +295,7 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl, LookupTrigger trigger) {
|
|||
// lookupUrl.scheme() == URL_SCHEME_HTTP ||
|
||||
// lookupUrl.scheme() == URL_SCHEME_HTTPS ||
|
||||
_previousLookup.clear();
|
||||
_shareablePlaceName.clear();
|
||||
QUrl domainURL = PathUtils::expandToLocalDataAbsolutePath(lookupUrl);
|
||||
setDomainInfo(domainURL, trigger);
|
||||
emit lookupResultsFinished();
|
||||
|
@ -818,7 +826,7 @@ void AddressManager::copyAddress() {
|
|||
}
|
||||
|
||||
// assume that the address is being copied because the user wants a shareable address
|
||||
QGuiApplication::clipboard()->setText(currentShareableAddress().toString());
|
||||
QGuiApplication::clipboard()->setText(currentFacingAddress().toString());
|
||||
}
|
||||
|
||||
void AddressManager::copyPath() {
|
||||
|
|
Loading…
Reference in a new issue