Commit e025cb34 authored by David Faure's avatar David Faure

Don't autosave preloaded windows

parent fdd6cb31
......@@ -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*/)
{
if (!m_currentView) {
......
......@@ -308,6 +308,8 @@ public:
void updateHistoryActions();
bool isPreloaded() const;
// Public for unit tests
void prepareForPopupMenu(const KFileItemList &items, const KParts::OpenUrlArguments &args, const KParts::BrowserArguments &browserArgs);
......
......@@ -66,7 +66,7 @@ KonqMainWindow *KonqMainWindowFactory::createEmptyWindow()
QList<KonqMainWindow *> *mainWindowList = KonqMainWindow::mainWindowList();
if (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;
KStartupInfo::setWindowStartupId(win->winId(), KStartupInfo::startupId());
ensurePreloadedWindow();
......
......@@ -507,9 +507,11 @@ void KonqSessionManager::saveCurrentSessionToFile(KConfig *config, const QList<K
}
foreach (KonqMainWindow *window, mainWindows) {
KConfigGroup configGroup(config, "Window" + QString::number(counter));
window->saveProperties(configGroup);
counter++;
if (!window->isPreloaded()) {
KConfigGroup configGroup(config, "Window" + QString::number(counter));
window->saveProperties(configGroup);
counter++;
}
}
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