Skip to content

Commit

Permalink
Fixed uninstalling redirection from python console
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8498 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed May 23, 2008
1 parent 05c7ae3 commit be58c26
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
10 changes: 9 additions & 1 deletion src/app/qgspythondialog.cpp
Expand Up @@ -17,6 +17,8 @@
#include "qgspythondialog.h"
#include "qgspythonutils.h"

#include <QCloseEvent>

QgsPythonDialog::QgsPythonDialog(QgisInterface* pIface, QWidget *parent)
: QDialog(parent)
{
Expand All @@ -28,7 +30,6 @@ QgsPythonDialog::QgsPythonDialog(QgisInterface* pIface, QWidget *parent)

QgsPythonDialog::~QgsPythonDialog()
{
QgsPythonUtils::uninstallConsoleHooks();
}

QString QgsPythonDialog::escapeHtml(QString text)
Expand Down Expand Up @@ -72,3 +73,10 @@ void QgsPythonDialog::on_edtCmdLine_returnPressed()
txtHistory->moveCursor(QTextCursor::End);
txtHistory->ensureCursorVisible();
}

void QgsPythonDialog::closeEvent(QCloseEvent* event)
{
QgsPythonUtils::uninstallConsoleHooks();

QDialog::closeEvent(event);
}
5 changes: 5 additions & 0 deletions src/app/qgspythondialog.h
Expand Up @@ -20,6 +20,7 @@
#include "ui_qgspythondialog.h"

class QgisInterface;
class QCloseEvent;

class QgsPythonDialog : public QDialog, private Ui::QgsPythonDialog
{
Expand All @@ -36,6 +37,10 @@ class QgsPythonDialog : public QDialog, private Ui::QgsPythonDialog

void on_edtCmdLine_returnPressed();

protected:

void closeEvent(QCloseEvent* event);

private:

QgisInterface* mIface;
Expand Down
4 changes: 0 additions & 4 deletions src/app/qgspythonutils.cpp
Expand Up @@ -150,10 +150,6 @@ void QgsPythonUtils::uninstallConsoleHooks()
{
runString("sys.displayhook = sys.__displayhook__");
runString("sys.stdout = _old_stdout");

// TODO: uninstalling stdout redirection doesn't work

//installErrorHook();
}


Expand Down

0 comments on commit be58c26

Please sign in to comment.