--- configure.h Thu Jan 15 10:14:12 1970 +++ configure.h Thu Jan 15 10:14:12 1970 @@ -1,11 +1,11 @@ #ifndef __CONFIGURE_H__ #define __CONFIGURE_H__ -#define CONFIG_PATH "/opt/qtoctave-0.8.2/share/qtoctave" -#define HELP_PATH "/opt/qtoctave-0.8.2/share/doc/octave-html/octave_doc/index.html" -#define ICON_PATH "/opt/qtoctave-0.8.2/share/qtoctave/images" -#define LANG_PATH "/opt/qtoctave-0.8.2/share/qtoctave/lang" -#define QTOCTAVE_HELP_PATH "/opt/qtoctave-0.8.2/share/doc/qtoctave/qtoctave_doc/index.html" +#define CONFIG_PATH "..\\share\\qtoctave" +#define HELP_PATH "..\\share\\doc\\octave-html\\octave_doc\\index.html" +#define ICON_PATH "..\\share\\qtoctave\\images" +#define LANG_PATH "..\\share\\qtoctave\\lang" +#define QTOCTAVE_HELP_PATH "..\\share\\doc\\qtoctave\\qtoctave_doc\\index.html" -#define PKG_CMD_PATH "/opt/qtoctave-0.8.2/share/qtoctave/pkg-commands.list" +#define PKG_CMD_PATH "..\\share\\qtoctave\\pkg-commands.list" #endif --- main.cpp Thu Jan 15 10:14:12 1970 +++ main.cpp Thu Jan 15 10:14:12 1970 @@ -35,10 +35,9 @@ #include "editor.h" #include "svgcanvas/svgcanvas.h" - - Main::Main(QObject * parent ):QObject (parent) { + QString qtoctavedir = QDir::currentPath(); //Build Octave commands list { QString oc; @@ -74,6 +73,7 @@ oc = new OctaveConnection(); + oc->setQtOctavePath(qtoctavedir); QString session_name=get_config("session_name"); --- octave_connection.cpp Thu Jan 15 10:14:12 1970 +++ octave_connection.cpp Thu Jan 15 10:14:12 1970 @@ -51,6 +51,11 @@ regexp_actual_debug_line_column.setPattern("^([a-zA-Z_]\\w*:)+ line ([0-9]+), column ([0-9]+)$"); } +void OctaveConnection::setQtOctavePath(const QString path) +{ + qtoctave_path=path; +} + void OctaveConnection::setOctavePath(const QString path) { octave_path=path; @@ -110,7 +115,7 @@ } else { - QString command("\""+octave_path+"\" --eval \"PS1(\'octave:\\#>\');PS2(\'octave:\\#+>\');addpath('"+QString(CONFIG_PATH)+"/scripts_octave/')\" --persist --no-history -i "+extra_args); + QString command("\""+octave_path+"\" --eval \"PS1(\'octave:\\#>\');PS2(\'octave:\\#+>\');addpath('"+qtoctave_path+QString(CONFIG_PATH)+"\\scripts_octave\\')\" --persist --no-history -i "+extra_args); printf("[OctaveConnection::startOctave] Starting octave: %s\n",command.toLocal8Bit().data() ); start(command); } @@ -140,7 +145,7 @@ void OctaveConnection::loadScripts() { - QDir dir(QString(CONFIG_PATH) + "/scripts/"); + QDir dir(qtoctave_path + QString(CONFIG_PATH) + "\\scripts\\"); QStringList filters; filters << "*.m"; --- octave_connection.h Thu Jan 15 10:14:12 1970 +++ octave_connection.h Thu Jan 15 10:14:12 1970 @@ -37,6 +37,7 @@ * @param path path to Octave. */ void setOctavePath(const QString path); + void setQtOctavePath(const QString path); QString getOctavePath(); void startOctave(bool quiet=false); //void setTextEdit(QTextEdit *text); @@ -54,6 +55,7 @@ int instructions_left_no; bool debugging; QString octave_path; + QString qtoctave_path; QString line_buffer; QBuffer error_buffer; /**Load scripts from qtoctave/scripts.*/