diff options
Diffstat (limited to 'src/browser.cpp')
-rw-r--r-- | src/browser.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/browser.cpp b/src/browser.cpp index 25ff5fb..4221eb9 100644 --- a/src/browser.cpp +++ b/src/browser.cpp @@ -98,16 +98,18 @@ MainWindow *Browser::createWindow() return window; } -MainWindow *Browser::createSession(const SessionParam ¶ms) +MainWindow *Browser::createSession(const QString &profileName, bool newWindow, const QStringList &urls) { MainWindow *window = nullptr; - if(params.newWindow || m_windows.isEmpty()) { + + // if we need to open in a new window, or there are no windows, make one + if(newWindow || m_windows.isEmpty()) { window = createWindow(); - window->setProfile(profile(params.profile)); + window->setProfile(profile(profileName)); } else { // reverse-iterate through windows to check for window with the same profile for(auto it = m_windows.rbegin(); it != m_windows.rend(); ++it) { - if((*it)->profile()->storageName() == params.profile) { + if((*it)->profile()->storageName() == profileName) { window = *it; break; } @@ -115,18 +117,18 @@ MainWindow *Browser::createSession(const SessionParam ¶ms) // if none is found, create one if(window == nullptr) { window = createWindow(); - window->setProfile(profile(params.profile)); + window->setProfile(profile(profileName)); } } Q_CHECK_PTR(window); - if(params.urls.isEmpty()) { + if(urls.isEmpty()) { // no URLs were given window->newTab(QUrl::fromUserInput(m_config->value<std::string>("profile.homepage").value().c_str())); } else { - for(const QUrl &url : params.urls) { - window->newTab(url); + for(const QString &url : urls) { + window->newTab(QUrl::fromUserInput(url)); } } |