void AddressManager::loadSettings(const QString& lookupString) { if (lookupString.isEmpty()) { handleUrl(currentAddressHandle.get().toString(), LookupTrigger::StartupFromSettings); } else { handleUrl(lookupString, LookupTrigger::StartupFromSettings); } }
void AddressManager::goForward() { if (_forwardStack.size() > 0) { // pop a URL from the forwardStack and go to that address handleUrl(_forwardStack.pop(), LookupTrigger::Forward); if (_forwardStack.size() == 0) { // the forward stack is empty so it is no longer possible to go forwards - emit that signal emit goForwardPossible(false); } } }
void AddressManager::goBack() { if (_backStack.size() > 0) { // go to that address handleUrl(_backStack.pop(), LookupTrigger::Back); if (_backStack.size() == 0) { // the back stack is now empty so it is no longer possible to go back - emit that signal emit goBackPossible(false); } } }
void AddressManager::handleLookupString(const QString& lookupString) { if (!lookupString.isEmpty()) { // make this a valid hifi URL and handle it off to handleUrl QString sanitizedString = lookupString.trimmed(); QUrl lookupURL; if (!lookupString.startsWith('/')) { const QRegExp HIFI_SCHEME_REGEX = QRegExp(HIFI_URL_SCHEME + ":\\/{1,2}", Qt::CaseInsensitive); sanitizedString = sanitizedString.remove(HIFI_SCHEME_REGEX); lookupURL = QUrl(HIFI_URL_SCHEME + "://" + sanitizedString); } else { lookupURL = QUrl(lookupString); } handleUrl(lookupURL); } }
static bool openDocument(const QUrl &file) { return handleUrl(url); }
static bool launchWebBrowser(const QUrl &url) { return handleUrl(url); }
static bool openDocument(const QUrl &file) { return handleUrl(file, false); }