summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2008-02-14 20:06:05 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2008-02-14 20:06:05 (GMT)
commit7b1c305d864977a524e21b7b837a8582eb487d7c (patch)
tree655460344db194ce78c8adfd3ac55341edfcde87 /Source
parentb459ec9f57c8b0f8a03665f50a4ac3ded02b12da (diff)
downloadCMake-7b1c305d864977a524e21b7b837a8582eb487d7c.zip
CMake-7b1c305d864977a524e21b7b837a8582eb487d7c.tar.gz
CMake-7b1c305d864977a524e21b7b837a8582eb487d7c.tar.bz2
ENH: make sure html < > & stuff is escaped for the output window
Diffstat (limited to 'Source')
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx20
-rw-r--r--Source/QtDialog/CMakeSetupDialog.h1
2 files changed, 19 insertions, 2 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 7b61cf8..090a137 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -16,7 +16,6 @@
=========================================================================*/
#include "CMakeSetupDialog.h"
-
#include <QFileDialog>
#include <QProgressBar>
#include <QMessageBox>
@@ -177,7 +176,7 @@ void CMakeSetupDialog::initialize()
QObject::connect(this->CMakeThread->cmakeInstance(),
SIGNAL(outputMessage(QString)),
- this->Output, SLOT(append(QString)));
+ this, SLOT(message(QString)));
QObject::connect(this->Advanced, SIGNAL(clicked(bool)),
this->CacheValues, SLOT(setShowAdvanced(bool)));
@@ -467,10 +466,27 @@ void CMakeSetupDialog::error(const QString& message)
QStringList messages = message.split('\n');
foreach(QString m, messages)
{
+ // make sure we escape html tags in the cmake messages
+ m.replace(QString("&"), QString("&amp;"));
+ m.replace(QString("<"), QString("&lt;"));
+ m.replace(QString(">"), QString("&gt;"));
this->Output->append(QString("<b><font color=red>%1</font></b>").arg(m));
}
}
+void CMakeSetupDialog::message(const QString& message)
+{
+ QStringList messages = message.split('\n');
+ foreach(QString m, messages)
+ {
+ // make sure we escape html tags in the cmake messages
+ m.replace(QString("&"), QString("&amp;"));
+ m.replace(QString("<"), QString("&lt;"));
+ m.replace(QString(">"), QString("&gt;"));
+ this->Output->append(m);
+ }
+}
+
void CMakeSetupDialog::setEnabledState(bool enabled)
{
// disable parts of the GUI during configure/generate
diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h
index edbede6..652660a 100644
--- a/Source/QtDialog/CMakeSetupDialog.h
+++ b/Source/QtDialog/CMakeSetupDialog.h
@@ -50,6 +50,7 @@ protected slots:
void finishConfigure(int error);
void finishGenerate(int error);
void error(const QString& message);
+ void message(const QString& message);
void doSourceBrowse();
void doBinaryBrowse();