Commit e025cb34 authored by David Faure's avatar David Faure

Don't autosave preloaded windows

parent fdd6cb31
...@@ -3911,6 +3911,11 @@ void KonqMainWindow::updateHistoryActions() ...@@ -3911,6 +3911,11 @@ void KonqMainWindow::updateHistoryActions()
} }
} }
bool KonqMainWindow::isPreloaded() const
{
return !isVisible() && m_mapViews.count() == 1 && m_currentView->url().toString() == "about:blank";
}
void KonqMainWindow::updateToolBarActions(bool pendingAction /*=false*/) void KonqMainWindow::updateToolBarActions(bool pendingAction /*=false*/)
{ {
if (!m_currentView) { if (!m_currentView) {
......
...@@ -308,6 +308,8 @@ public: ...@@ -308,6 +308,8 @@ public:
void updateHistoryActions(); void updateHistoryActions();
bool isPreloaded() const;
// Public for unit tests // Public for unit tests
void prepareForPopupMenu(const KFileItemList &items, const KParts::OpenUrlArguments &args, const KParts::BrowserArguments &browserArgs); void prepareForPopupMenu(const KFileItemList &items, const KParts::OpenUrlArguments &args, const KParts::BrowserArguments &browserArgs);
......
...@@ -66,7 +66,7 @@ KonqMainWindow *KonqMainWindowFactory::createEmptyWindow() ...@@ -66,7 +66,7 @@ KonqMainWindow *KonqMainWindowFactory::createEmptyWindow()
QList<KonqMainWindow *> *mainWindowList = KonqMainWindow::mainWindowList(); QList<KonqMainWindow *> *mainWindowList = KonqMainWindow::mainWindowList();
if (mainWindowList) { if (mainWindowList) {
for (KonqMainWindow *win : *mainWindowList) { for (KonqMainWindow *win : *mainWindowList) {
if (!win->isVisible() && win->viewCount() == 1 && win->currentView()->url().toString() == "about:blank") { if (win->isPreloaded()) {
qDebug() << "Reusing preloaded window" << win; qDebug() << "Reusing preloaded window" << win;
KStartupInfo::setWindowStartupId(win->winId(), KStartupInfo::startupId()); KStartupInfo::setWindowStartupId(win->winId(), KStartupInfo::startupId());
ensurePreloadedWindow(); ensurePreloadedWindow();
......
...@@ -507,9 +507,11 @@ void KonqSessionManager::saveCurrentSessionToFile(KConfig *config, const QList<K ...@@ -507,9 +507,11 @@ void KonqSessionManager::saveCurrentSessionToFile(KConfig *config, const QList<K
} }
foreach (KonqMainWindow *window, mainWindows) { foreach (KonqMainWindow *window, mainWindows) {
KConfigGroup configGroup(config, "Window" + QString::number(counter)); if (!window->isPreloaded()) {
window->saveProperties(configGroup); KConfigGroup configGroup(config, "Window" + QString::number(counter));
counter++; window->saveProperties(configGroup);
counter++;
}
} }
KConfigGroup configGroup(config, "General"); KConfigGroup configGroup(config, "General");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment