Commit 88c681d0 authored by Robert Knight's avatar Robert Knight

Attempted fix for when changing the profile of a tab after making use of the...

Attempted fix for when changing the profile of a tab after making use of the split-view feature.  Dangling pointers were being left in ViewManager::_sessionMap (even though _sessionMap previously stored QPointer guarted ptrs rather than raw pointers).  Call removeContainer() to remove views cleanly from the _sessionMap hash when the 'Close Other Views' action is triggered rather than simply deleting the view container directly.  Store raw pointers in _sessionMap variable since QPointer<> does not work here.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=734008
parent 47e3ff76
......@@ -437,7 +437,7 @@ void ViewManager::closeOtherViews()
{
ViewContainer* next = iter.next();
if ( next != active )
delete next;
removeContainer(next);
}
}
......@@ -562,12 +562,11 @@ void ViewManager::viewCloseRequest(QWidget* view)
// 1. detach view from session
// 2. if the session has no views left, close it
Session* session = _sessionMap[ display ];
_sessionMap.remove(display);
if ( session )
{
display->deleteLater();
_sessionMap.remove(display);
if ( session->views().count() == 0 )
session->close();
}
......@@ -682,7 +681,7 @@ void ViewManager::applyProfile(TerminalDisplay* view , const QString& profileKey
void ViewManager::updateViewsForSession(Session* session)
{
QListIterator<QPointer<TerminalDisplay> > iter(_sessionMap.keys(session));
QListIterator<TerminalDisplay*> iter(_sessionMap.keys(session));
while ( iter.hasNext() )
{
applyProfile(iter.next(),session->profileKey());
......@@ -691,7 +690,7 @@ void ViewManager::updateViewsForSession(Session* session)
void ViewManager::profileChanged(const QString& key)
{
QHashIterator<QPointer<TerminalDisplay>,QPointer<Session> > iter(_sessionMap);
QHashIterator<TerminalDisplay*,Session*> iter(_sessionMap);
while ( iter.hasNext() )
{
......
......@@ -229,6 +229,7 @@ private slots:
void moveActiveViewLeft();
// moves active view to the right
void moveActiveViewRight();
private:
const ColorScheme* colorSchemeForProfile(const QString& key) const;
......@@ -266,7 +267,9 @@ private:
private:
QPointer<ViewSplitter> _viewSplitter;
QPointer<SessionController> _pluggedController;
QHash<QPointer<TerminalDisplay>,QPointer<Session> > _sessionMap;
QHash<TerminalDisplay*,Session*> _sessionMap;
KActionCollection* _actionCollection;
QSignalMapper* _containerSignalMapper;
NavigationMethod _navigationMethod;
......
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