[kgraphviewer-devel] [KGraphViewer/libkgraphviz] da62bd6: Remove unused/redundant(?) method

Kevin Funk krf at electrostorm.net
Mon Dec 13 18:18:33 CET 2010


commit da62bd64000bf034c3dd4031103588c0356a6587
branch libkgraphviz
Author: Kevin Funk <krf at electrostorm.net>
Date:   Mon Dec 13 17:54:27 2010 +0100

    Remove unused/redundant(?) method
    
    * Remove DotGraphView::slotLoadLibrary(Agraph_t)
    * Remove KGraphViewerPart::slotLoadLibrary(Agraph_t)

diff --git a/src/kgraphviz/dotgraphview.cpp b/src/kgraphviz/dotgraphview.cpp
index 46182e9..b6c9d4a 100644
--- a/src/kgraphviz/dotgraphview.cpp
+++ b/src/kgraphviz/dotgraphview.cpp
@@ -717,71 +717,6 @@ bool DotGraphView::initEmpty()
   return true;
 }
 
-bool DotGraphView::slotLoadLibrary(graph_t* graph)
-{
-  kDebug() << "graph_t";
-  Q_D(DotGraphView);
-  d->m_birdEyeView->setScene(0);
-
-  if (d->m_canvas)
-  {
-    d->m_canvas->deleteLater();
-    d->m_canvas = 0;
-  }
-
-  QString layoutCommand = (d->m_graph!=0?d->m_graph->layoutCommand():"");
-  if (d->m_graph != 0)
-    delete d->m_graph;
-
-  if (layoutCommand.isEmpty())
-  layoutCommand = "dot";
-
-  kDebug() << "layoutCommand:" << layoutCommand;
-  d->m_graph = new DotGraph(layoutCommand,"");
-  d->m_graph->setUseLibrary(true);
-
-  connect(d->m_graph,SIGNAL(readyToDisplay()),this,SLOT(displayGraph()));
-  connect(this, SIGNAL(removeEdge(const QString&)), d->m_graph, SLOT(removeEdge(const QString&)));
-  connect(this, SIGNAL(removeNodeNamed(const QString&)), d->m_graph, SLOT(removeNodeNamed(const QString&)));
-  connect(this, SIGNAL(removeElement(const QString&)), d->m_graph, SLOT(removeElement(const QString&)));
-
-  if (d->m_readWrite)
-  {
-    d->m_graph->setReadWrite();
-  }
-
-  if (layoutCommand.isEmpty())
-  {
-    layoutCommand = d->m_graph->chooseLayoutProgramForFile(d->m_graph->dotFileName());
-  }
-  d->m_graph->layoutCommand(layoutCommand);
-
-  GVC_t* gvc = gvContext();
-  gvLayout(gvc, graph, layoutCommand.toUtf8().data());
-  gvRender (gvc, graph, "xdot", NULL);
-
-  d->m_xMargin = 50;
-  d->m_yMargin = 50;
-
-  QGraphicsScene* newCanvas = new QGraphicsScene();
-  kDebug() << "Created canvas " << newCanvas;
-
-  d->m_birdEyeView->setScene(newCanvas);
-  // std::cerr << "After m_birdEyeView set canvas" << std::endl;
-
-  setScene(newCanvas);
-  connect(newCanvas,SIGNAL(selectionChanged ()),this,SLOT(slotSelectionChanged()));
-  d->m_canvas = newCanvas;
-
-  d->m_cvZoom = 0;
-
-  d->m_graph->updateWithGraph(graph);
-
-  gvFreeLayout(gvc, graph);
-  gvFreeContext(gvc);
-  return true;
-}
-
 bool DotGraphView::loadDot(const QString& dotFileName)
 {
   kDebug() << "'" << dotFileName << "'";
diff --git a/src/kgraphviz/dotgraphview.h b/src/kgraphviz/dotgraphview.h
index 7930db9..306e602 100644
--- a/src/kgraphviz/dotgraphview.h
+++ b/src/kgraphviz/dotgraphview.h
@@ -194,7 +194,6 @@ public Q_SLOTS:
   void zoomRectMovedTo(QPointF newZoomPos);
   void zoomRectMoveFinished();
   bool initEmpty();
-  bool slotLoadLibrary(Agraph_t* graph);
   bool reload();
   void dirty(const QString& dotFileName);
   void pageSetup();
diff --git a/src/part/kgraphviewer_part.cpp b/src/part/kgraphviewer_part.cpp
index 3f66c7b..aca7933 100644
--- a/src/part/kgraphviewer_part.cpp
+++ b/src/part/kgraphviewer_part.cpp
@@ -36,6 +36,8 @@
 #include <kiconloader.h>
 #include <kstandarddirs.h>
 
+#include <graphviz/gvc.h>
+
 #include <iostream>
 
 // #include "kgraphviewersettings.h"
@@ -179,15 +181,6 @@ bool KGraphViewerPart::closeUrl()
   return d->m_widget->initEmpty();
 }
 
-bool KGraphViewerPart::slotLoadLibrary(graph_t* graph) 	 
-{ 	 
-  kDebug(); 	 
-  bool res = d->m_widget->slotLoadLibrary(graph); 	 
-  if (res) 	 
-    d->m_widget->show(); 	 
-  return res; 	 
-}
-
 KGraphViewerPart::~KGraphViewerPart()
 {
   delete d;
diff --git a/src/part/kgraphviewer_part.h b/src/part/kgraphviewer_part.h
index c537248..ce3f49f 100644
--- a/src/part/kgraphviewer_part.h
+++ b/src/part/kgraphviewer_part.h
@@ -24,8 +24,6 @@
 #include <kparts/part.h>
 #include <kparts/genericfactory.h>
 
-#include <graphviz/gvc.h>
-
 class KComponentData;
 class KAboutData;
 class KDirWatch;
@@ -134,7 +132,6 @@ public Q_SLOTS:
   void slotSetCursor(const QCursor& cursor);
   void slotUnsetCursor();
   virtual bool closeUrl();
-  bool slotLoadLibrary(graph_t* graph);
   void slotSetLayoutMethod(LayoutMethod method);
   void slotRenameNode(const QString& oldNodeName, const QString& newNodeName);
   


More information about the kgraphviewer-devel mailing list