changeset 13455:3adf6bf0a98d

Cleaned up OctaveLink.
author Jacob Dawid <jacob.dawid@googlemail.com>
date Fri, 15 Apr 2011 15:11:13 +0200
parents fde3803ae0ee
children 8a8a479c2e78
files gui//src/MainWindow.h gui//src/OctaveLink.cpp gui//src/OctaveLink.h
diffstat 3 files changed, 17 insertions(+), 73 deletions(-) [+]
line wrap: on
line diff
--- a/gui//src/MainWindow.h	Fri Apr 15 14:54:36 2011 +0200
+++ b/gui//src/MainWindow.h	Fri Apr 15 15:11:13 2011 +0200
@@ -177,30 +177,6 @@
             m_mainWindow->historyDockWidget()->updateHistory(historyList);
         }
 
-        // Put a marker in each buffer at the proper location.
-        int status = 0;
-        std::vector<OctaveLink::BreakPoint> breakPoints = OctaveLink::instance()->breakPointList(status);
-        if(status==0) {
-            //MEditor::GetInstance()->process_breakpoint_list (bps);
-        }
-
-        // Find out if a breakpoint is hit
-        static bool lineNumber = -1;
-        bool hitBreakPoint = OctaveLink::instance()->isBreakpointReached(status);
-        if((status==0) && hitBreakPoint) {
-            std::vector<OctaveLink::BreakPoint> hit_breakpoint = OctaveLink::instance()->reachedBreakpoint();
-
-            if(hit_breakpoint.size() > 0 && (hit_breakpoint[0].lineNumber != lineNumber)) {
-                //MEditor::GetInstance()->remove_hit_breakpoint_marker ();
-                //MEditor::GetInstance()->add_breakpoint_marker(hit_breakpoint[0], BP_MARKER_TYPE_HIT);
-                lineNumber = hit_breakpoint[0].lineNumber;
-            }
-        }
-        else if((status==0) && lineNumber>0) {
-            //MEditor::GetInstance()->remove_hit_breakpoint_marker ();
-            lineNumber = -1;
-        }
-
             usleep(100000);
         }
     }
--- a/gui//src/OctaveLink.cpp	Fri Apr 15 14:54:36 2011 +0200
+++ b/gui//src/OctaveLink.cpp	Fri Apr 15 15:11:13 2011 +0200
@@ -21,14 +21,8 @@
 
 // Born July 13, 2007.
 
-
-
 #include "OctaveLink.h"
 
-#include <QFileInfo>
-#include <QMutexLocker>
-#include <QList>
-
 OctaveLink OctaveLink::m_singleton;
 
 static octave_user_code *
@@ -116,7 +110,7 @@
     return retval;
 }
 
-bool OctaveLink::isBreakpointReached (int& status)
+bool OctaveLink::isBreakpointReached()
 {
     QMutexLocker mutexLocker(&m_internalAccessMutex);
 
@@ -322,8 +316,8 @@
 	  //std::string shortName = Glib::path_get_basename(name);
 	  std::string shortName = fileName.toStdString ();
 	  std::string funcName;
-	  int dot = shortName.find_first_of(".");
-	  if (dot!=std::string::npos)
+          int dot = shortName.find_first_of(".");
+          if (dot!=(signed)std::string::npos)
 	    {
 	      funcName = shortName.substr (0,dot);
 	    }
@@ -409,7 +403,7 @@
 {
   //octave_stdout << "Processing breakpoints changes" << std::endl;
   // Process added breakpoints
-  for (int i = 0 ; i < m_addedBreakpoints.size() ; i++)
+  for (int i = 0 ; i < (signed)m_addedBreakpoints.size() ; i++)
   {
     std::string funcName = m_addedBreakpoints[i].fileName;
     bp_table::intmap lines;
@@ -420,7 +414,7 @@
   m_addedBreakpoints = std::vector<BreakPoint>();
 
   // Process removed breakpoints
-  for (int i = 0 ; i < m_removedBreakpoints.size() ; i++)
+  for (int i = 0 ; i < (signed)m_removedBreakpoints.size() ; i++)
   {
     std::string funcName = m_removedBreakpoints[i].fileName;
     bp_table::intmap lines;
--- a/gui//src/OctaveLink.h	Fri Apr 15 14:54:36 2011 +0200
+++ b/gui//src/OctaveLink.h	Fri Apr 15 15:11:13 2011 +0200
@@ -22,7 +22,8 @@
  * */
 #ifndef OCTAVELINK_H
 #define OCTAVELINK_H
-//#ifdef HAVE_CONFIG_H
+
+// Octave includes
 #undef PACKAGE_BUGREPORT
 #undef PACKAGE_NAME
 #undef PACKAGE_STRING
@@ -30,26 +31,6 @@
 #undef PACKAGE_VERSION
 #undef PACKAGE_URL
 #include <octave/config.h>
-//#endif
-
-#include <cassert>
-#include <cstdlib>
-#include <cstring>
-#include <ctime>
-
-#include <fstream>
-#include <iostream>
-
-#ifdef HAVE_UNISTD_H
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#include <unistd.h>
-#endif
-#include <sys/time.h>
-
-#include <sys/time.h>
-
 #include "octave/cmd-edit.h"
 #include "octave/error.h"
 #include "octave/file-io.h"
@@ -66,10 +47,10 @@
 #include "octave/symtab.h"
 #include "octave/pt.h"
 #include "octave/pt-eval.h"
-
+#include "octave/config.h"
+#include "octave/Range.h"
 #include "octave/toplev.h"
 #include "octave/procstream.h"
-//#include "octave/prog-args.h"
 #include "octave/sighandlers.h"
 #include "octave/debug.h"
 #include "octave/sysdep.h"
@@ -78,23 +59,16 @@
 #include "octave/utils.h"
 #include "octave/variables.h"
 
-#include <readline/readline.h>
-#undef PACKAGE_BUGREPORT
-#undef PACKAGE_NAME
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-#undef PACKAGE_VERSION
-#undef PACKAGE_URL
-#include "octave/config.h"
-#include "octave/Range.h"
-#include "octave/ov.h"
-class octave_value;
-class octave_value_list;
-
-#include <cstdio>
+// Standard includes
+#include <iostream>
 #include <string>
 #include <vector>
+#include <readline/readline.h>
+
+// Qt includes
+#include <QMutexLocker>
 #include <QMutex>
+#include <QFileInfo>
 #include <QList>
 #include <QString>
 #include <QVector>
@@ -160,7 +134,7 @@
     std::vector<BreakPoint> reachedBreakpoint();
 
     /** TODO: Describe. */
-    bool isBreakpointReached(int& status);
+    bool isBreakpointReached();
 
     /** TODO: Describe. */
     int addBreakpoint(BreakPoint bp_info);