Fixed uninstalling redirection from python console

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8498 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
wonder 2008-05-23 15:35:29 +00:00
parent 05c7ae30b3
commit be58c264cf
3 changed files with 14 additions and 5 deletions

View File

@ -17,6 +17,8 @@
#include "qgspythondialog.h"
#include "qgspythonutils.h"
#include <QCloseEvent>
QgsPythonDialog::QgsPythonDialog(QgisInterface* pIface, QWidget *parent)
: QDialog(parent)
{
@ -28,7 +30,6 @@ QgsPythonDialog::QgsPythonDialog(QgisInterface* pIface, QWidget *parent)
QgsPythonDialog::~QgsPythonDialog()
{
QgsPythonUtils::uninstallConsoleHooks();
}
QString QgsPythonDialog::escapeHtml(QString text)
@ -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);
}

View File

@ -20,6 +20,7 @@
#include "ui_qgspythondialog.h"
class QgisInterface;
class QCloseEvent;
class QgsPythonDialog : public QDialog, private Ui::QgsPythonDialog
{
@ -36,6 +37,10 @@ class QgsPythonDialog : public QDialog, private Ui::QgsPythonDialog
void on_edtCmdLine_returnPressed();
protected:
void closeEvent(QCloseEvent* event);
private:
QgisInterface* mIface;

View File

@ -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();
}