Commit dcda493e authored by Eduardo Robles Elvira's avatar Eduardo Robles Elvira

bugfix: we were saving each closed window twice, and even one of those savings...

bugfix: we were saving each closed window twice, and even one of those savings was not getting deleted. Now we will use an anonymous config for storing in memory the closed items. This brings also a small optimization because we don't need to read closeditems_saved when closing a tab anymore.

svn path=/trunk/KDE/kdebase/apps/; revision=932333
parent 757eec42
......@@ -49,7 +49,7 @@ public:
K_GLOBAL_STATIC(KonqIcon, s_lightIconImage)
KonqClosedItem::KonqClosedItem(const QString& title, const QString& group, quint64 serialNumber)
: m_title(title), m_configGroup(KonqClosedWindowsManager::self()->config(), group), m_serialNumber(serialNumber)
: m_title(title), m_configGroup(KonqClosedWindowsManager::self()->memoryStore(), group), m_serialNumber(serialNumber)
......@@ -68,6 +68,7 @@ KonqClosedWindowsManager::KonqClosedWindowsManager()
m_konqClosedItemsConfig = 0L;
m_blockClosedItems = false;
m_konqClosedItemsMemoryStore = new KConfig(QString(), KConfig::SimpleConfig);
......@@ -76,12 +77,12 @@ KonqClosedWindowsManager::~KonqClosedWindowsManager()
delete m_konqClosedItemsConfig;
delete m_konqClosedItemsMemoryStore;
KConfig* KonqClosedWindowsManager::config()
KConfig* KonqClosedWindowsManager::memoryStore()
return m_konqClosedItemsConfig;
return m_konqClosedItemsMemoryStore;
KonqClosedWindowsManager *KonqClosedWindowsManager::self()
......@@ -61,7 +61,11 @@ public:
KonqClosedWindowItem *closedWindowItem, bool propagate = true);
KConfig* config();
* Returns an anonymous config (which exists only in memory). Only used by
* KonqClosedItems for storing in memory closed items.
KConfig* memoryStore();
* Called by the KonqUndoManager when a local window is being closed.
......@@ -115,7 +119,7 @@ private:
QList<KonqClosedWindowItem *> m_closedWindowItemList;
int m_numUndoClosedItems;
KConfig *m_konqClosedItemsConfig;
KConfig *m_konqClosedItemsConfig, *m_konqClosedItemsMemoryStore;
int m_maxNumClosedItems;
* This bool var is used internally to allow delayed initialization of the
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