Mailinglist Archive: yast-commit (819 mails)

< Previous Next >
[yast-commit] r55079 - /trunk/qt-graph/src/QY2Graph.cc
  • From: aschnell@xxxxxxxxxxxxxxxx
  • Date: Tue, 27 Jan 2009 15:15:53 -0000
  • Message-id: <E1LRpfN-000229-IC@xxxxxxxxxxxxxxxx>
Author: aschnell
Date: Tue Jan 27 16:15:53 2009
New Revision: 55079

URL: http://svn.opensuse.org/viewcvs/yast?rev=55079&view=rev
Log:
- improved error handling

Modified:
trunk/qt-graph/src/QY2Graph.cc

Modified: trunk/qt-graph/src/QY2Graph.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/qt-graph/src/QY2Graph.cc?rev=55079&r1=55078&r2=55079&view=diff
==============================================================================
--- trunk/qt-graph/src/QY2Graph.cc (original)
+++ trunk/qt-graph/src/QY2Graph.cc Tue Jan 27 16:15:53 2009
@@ -194,19 +194,35 @@
if (fp)
{
GVC_t* gvc = gvContext();
+ if (gvc != NULL)
+ {
+ graph_t* graph = agread(fp);
+ if (graph != NULL)
+ {
+ if (gvLayout(gvc, graph,
const_cast<char*>(layoutAlgorithm.c_str())) == 0)
+ {
+ renderGraph(graph);
+
+ gvFreeLayout(gvc, graph);
+ }
+ else
+ {
+ qCritical("gvLayout() failed");
+ }
+
+ agclose(graph);
+ }
+ else
+ {
+ qCritical("agread() failed");
+ }

- graph_t* graph = agread(fp);
-
- char* tmp = strdup(layoutAlgorithm.c_str());
- gvLayout(gvc, graph, tmp);
- free(tmp);
-
- renderGraph(graph);
-
- gvFreeLayout(gvc, graph);
- agclose(graph);
-
- gvFreeContext(gvc);
+ gvFreeContext(gvc);
+ }
+ else
+ {
+ qCritical("gvContext() failed");
+ }

fclose(fp);
}

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages