diff options
| author | Mike Skec <skec@protonmail.ch> | 2021-03-17 16:01:52 +1100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2021-03-17 09:49:58 +0100 |
| commit | 1f8ecb6d05976e6dc8be01ba1a6f3068ed351971 (patch) | |
| tree | beacfe2d91914136d08690b583398e6497314e47 /src/main.cpp | |
| parent | 489512210b80e0bb441df27ead735722c9c68da2 (diff) | |
| download | kristall-1f8ecb6d05976e6dc8be01ba1a6f3068ed351971.tar.gz | |
sessions: add 'lazyloading' for restored tabs
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp index b51dcb1..41f994c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -347,7 +347,7 @@ MainWindow * kristall::openNewWindow(QVector<QUrl> const & urls) for(int i = 0; i < urls.length(); i++) { - window->addNewTab((i == 0), urls.at(i), ""); + window->addNewTab((i == 0), urls.at(i), true, ""); } window->show(); @@ -362,7 +362,7 @@ MainWindow * kristall::openNewWindow(QVector<PageMetadata> const & urls) for(int i = 0; i < urls.length(); i++) { - window->addNewTab((i == 0), urls.at(i).location, urls.at(i).title); + window->addNewTab((i == 0), urls.at(i).location, true, urls.at(i).title); } window->show(); @@ -721,8 +721,12 @@ int main(int argc, char *argv[]) auto * const window = kristall::openNewWindow(urls); - int tab_index = settings.value("tab_index").toInt(); - window->setCurrentTabIndex(tab_index); + if (window->tabCount() > 0) + { + int tab_index = settings.value("tab_index").toInt(); + window->setCurrentTabIndex(tab_index); + window->curTab()->reloadPage(); + } if(settings.contains("state")) { window->restoreState(settings.value("state").toByteArray()); |
