[arch-commits] Commit in qtiplot/trunk (5 files)
Giovanni Scafora
giovanni at archlinux.org
Sat Jul 25 19:50:56 UTC 2009
Date: Saturday, July 25, 2009 @ 15:50:56
Author: giovanni
Revision: 47729
upgpkg: qtiplot 0.9.7.8-1
New version 0.9.7.8
Modified:
qtiplot/trunk/PKGBUILD
qtiplot/trunk/qwtplot3d_gcc.patch
Deleted:
qtiplot/trunk/dynamicgsl.patch
qtiplot/trunk/qtiplot-gcc4.3.patch
qtiplot/trunk/scriptedit.patch
----------------------+
PKGBUILD | 32 +--
dynamicgsl.patch | 87 ---------
qtiplot-gcc4.3.patch | 15 -
qwtplot3d_gcc.patch | 4
scriptedit.patch | 427 -------------------------------------------------
5 files changed, 18 insertions(+), 547 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2009-07-25 17:39:35 UTC (rev 47728)
+++ PKGBUILD 2009-07-25 19:50:56 UTC (rev 47729)
@@ -3,34 +3,33 @@
# Contributor: damir <damir.archlinux.org>
pkgname=qtiplot
-pkgver=0.9.7.7
+pkgver=0.9.7.8
pkgrel=1
pkgdesc="Data analysis and scientific plotting - free clone of Origin"
arch=('i686' 'x86_64')
url="http://soft.proindependent.com/qtiplot.html"
-depends=('muparser>=1.30' 'gsl' 'python>=2.6.2' 'pyqt' 'sip' \
- 'boost>=1.37' 'libgl' 'qwt')
+depends=('muparser>=1.30' 'gsl' 'pyqt' 'sip' 'boost>=1.39.0' 'libgl' 'qwt')
# build against liborigin provided in the package ...
# build against qwtplot3d provided in the package ...
# as systemwide one doesn't provide all needed functions
makedepends=('pkgconfig')
license=('GPL2')
+source=(http://soft.proindependent.com/src/qtiplot-$pkgver.tar.bz2
+ $pkgname.desktop
+ $pkgname.png
+ qtiplot.pro.archlinux
+ qwtplot3d_gcc.patch)
+md5sums=('15a62821f6f69086e685c271fb510bd4'
+ '56bd53f4f1367c285086acb969f13348'
+ 'ad8affbd6f0d5cbdcde46c923ee2668a'
+ '7af559c2986f5c65616331dc36859642'
+ 'ab02c436ec2c04b1838cb5517383b4eb')
-source=("http://soft.proindependent.com/src/qtiplot-$pkgver.tar.bz2" \
- "$pkgname.desktop" "$pkgname.png" "qtiplot.pro.archlinux"
- "qwtplot3d_gcc.patch" "scriptedit.patch")
-md5sums=('c923fb5c5f161e0d6cb31c3beebe6165' '56bd53f4f1367c285086acb969f13348'
- 'ad8affbd6f0d5cbdcde46c923ee2668a' '7af559c2986f5c65616331dc36859642'
- 'b326dec9d13f838293b982e76fe9d5d1' 'fd36e086195ca70b4628a14eb2ba4fcd')
-
build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ sed -i "s:elif:else:g" qtiplot/src/scripting/ScriptEdit.cpp
+ patch -Np1 -i ${srcdir}/qwtplot3d_gcc.patch || return 1
- cd ${srcdir}/${pkgname}-${pkgver}/qtiplot/src/scripting
- patch -Np0 -i ${srcdir}/scriptedit.patch || return 1
-
- cd ${srcdir}/${pkgname}-${pkgver}/3rdparty/qwtplot3d/src
- patch -Np0 -i ${srcdir}/qwtplot3d_gcc.patch || return 1
-
cd ${srcdir}/${pkgname}-${pkgver}/${pkgname}
install -Dm644 ${srcdir}/qtiplot.pro.archlinux qtiplot.pro
@@ -48,3 +47,4 @@
install -D -m644 ${srcdir}/${pkgname}.desktop \
${pkgdir}/usr/share/applications/${pkgname}.desktop || return 1
}
+
Deleted: dynamicgsl.patch
===================================================================
--- dynamicgsl.patch 2009-07-25 17:39:35 UTC (rev 47728)
+++ dynamicgsl.patch 2009-07-25 19:50:56 UTC (rev 47729)
@@ -1,87 +0,0 @@
-diff -Naur fitPlugins/exp_saturation/exp_saturation.pro fitPlugins.new/exp_saturation/exp_saturation.pro
---- fitPlugins/exp_saturation/exp_saturation.pro 2008-11-05 00:06:49.884616891 +0100
-+++ fitPlugins.new/exp_saturation/exp_saturation.pro 2008-11-05 00:08:51.259644717 +0100
-@@ -12,12 +12,13 @@
- DESTDIR = ../
-
- # statically link against GSL in 3rdparty
--INCLUDEPATH += ../../3rdparty/gsl/include/
--LIBS += ../../3rdparty/gsl/lib/libgsl.a
--LIBS += ../../3rdparty/gsl/lib/libgslcblas.a
-+#INCLUDEPATH += ../../3rdparty/gsl/include/
-+#LIBS += ../../3rdparty/gsl/lib/libgsl.a
-+#LIBS += ../../3rdparty/gsl/lib/libgslcblas.a
-
- #dynamically link against GSL installed system-wide
--#unix:LIBS += -L /usr/lib$${libsuff} -lgsl -lgslcblas
-+INCLUDEPATH += /usr/include/gsl
-+unix:LIBS += $$system(pkg-config --libs gsl)
-
- target.path=/usr/lib$${libsuff}/qtiplot/plugins
- INSTALLS += target
-diff -Naur fitPlugins/explin/explin.pro fitPlugins.new/explin/explin.pro
---- fitPlugins/explin/explin.pro 2008-10-13 09:43:31.000000000 +0200
-+++ fitPlugins.new/explin/explin.pro 2008-11-05 00:09:13.118018704 +0100
-@@ -12,12 +12,13 @@
- DESTDIR = ../
-
- # statically link against GSL in 3rdparty
--INCLUDEPATH += ../../3rdparty/gsl/include/
--LIBS += ../../3rdparty/gsl/lib/libgsl.a
--LIBS += ../../3rdparty/gsl/lib/libgslcblas.a
-+#INCLUDEPATH += ../../3rdparty/gsl/include/
-+#LIBS += ../../3rdparty/gsl/lib/libgsl.a
-+#LIBS += ../../3rdparty/gsl/lib/libgslcblas.a
-
- #dynamically link against GSL installed system-wide
--#unix:LIBS += -L /usr/lib$${libsuff} -lgsl -lgslcblas
-+INCLUDEPATH += /usr/include/gsl
-+unix:LIBS += $$system(pkg-config --libs gsl)
-
- target.path=/usr/lib$${libsuff}/qtiplot/plugins
- INSTALLS += target
-diff -Naur fitPlugins/fitRational0/fitRational0.pro fitPlugins.new/fitRational0/fitRational0.pro
---- fitPlugins/fitRational0/fitRational0.pro 2008-10-13 18:14:52.000000000 +0200
-+++ fitPlugins.new/fitRational0/fitRational0.pro 2008-11-05 00:09:28.755220241 +0100
-@@ -12,14 +12,15 @@
- DESTDIR = ../
-
- # statically link against GSL in 3rdparty
--INCLUDEPATH += ../../3rdparty/gsl/include/
--LIBS += ../../3rdparty/gsl/lib/libgsl.a
--LIBS += ../../3rdparty/gsl/lib/libgslcblas.a
-+#INCLUDEPATH += ../../3rdparty/gsl/include/
-+#LIBS += ../../3rdparty/gsl/lib/libgsl.a
-+#LIBS += ../../3rdparty/gsl/lib/libgslcblas.a
-
- #dynamically link against GSL installed system-wide
--#unix:LIBS += -L /usr/lib$${libsuff} -lgsl -lgslcblas
-+INCLUDEPATH += /usr/include/gsl
-+unix:LIBS += $$system(pkg-config --libs gsl)
-
- target.path=/usr/lib$${libsuff}/qtiplot/plugins
- INSTALLS += target
-
--SOURCES += fitRational0.cpp
-+SOURCES += fitRational0.cpp
-diff -Naur fitPlugins/fitRational1/fitRational1.pro fitPlugins.new/fitRational1/fitRational1.pro
---- fitPlugins/fitRational1/fitRational1.pro 2007-10-29 00:44:06.000000000 +0100
-+++ fitPlugins.new/fitRational1/fitRational1.pro 2008-11-05 00:09:42.154619945 +0100
-@@ -12,12 +12,13 @@
- DESTDIR = ../
-
- # statically link against GSL in 3rdparty
--INCLUDEPATH += ../../3rdparty/gsl/include/
--LIBS += ../../3rdparty/gsl/lib/libgsl.a
--LIBS += ../../3rdparty/gsl/lib/libgslcblas.a
-+#INCLUDEPATH += ../../3rdparty/gsl/include/
-+#LIBS += ../../3rdparty/gsl/lib/libgsl.a
-+#LIBS += ../../3rdparty/gsl/lib/libgslcblas.a
-
- #dynamically link against GSL installed system-wide
--#unix:LIBS += -L /usr/lib$${libsuff} -lgsl -lgslcblas
-+INCLUDEPATH += /usr/include/gsl
-+unix:LIBS += $$system(pkg-config --libs gsl)
-
- target.path=/usr/lib$${libsuff}/qtiplot/plugins
- INSTALLS += target
Deleted: qtiplot-gcc4.3.patch
===================================================================
--- qtiplot-gcc4.3.patch 2009-07-25 17:39:35 UTC (rev 47728)
+++ qtiplot-gcc4.3.patch 2009-07-25 19:50:56 UTC (rev 47729)
@@ -1,15 +0,0 @@
-# patch needed for providing the proper includes needed for
-# gcc-4.3 (08/25/2008)
-
-diff -Naur qtiplot-0.9.7/qtiplot/src/plot2D/ScaleEngine.cpp qtiplot-0.9.7.new/qtiplot/src/plot2D/ScaleEngine.cpp
---- src/plot2D/ScaleEngine.cpp 2008-06-12 13:19:20.000000000 -0400
-+++ src/plot2D/ScaleEngine.cpp 2008-08-25 18:38:35.000000000 -0400
-@@ -27,6 +27,7 @@
- * *
- ***************************************************************************/
- #include "ScaleEngine.h"
-+#include <limits.h>
-
- QwtScaleTransformation* ScaleEngine::transformation() const
- {
-
Modified: qwtplot3d_gcc.patch
===================================================================
--- qwtplot3d_gcc.patch 2009-07-25 17:39:35 UTC (rev 47728)
+++ qwtplot3d_gcc.patch 2009-07-25 19:50:56 UTC (rev 47729)
@@ -1,5 +1,5 @@
---- qwt3d_function.cpp.old 2009-05-10 17:21:41.757091214 +0200
-+++ qwt3d_function.cpp 2009-05-10 17:21:00.747097116 +0200
+--- a/3rdparty/qwtplot3d/src/qwt3d_function.cpp 2009-07-25 20:03:28.000000000 -0700
++++ b/3rdparty/qwtplot3d/src/qwt3d_function.cpp 2009-07-25 20:03:28.000000000 -0700
@@ -1,5 +1,6 @@
#include "qwt3d_surfaceplot.h"
#include "qwt3d_function.h"
Deleted: scriptedit.patch
===================================================================
--- scriptedit.patch 2009-07-25 17:39:35 UTC (rev 47728)
+++ scriptedit.patch 2009-07-25 19:50:56 UTC (rev 47729)
@@ -1,427 +0,0 @@
---- ScriptEdit.cpp.bak 2009-05-13 23:14:51.109362860 +0200
-+++ ScriptEdit.cpp 2009-05-13 23:14:58.482710429 +0200
-@@ -30,7 +30,7 @@
- #include "Note.h"
- #include "PythonSyntaxHighlighter.h"
- #include "FindReplaceDialog.h"
--#include <ApplicationWindow.h>
-+#include <ApplicationWindow.h>
-
- #include <QAction>
- #include <QMenu>
-@@ -39,13 +39,13 @@
- #include <QMessageBox>
- #include <QFileDialog>
- #include <QTextStream>
--#include <QApplication>
--#include <QCompleter>
-+#include <QApplication>
-+#include <QCompleter>
- #include <QAbstractItemView>
--#include <QScrollBar>
-+#include <QScrollBar>
- #include <QStringListModel>
--#include <QShortcut>
--#include <QDockWidget>
-+#include <QShortcut>
-+#include <QDockWidget>
-
- ScriptEdit::ScriptEdit(ScriptingEnv *env, QWidget *parent, const char *name)
- : QTextEdit(parent, name), scripted(env), d_error(false), d_completer(0),
-@@ -147,69 +147,69 @@
- connect(myScript, SIGNAL(error(const QString&, const QString&, int)), this, SLOT(insertErrorMsg(const QString&)));
- connect(myScript, SIGNAL(print(const QString&)), this, SLOT(scriptPrint(const QString&)));
-
-- #ifdef SCRIPTING_PYTHON
-- if (d_highlighter)
-- delete d_highlighter;
--
-- if (scriptEnv->name() == QString("Python"))
-- d_highlighter = new PythonSyntaxHighlighter(this);
-- else
-+ #ifdef SCRIPTING_PYTHON
-+ if (d_highlighter)
-+ delete d_highlighter;
-+
-+ if (scriptEnv->name() == QString("Python"))
-+ d_highlighter = new PythonSyntaxHighlighter(this);
-+ else
- d_highlighter = 0;
- #endif
- }
- }
--
--void ScriptEdit::focusInEvent(QFocusEvent *e)
--{
-- if (d_completer)
-- d_completer->setWidget(this);
-- QTextEdit::focusInEvent(e);
--}
-+
-+void ScriptEdit::focusInEvent(QFocusEvent *e)
-+{
-+ if (d_completer)
-+ d_completer->setWidget(this);
-+ QTextEdit::focusInEvent(e);
-+}
-
- void ScriptEdit::keyPressEvent(QKeyEvent *e)
--{
-- if (d_completer && d_completer->popup()->isVisible()) {
-- // The following keys are forwarded by the completer to the widget
-- switch (e->key()) {
-- case Qt::Key_Enter:
-- case Qt::Key_Return:
-- case Qt::Key_Escape:
-- case Qt::Key_Tab:
-- case Qt::Key_Backtab:
-- e->ignore();
-- return; // let the completer do default behavior
-- default:
-- break;
-- }
-- }
--
-- QTextEdit::keyPressEvent(e);
-- if (d_completer && !d_completer->popup()->isVisible() && e->key() == Qt::Key_Return)
-- updateIndentation();
--
-- bool isShortcut = ((e->modifiers() & Qt::ControlModifier) && e->key() == Qt::Key_U); // CTRL+U
-- const bool ctrlOrShift = e->modifiers() & (Qt::ControlModifier | Qt::ShiftModifier);
-- if (!d_completer || (ctrlOrShift && e->text().isEmpty()))
-- return;
--
-- static QString eow("~!@#$%^&*()_+{}|:\"<>?,./;'[]\\-="); // end of word
-- bool hasModifier = (e->modifiers() != Qt::NoModifier) && !ctrlOrShift;
-- QString completionPrefix = textUnderCursor();
--
-- if (!isShortcut && (hasModifier || e->text().isEmpty()|| completionPrefix.length() < 2
-- || eow.contains(e->text().right(1)))) {
-- d_completer->popup()->hide();
-- return;
-- }
--
-- if (completionPrefix != d_completer->completionPrefix()) {
-- d_completer->setCompletionPrefix(completionPrefix);
-- d_completer->popup()->setCurrentIndex(d_completer->completionModel()->index(0, 0));
-- }
--
-- QRect cr = cursorRect();
-- cr.setWidth(d_completer->popup()->sizeHintForColumn(0)
-- + d_completer->popup()->verticalScrollBar()->sizeHint().width());
-+{
-+ if (d_completer && d_completer->popup()->isVisible()) {
-+ // The following keys are forwarded by the completer to the widget
-+ switch (e->key()) {
-+ case Qt::Key_Enter:
-+ case Qt::Key_Return:
-+ case Qt::Key_Escape:
-+ case Qt::Key_Tab:
-+ case Qt::Key_Backtab:
-+ e->ignore();
-+ return; // let the completer do default behavior
-+ default:
-+ break;
-+ }
-+ }
-+
-+ QTextEdit::keyPressEvent(e);
-+ if (d_completer && !d_completer->popup()->isVisible() && e->key() == Qt::Key_Return)
-+ updateIndentation();
-+
-+ bool isShortcut = ((e->modifiers() & Qt::ControlModifier) && e->key() == Qt::Key_U); // CTRL+U
-+ const bool ctrlOrShift = e->modifiers() & (Qt::ControlModifier | Qt::ShiftModifier);
-+ if (!d_completer || (ctrlOrShift && e->text().isEmpty()))
-+ return;
-+
-+ static QString eow("~!@#$%^&*()_+{}|:\"<>?,./;'[]\\-="); // end of word
-+ bool hasModifier = (e->modifiers() != Qt::NoModifier) && !ctrlOrShift;
-+ QString completionPrefix = textUnderCursor();
-+
-+ if (!isShortcut && (hasModifier || e->text().isEmpty()|| completionPrefix.length() < 2
-+ || eow.contains(e->text().right(1)))) {
-+ d_completer->popup()->hide();
-+ return;
-+ }
-+
-+ if (completionPrefix != d_completer->completionPrefix()) {
-+ d_completer->setCompletionPrefix(completionPrefix);
-+ d_completer->popup()->setCurrentIndex(d_completer->completionModel()->index(0, 0));
-+ }
-+
-+ QRect cr = cursorRect();
-+ cr.setWidth(d_completer->popup()->sizeHintForColumn(0)
-+ + d_completer->popup()->verticalScrollBar()->sizeHint().width());
- d_completer->complete(cr); // popup it up!
- }
-
-@@ -285,20 +285,20 @@
- {
- QString err = message;
- err.prepend("\n").replace("\n","\n#> ");
--
--#ifdef SCRIPTING_CONSOLE
-- QTextEdit *console = scriptEnv->application()->scriptingConsole();
-- console->setPlainText(err);
-- if (!console->isVisible())
-- ((QDockWidget *)console->parent())->show();
--#elif
-- int start = printCursor.position();
-- printCursor.insertText(err);
-- printCursor.setPosition(start, QTextCursor::KeepAnchor);
-- setTextCursor(printCursor);
--#endif
-
-- d_error = true;
-+#ifdef SCRIPTING_CONSOLE
-+ QTextEdit *console = scriptEnv->application()->scriptingConsole();
-+ console->setPlainText(err);
-+ if (!console->isVisible())
-+ ((QDockWidget *)console->parent())->show();
-+#else
-+ int start = printCursor.position();
-+ printCursor.insertText(err);
-+ printCursor.setPosition(start, QTextCursor::KeepAnchor);
-+ setTextCursor(printCursor);
-+#endif
-+
-+ d_error = true;
- d_err_message = message;
- }
-
-@@ -339,8 +339,8 @@
- }
-
- void ScriptEdit::execute()
--{
-- clearErrorHighlighting();
-+{
-+ clearErrorHighlighting();
-
- QString fname = "<%1:%2>";
- fname = fname.arg(name());
-@@ -348,7 +348,7 @@
- if (codeCursor.selectedText().isEmpty()){
- codeCursor.movePosition(QTextCursor::StartOfLine, QTextCursor::MoveAnchor);
- codeCursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor);
-- }
-+ }
- int startLineNumber = lineNumber(codeCursor.selectionStart());
- fname = fname.arg(startLineNumber);
-
-@@ -363,8 +363,8 @@
- }
-
- void ScriptEdit::executeAll()
--{
-- clearErrorHighlighting();
-+{
-+ clearErrorHighlighting();
-
- QString fname = "<%1>";
- fname = fname.arg(name());
-@@ -377,8 +377,8 @@
- }
-
- void ScriptEdit::evaluate()
--{
-- clearErrorHighlighting();
-+{
-+ clearErrorHighlighting();
-
- QString fname = "<%1:%2>";
- fname = fname.arg(name());
-@@ -386,7 +386,7 @@
- if (codeCursor.selectedText().isEmpty()){
- codeCursor.movePosition(QTextCursor::StartOfLine, QTextCursor::MoveAnchor);
- codeCursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor);
-- }
-+ }
- int startLineNumber = lineNumber(codeCursor.selectionStart());
- fname = fname.arg(startLineNumber);
-
-@@ -406,7 +406,7 @@
- if (!strVal.isEmpty())
- printCursor.insertText("#> " + strVal + "\n");
- }
--
-+
- highlightErrorLine(startLineNumber - 2);//we need to substract a line due to __doit__ line prepended to Python scripts.
- d_error = false;
- }
-@@ -463,16 +463,16 @@
- clear();
- QTextStream ts(&file);
- ts.setEncoding(QTextStream::UnicodeUTF8);
--
-- QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
-- qApp->processEvents(QEventLoop::ExcludeUserInput);
--
-- blockSignals(true);
-- insertPlainText(ts.readAll());
-- blockSignals(false);
-- textChanged();
-
-- file.close();
-+ QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
-+ qApp->processEvents(QEventLoop::ExcludeUserInput);
-+
-+ blockSignals(true);
-+ insertPlainText(ts.readAll());
-+ blockSignals(false);
-+ textChanged();
-+
-+ file.close();
- QApplication::restoreOverrideCursor();
- return f;
- }
-@@ -555,40 +555,40 @@
-
- scriptsDirPath = path;
- }
--
-- void ScriptEdit::setCompleter(QCompleter *completer)
-- {
-- if (d_completer)
-- QObject::disconnect(d_completer, 0, this, 0);
--
-- d_completer = completer;
--
-- if (!d_completer)
-- return;
--
-- d_completer->setWidget(this);
-- QObject::connect(d_completer, SIGNAL(activated(const QString&)),
-- this, SLOT(insertCompletion(const QString&)));
-- }
--
-- void ScriptEdit::insertCompletion(const QString& completion)
-- {
-- if (d_completer->widget() != this)
-+
-+ void ScriptEdit::setCompleter(QCompleter *completer)
-+ {
-+ if (d_completer)
-+ QObject::disconnect(d_completer, 0, this, 0);
-+
-+ d_completer = completer;
-+
-+ if (!d_completer)
-+ return;
-+
-+ d_completer->setWidget(this);
-+ QObject::connect(d_completer, SIGNAL(activated(const QString&)),
-+ this, SLOT(insertCompletion(const QString&)));
-+ }
-+
-+ void ScriptEdit::insertCompletion(const QString& completion)
-+ {
-+ if (d_completer->widget() != this)
- return;
-
-- QTextCursor tc = textCursor();
-- int extra = completion.length() - d_completer->completionPrefix().length();
-- tc.movePosition(QTextCursor::Left);
-- tc.movePosition(QTextCursor::EndOfWord);
-- tc.insertText(completion.right(extra));
-- setTextCursor(tc);
-- }
--
-- QString ScriptEdit::textUnderCursor() const
-- {
-- QTextCursor tc = textCursor();
-- tc.select(QTextCursor::WordUnderCursor);
-- return tc.selectedText();
-+ QTextCursor tc = textCursor();
-+ int extra = completion.length() - d_completer->completionPrefix().length();
-+ tc.movePosition(QTextCursor::Left);
-+ tc.movePosition(QTextCursor::EndOfWord);
-+ tc.insertText(completion.right(extra));
-+ setTextCursor(tc);
-+ }
-+
-+ QString ScriptEdit::textUnderCursor() const
-+ {
-+ QTextCursor tc = textCursor();
-+ tc.select(QTextCursor::WordUnderCursor);
-+ return tc.selectedText();
- }
-
-
-@@ -660,41 +660,41 @@
- else
- showFindDialog();
- }
--
--void ScriptEdit::clearErrorHighlighting()
--{
-- QTextCursor codeCursor = textCursor();
-- codeCursor.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor);
-- codeCursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor);
-- codeCursor.mergeBlockFormat(d_fmt_default);
--}
--
--void ScriptEdit::highlightErrorLine(int offset)
--{
-- if (!d_error)
-- return;
--
-- QTextCursor codeCursor = textCursor();
-- codeCursor.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor);
--
-- if (scriptEnv->name() == QString("Python")){
-- QRegExp rx("<*>:(\\d+)");
-- rx.indexIn(d_err_message);
-- QStringList list = rx.capturedTexts();
-- int lineNumber = 0;
-- if (!list.isEmpty())
-- lineNumber = list.last().toInt();
--
-- codeCursor.movePosition(QTextCursor::Down, QTextCursor::MoveAnchor, offset + lineNumber - 1);
-- codeCursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor);
-- } else
-- codeCursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor);
--
-- QTextBlockFormat d_fmt_failure;
-- d_fmt_failure.setBackground(QBrush(QColor(255,128,128)));
-- codeCursor.mergeBlockFormat(d_fmt_failure);
-- setTextCursor(codeCursor);
--}
-+
-+void ScriptEdit::clearErrorHighlighting()
-+{
-+ QTextCursor codeCursor = textCursor();
-+ codeCursor.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor);
-+ codeCursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor);
-+ codeCursor.mergeBlockFormat(d_fmt_default);
-+}
-+
-+void ScriptEdit::highlightErrorLine(int offset)
-+{
-+ if (!d_error)
-+ return;
-+
-+ QTextCursor codeCursor = textCursor();
-+ codeCursor.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor);
-+
-+ if (scriptEnv->name() == QString("Python")){
-+ QRegExp rx("<*>:(\\d+)");
-+ rx.indexIn(d_err_message);
-+ QStringList list = rx.capturedTexts();
-+ int lineNumber = 0;
-+ if (!list.isEmpty())
-+ lineNumber = list.last().toInt();
-+
-+ codeCursor.movePosition(QTextCursor::Down, QTextCursor::MoveAnchor, offset + lineNumber - 1);
-+ codeCursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor);
-+ } else
-+ codeCursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor);
-+
-+ QTextBlockFormat d_fmt_failure;
-+ d_fmt_failure.setBackground(QBrush(QColor(255,128,128)));
-+ codeCursor.mergeBlockFormat(d_fmt_failure);
-+ setTextCursor(codeCursor);
-+}
-
- ScriptEdit::~ScriptEdit()
- {
More information about the arch-commits
mailing list