Commit a27cc6ec authored by Robert Knight's avatar Robert Knight

Avoid trying to remove a widget from a view container twice. Use...

Avoid trying to remove a widget from a view container twice.  Use deleteLater() as a safer way to delete certain widgets.

svn path=/branches/work/konsole-split-view/; revision=658433
parent 4406c881
......@@ -140,13 +140,15 @@ public:
* Updates the filters in the display's filter chain. This will cause
* the hotspots to be updated to match the current image.
*
* The cost of this operation depends on the number of characters
* on screen and the number of filters in the filterChain(),
* it is potentially expensive so should only be called:
* WARNING: This function can be expensive depending on the
* image size and number of filters in the filterChain()
*
* 1) When filters are added, removed or changed
* 2) When the displayed image has changed and the user
* wants to see the updated filters.
* TODO - This API does not really allow efficient usage. Revise it so
* that the processing can be done in a better way.
*
* eg:
* - Area of interest may be known ( eg. mouse cursor hovering
* over an area )
*/
void processFilters();
......
......@@ -72,23 +72,26 @@ void ViewContainer::viewDestroyed(QObject* object)
_navigation.remove(widget);
removeViewWidget(widget);
emit viewRemoved(widget);
if (_views.count() == 0)
emit empty(this);
emit viewRemoved(widget);
}
void ViewContainer::removeView(QWidget* view)
{
_views.removeAll(view);
_navigation.remove(view);
disconnect( view , SIGNAL(destroyed(QObject*)) , this , SLOT( viewDestroyed(QObject*) ) );
removeViewWidget(view);
emit viewRemoved(view);
if (_views.count() == 0)
emit empty(this);
emit viewRemoved(view);
}
const QList<QWidget*> ViewContainer::views()
......
......@@ -303,7 +303,7 @@ void ViewManager::splitView(Qt::Orientation orientation)
}
void ViewManager::removeContainer(ViewContainer* container)
{
delete container;
container->deleteLater();
emit splitViewToggle(_viewSplitter->containers().count() > 1);
}
void ViewManager::closeActiveView()
......@@ -420,7 +420,7 @@ void ViewManager::viewCloseRequest(QWidget* view)
Session* session = _sessionMap[ display ];
if ( session )
{
delete display;
display->deleteLater();
if ( session->views().count() == 0 )
session->closeSession();
......
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