forked from qt-creator/qt-creator
Valgrind fixes.
In Debugger and WelcomePageWidget. Reviewed-by: Daniel Molkentin <daniel.molkentin@trolltech.com>
This commit is contained in:
@@ -230,6 +230,7 @@ public:
|
|||||||
m_startParameters(sp),
|
m_startParameters(sp),
|
||||||
m_state(DebuggerNotReady),
|
m_state(DebuggerNotReady),
|
||||||
m_lastGoodState(DebuggerNotReady),
|
m_lastGoodState(DebuggerNotReady),
|
||||||
|
m_targetState(DebuggerNotReady),
|
||||||
m_breakHandler(engine),
|
m_breakHandler(engine),
|
||||||
m_commandHandler(engine),
|
m_commandHandler(engine),
|
||||||
m_modulesHandler(engine),
|
m_modulesHandler(engine),
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
#include <QtCore/QTimer>
|
#include <QtCore/QTimer>
|
||||||
#include <QtCore/QSettings>
|
#include <QtCore/QSettings>
|
||||||
#include <QtCore/QXmlStreamReader>
|
#include <QtCore/QXmlStreamReader>
|
||||||
|
#include <QtCore/QScopedPointer>
|
||||||
#include <QtGui/QDialogButtonBox>
|
#include <QtGui/QDialogButtonBox>
|
||||||
#include <QtGui/QFont>
|
#include <QtGui/QFont>
|
||||||
#include <QtGui/QMessageBox>
|
#include <QtGui/QMessageBox>
|
||||||
@@ -169,7 +170,7 @@ void GettingStartedWelcomePageWidget::updateExamples(const QString &examplePath,
|
|||||||
QMenu *cppMenu = new QMenu(ui->cppExamplesButton);
|
QMenu *cppMenu = new QMenu(ui->cppExamplesButton);
|
||||||
ui->cppExamplesButton->setMenu(cppMenu);
|
ui->cppExamplesButton->setMenu(cppMenu);
|
||||||
|
|
||||||
QMenu *subMenu = 0;
|
QScopedPointer<QMenu> subMenu;
|
||||||
bool inExamples = false;
|
bool inExamples = false;
|
||||||
QString dirName;
|
QString dirName;
|
||||||
QXmlStreamReader reader(&description);
|
QXmlStreamReader reader(&description);
|
||||||
@@ -182,7 +183,7 @@ void GettingStartedWelcomePageWidget::updateExamples(const QString &examplePath,
|
|||||||
if (name.contains(QLatin1String("tutorial")))
|
if (name.contains(QLatin1String("tutorial")))
|
||||||
break;
|
break;
|
||||||
dirName = reader.attributes().value(QLatin1String("dirname")).toString();
|
dirName = reader.attributes().value(QLatin1String("dirname")).toString();
|
||||||
subMenu = new QMenu(name);
|
subMenu.reset(new QMenu(name));
|
||||||
inExamples = true;
|
inExamples = true;
|
||||||
}
|
}
|
||||||
if (inExamples && reader.name() == QLatin1String("example")) {
|
if (inExamples && reader.name() == QLatin1String("example")) {
|
||||||
@@ -218,11 +219,8 @@ void GettingStartedWelcomePageWidget::updateExamples(const QString &examplePath,
|
|||||||
break;
|
break;
|
||||||
case QXmlStreamReader::EndElement:
|
case QXmlStreamReader::EndElement:
|
||||||
if (reader.name() == QLatin1String("category")) {
|
if (reader.name() == QLatin1String("category")) {
|
||||||
if (subMenu->actions().isEmpty())
|
if (!subMenu->actions().isEmpty())
|
||||||
delete subMenu;
|
cppMenu->addMenu(subMenu.take());
|
||||||
else
|
|
||||||
cppMenu->addMenu(subMenu);
|
|
||||||
|
|
||||||
inExamples = false;
|
inExamples = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user