[kgraphviewer-devel] [kgraphviewer] src/part: Do not crash anymore on reload

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Jun 22 08:14:36 UTC 2014


On Thu, Jun 19, 2014 at 08:53:23PM +0000, Gael de Chalendar wrote:
> Git commit c91826c67504036e6087ffae1b5604ce23f1e140 by Gael de Chalendar.
> Committed on 19/06/2014 at 20:49.
> Pushed by kleag into branch 'master'.
> 
> Do not crash anymore on reload
> 
> M  +14   -2    src/part/dotgraphview.cpp
> 
> http://commits.kde.org/kgraphviewer/c91826c67504036e6087ffae1b5604ce23f1e140
> 
> diff --git a/src/part/dotgraphview.cpp b/src/part/dotgraphview.cpp
> index 5dbb6c3..c17ee59 100644
> --- a/src/part/dotgraphview.cpp
> +++ b/src/part/dotgraphview.cpp
> @@ -2206,8 +2206,20 @@ void DotGraphView::slotAGraphReadFinished()
>      else
>        layoutCommand = "dot";
>    }
> -  d->m_layoutThread.layoutGraph(d->m_loadThread.g(), layoutCommand);
> -  d->m_loadThread.processed_finished();
> +  if (d->m_loadThread.g() == 0)
> +  {
> +    delete d->m_graph;
> +
> +    if (layoutCommand.isEmpty())
> +    layoutCommand = "dot";
> +
> +    d->m_graph = new DotGraph(layoutCommand,"");
> +  }
> +  else
> +  {
> +    d->m_layoutThread.layoutGraph(d->m_loadThread.g(), layoutCommand);
> +    d->m_loadThread.processed_finished();
> +  }

Could you explain this change to me/retest it?
Because I'd really like to revert it, since for me it fixes nothing but
breaks one thing.
I.e. when I revert it, I still do not get any crash, but I get a proper
"Failed to open..." message in the graph view.
With this change, the graph view instead is stuck displaying "graph ..
is getting loaded", which is incorrect and confusing.

Reimar


More information about the kgraphviewer-devel mailing list