Debugger: Modernize

Mostly nullptr instead of 0, but also a few bits of collateral damage.

Change-Id: I921991272aca921dcdecf302dfff3716e79dfc24
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2018-02-01 10:59:24 +01:00
parent 7c41720479
commit 1b87d19a64
38 changed files with 155 additions and 165 deletions

View File

@@ -37,7 +37,7 @@ class DEBUGGER_EXPORT DetailedErrorView : public QTreeView
Q_OBJECT Q_OBJECT
public: public:
DetailedErrorView(QWidget *parent = 0); DetailedErrorView(QWidget *parent = nullptr);
~DetailedErrorView(); ~DetailedErrorView();
void goNext(); void goNext();

View File

@@ -40,7 +40,7 @@ class DEBUGGER_EXPORT StartRemoteDialog : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit StartRemoteDialog(QWidget *parent = 0); explicit StartRemoteDialog(QWidget *parent = nullptr);
~StartRemoteDialog() override; ~StartRemoteDialog() override;
ProjectExplorer::StandardRunnable runnable() const; ProjectExplorer::StandardRunnable runnable() const;

View File

@@ -304,7 +304,7 @@ class BreakpointDialog : public QDialog
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::BreakHandler) Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::BreakHandler)
public: public:
explicit BreakpointDialog(Breakpoint b, QWidget *parent = 0); explicit BreakpointDialog(Breakpoint b, QWidget *parent = nullptr);
bool showDialog(BreakpointParameters *data, BreakpointParts *parts); bool showDialog(BreakpointParameters *data, BreakpointParts *parts);
void setParameters(const BreakpointParameters &data); void setParameters(const BreakpointParameters &data);
@@ -850,7 +850,7 @@ class MultiBreakPointsDialog : public QDialog
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::BreakHandler) Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::BreakHandler)
public: public:
MultiBreakPointsDialog(QWidget *parent = 0); MultiBreakPointsDialog(QWidget *parent = nullptr);
QString condition() const { return m_lineEditCondition->text(); } QString condition() const { return m_lineEditCondition->text(); }
int ignoreCount() const { return m_spinBoxIgnoreCount->value(); } int ignoreCount() const { return m_spinBoxIgnoreCount->value(); }

View File

@@ -154,7 +154,7 @@ static const char localsPrefixC[] = "local.";
struct MemoryViewCookie struct MemoryViewCookie
{ {
explicit MemoryViewCookie(MemoryAgent *a = 0, quint64 addr = 0, quint64 l = 0) explicit MemoryViewCookie(MemoryAgent *a = nullptr, quint64 addr = 0, quint64 l = 0)
: agent(a), address(addr), length(l) : agent(a), address(addr), length(l)
{} {}
@@ -2735,7 +2735,7 @@ CdbEngine::NormalizedSourceFileName CdbEngine::sourceMapNormalizeFileNameFromDeb
// Parse frame from GDBMI. Duplicate of the gdb code, but that // Parse frame from GDBMI. Duplicate of the gdb code, but that
// has more processing. // has more processing.
static StackFrames parseFrames(const GdbMi &gdbmi, bool *incomplete = 0) static StackFrames parseFrames(const GdbMi &gdbmi, bool *incomplete = nullptr)
{ {
if (incomplete) if (incomplete)
*incomplete = false; *incomplete = false;

View File

@@ -80,12 +80,12 @@ CdbBreakEventWidget::CdbBreakEventWidget(QWidget *parent) : QWidget(parent)
QHBoxLayout *mainLayout = new QHBoxLayout; QHBoxLayout *mainLayout = new QHBoxLayout;
mainLayout->setMargin(0); mainLayout->setMargin(0);
QVBoxLayout *leftLayout = new QVBoxLayout; QVBoxLayout *leftLayout = new QVBoxLayout;
QFormLayout *parameterLayout = 0; QFormLayout *parameterLayout = nullptr;
mainLayout->addLayout(leftLayout); mainLayout->addLayout(leftLayout);
const size_t eventCount = sizeof(eventDescriptions) / sizeof(EventsDescription); const size_t eventCount = sizeof(eventDescriptions) / sizeof(EventsDescription);
for (size_t e = 0; e < eventCount; e++) { for (size_t e = 0; e < eventCount; e++) {
QCheckBox *cb = new QCheckBox(tr(eventDescriptions[e].description)); QCheckBox *cb = new QCheckBox(tr(eventDescriptions[e].description));
QLineEdit *le = 0; QLineEdit *le = nullptr;
if (eventDescriptions[e].hasParameter) { if (eventDescriptions[e].hasParameter) {
if (!parameterLayout) { if (!parameterLayout) {
parameterLayout = new QFormLayout; parameterLayout = new QFormLayout;
@@ -245,7 +245,7 @@ public:
CdbSymbolPathListEditor *m_symbolPathListEditor; CdbSymbolPathListEditor *m_symbolPathListEditor;
Utils::PathListEditor *m_sourcePathListEditor; Utils::PathListEditor *m_sourcePathListEditor;
CdbPathsPageWidget(QWidget *parent = 0); CdbPathsPageWidget(QWidget *parent = nullptr);
}; };
CdbPathsPageWidget::CdbPathsPageWidget(QWidget *parent) : CdbPathsPageWidget::CdbPathsPageWidget(QWidget *parent) :

View File

@@ -53,7 +53,7 @@ class CdbBreakEventWidget : public QWidget
Q_OBJECT Q_OBJECT
public: public:
explicit CdbBreakEventWidget(QWidget *parent = 0); explicit CdbBreakEventWidget(QWidget *parent = nullptr);
void setBreakEvents(const QStringList &l); void setBreakEvents(const QStringList &l);
QStringList breakEvents() const; QStringList breakEvents() const;
@@ -71,7 +71,7 @@ class CdbOptionsPageWidget : public QWidget
Q_OBJECT Q_OBJECT
public: public:
explicit CdbOptionsPageWidget(QWidget *parent = 0); explicit CdbOptionsPageWidget(QWidget *parent = nullptr);
QStringList breakEvents() const; QStringList breakEvents() const;
Utils::SavedActionSet group; Utils::SavedActionSet group;

View File

@@ -66,7 +66,7 @@ QString cdbClearBreakpointCommand(const BreakpointModelId &id);
// Parse extension command listing breakpoints. // Parse extension command listing breakpoints.
// Note that not all fields are returned, since file, line, function are encoded // Note that not all fields are returned, since file, line, function are encoded
// in the expression (that is in addition deleted on resolving for a bp-type breakpoint). // in the expression (that is in addition deleted on resolving for a bp-type breakpoint).
void parseBreakPoint(const GdbMi &gdbmi, BreakpointResponse *r, QString *expression = 0); void parseBreakPoint(const GdbMi &gdbmi, BreakpointResponse *r, QString *expression = nullptr);
// Write memory (f ...). // Write memory (f ...).
QString cdbWriteMemoryCommand(quint64 addr, const QByteArray &data); QString cdbWriteMemoryCommand(quint64 addr, const QByteArray &data);

View File

@@ -60,7 +60,7 @@ protected:
const QModelIndex &index) const; const QModelIndex &index) const;
private: private:
qreal layoutText(QTextLayout &tl, int width, bool *success = 0) const; qreal layoutText(QTextLayout &tl, int width, bool *success = nullptr) const;
private: private:
ConsoleItemModel *m_model; ConsoleItemModel *m_model;

View File

@@ -42,7 +42,7 @@ class ConsoleItemModel : public Utils::TreeModel<>
Q_OBJECT Q_OBJECT
public: public:
explicit ConsoleItemModel(QObject *parent = 0); explicit ConsoleItemModel(QObject *parent = nullptr);
void shiftEditableRow(); void shiftEditableRow();

View File

@@ -53,14 +53,16 @@ public:
ConsoleViewStyle(const QString &baseStyleName) : ManhattanStyle(baseStyleName) {} ConsoleViewStyle(const QString &baseStyleName) : ManhattanStyle(baseStyleName) {}
void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter,
const QWidget *widget = 0) const const QWidget *widget = nullptr) const final
{ {
if (element != QStyle::PE_PanelItemViewRow) if (element != QStyle::PE_PanelItemViewRow)
ManhattanStyle::drawPrimitive(element, option, painter, widget); ManhattanStyle::drawPrimitive(element, option, painter, widget);
} }
int styleHint(StyleHint hint, const QStyleOption *option = 0, const QWidget *widget = 0, int styleHint(StyleHint hint, const QStyleOption *option = nullptr,
QStyleHintReturn *returnData = 0) const { const QWidget *widget = nullptr,
QStyleHintReturn *returnData = nullptr) const final
{
if (hint == SH_ItemView_ShowDecorationSelected) if (hint == SH_ItemView_ShowDecorationSelected)
return 0; return 0;
else else

View File

@@ -106,7 +106,7 @@ DebuggerSettings::DebuggerSettings()
const QString debugModeGroup = QLatin1String(debugModeSettingsGroupC); const QString debugModeGroup = QLatin1String(debugModeSettingsGroupC);
const QString cdbSettingsGroup = QLatin1String(cdbSettingsGroupC); const QString cdbSettingsGroup = QLatin1String(cdbSettingsGroupC);
SavedAction *item = 0; SavedAction *item = nullptr;
item = new SavedAction(this); item = new SavedAction(this);
insertItem(SettingsDialog, item); insertItem(SettingsDialog, item);

View File

@@ -54,10 +54,10 @@ class DebuggerKitChooser : public ProjectExplorer::KitChooser
public: public:
enum Mode { AnyDebugging, LocalDebugging }; enum Mode { AnyDebugging, LocalDebugging };
explicit DebuggerKitChooser(Mode mode = AnyDebugging, QWidget *parent = 0); explicit DebuggerKitChooser(Mode mode = AnyDebugging, QWidget *parent = nullptr);
protected: protected:
QString kitToolTip(ProjectExplorer::Kit *k) const; QString kitToolTip(ProjectExplorer::Kit *k) const final;
private: private:
const ProjectExplorer::Abi m_hostAbi; const ProjectExplorer::Abi m_hostAbi;
@@ -127,8 +127,9 @@ private:
class AddressDialog : public QDialog class AddressDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit AddressDialog(QWidget *parent = 0); explicit AddressDialog(QWidget *parent = nullptr);
void setAddress(quint64 a); void setAddress(quint64 a);
quint64 address() const; quint64 address() const;

View File

@@ -73,7 +73,6 @@ class Breakpoint;
class QmlCppEngine; class QmlCppEngine;
class DebuggerToolTipContext; class DebuggerToolTipContext;
class MemoryViewSetupData; class MemoryViewSetupData;
class Terminal;
class TerminalRunner; class TerminalRunner;
class ThreadId; class ThreadId;
@@ -158,7 +157,7 @@ public:
bool isNativeMixedDebugging() const; bool isNativeMixedDebugging() const;
void validateExecutable(); void validateExecutable();
Utils::MacroExpander *macroExpander = 0; Utils::MacroExpander *macroExpander = nullptr;
// For Debugger testing. // For Debugger testing.
int testCase = 0; int testCase = 0;

View File

@@ -97,11 +97,11 @@ public:
QString uniqueDisplayName(const QString &base); QString uniqueDisplayName(const QString &base);
PersistentSettingsWriter m_writer; PersistentSettingsWriter m_writer;
DebuggerItemModel *m_model; DebuggerItemModel *m_model = nullptr;
IOptionsPage *m_optionsPage = 0; IOptionsPage *m_optionsPage = nullptr;
}; };
static DebuggerItemManagerPrivate *d = 0; static DebuggerItemManagerPrivate *d = nullptr;
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// DebuggerItemConfigWidget // DebuggerItemConfigWidget

View File

@@ -70,7 +70,7 @@ public:
Perspective() = default; Perspective() = default;
// Takes ownership of \a centralWidget and all dock widgets in \a operations. // Takes ownership of \a centralWidget and all dock widgets in \a operations.
Perspective(const QString &name, const QVector<Operation> &operations, Perspective(const QString &name, const QVector<Operation> &operations,
QWidget *centralWidget = 0); QWidget *centralWidget = nullptr);
~Perspective(); ~Perspective();
void addOperation(const Operation &operation); void addOperation(const Operation &operation);

View File

@@ -575,7 +575,7 @@ static Kit *findUniversalCdbKit()
// //
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
static DebuggerPluginPrivate *dd = 0; static DebuggerPluginPrivate *dd = nullptr;
/*! /*!
\class Debugger::Internal::DebuggerCore \class Debugger::Internal::DebuggerCore
@@ -928,95 +928,95 @@ public:
QPointer<QWidget> m_modeWindow; QPointer<QWidget> m_modeWindow;
QPointer<DebugMode> m_mode; QPointer<DebugMode> m_mode;
ActionContainer *m_menu = 0; ActionContainer *m_menu = nullptr;
Project *m_previousProject = 0; Project *m_previousProject = nullptr;
QPointer<Target> m_previousTarget; QPointer<Target> m_previousTarget;
QPointer<RunConfiguration> m_previousRunConfiguration; QPointer<RunConfiguration> m_previousRunConfiguration;
Id m_previousMode; Id m_previousMode;
QVector<DebuggerRunTool *> m_scheduledStarts; QVector<DebuggerRunTool *> m_scheduledStarts;
ProxyAction *m_visibleStartAction = 0; ProxyAction *m_visibleStartAction = nullptr;
ProxyAction *m_hiddenStopAction = 0; ProxyAction *m_hiddenStopAction = nullptr;
QAction *m_startAction = 0; QAction *m_startAction = nullptr;
QAction *m_debugWithoutDeployAction = 0; QAction *m_debugWithoutDeployAction = nullptr;
QAction *m_startAndDebugApplicationAction = 0; QAction *m_startAndDebugApplicationAction = nullptr;
QAction *m_attachToRunningApplication = 0; QAction *m_attachToRunningApplication = nullptr;
QAction *m_attachToUnstartedApplication = 0; QAction *m_attachToUnstartedApplication = nullptr;
QAction *m_attachToQmlPortAction = 0; QAction *m_attachToQmlPortAction = nullptr;
QAction *m_attachToRemoteServerAction = 0; QAction *m_attachToRemoteServerAction = nullptr;
QAction *m_startRemoteCdbAction = 0; QAction *m_startRemoteCdbAction = nullptr;
QAction *m_attachToCoreAction = 0; QAction *m_attachToCoreAction = nullptr;
QAction *m_detachAction = 0; QAction *m_detachAction = nullptr;
QAction *m_continueAction = 0; QAction *m_continueAction = nullptr;
QAction *m_exitAction = 0; // On application output button if "Stop" is possible QAction *m_exitAction = nullptr; // On application output button if "Stop" is possible
QAction *m_interruptAction = 0; // On the fat debug button if "Pause" is possible QAction *m_interruptAction = nullptr; // On the fat debug button if "Pause" is possible
QAction *m_undisturbableAction = 0; // On the fat debug button if nothing can be done QAction *m_undisturbableAction = nullptr; // On the fat debug button if nothing can be done
QAction *m_abortAction = 0; QAction *m_abortAction = nullptr;
QAction *m_stepAction = 0; QAction *m_stepAction = nullptr;
QAction *m_stepOutAction = 0; QAction *m_stepOutAction = nullptr;
QAction *m_runToLineAction = 0; // In the debug menu QAction *m_runToLineAction = nullptr; // In the debug menu
QAction *m_runToSelectedFunctionAction = 0; QAction *m_runToSelectedFunctionAction = nullptr;
QAction *m_jumpToLineAction = 0; // In the Debug menu. QAction *m_jumpToLineAction = nullptr; // In the Debug menu.
QAction *m_returnFromFunctionAction = 0; QAction *m_returnFromFunctionAction = nullptr;
QAction *m_nextAction = 0; QAction *m_nextAction = nullptr;
QAction *m_watchAction = 0; QAction *m_watchAction = nullptr;
Command *m_watchCommand = 0; Command *m_watchCommand = nullptr;
QAction *m_breakAction = 0; QAction *m_breakAction = nullptr;
QAction *m_reverseDirectionAction = 0; QAction *m_reverseDirectionAction = nullptr;
QAction *m_frameUpAction = 0; QAction *m_frameUpAction = nullptr;
QAction *m_frameDownAction = 0; QAction *m_frameDownAction = nullptr;
QAction *m_resetAction = 0; QAction *m_resetAction = nullptr;
QAction *m_operateByInstructionAction = 0; QAction *m_operateByInstructionAction = nullptr;
QToolButton *m_reverseToolButton = 0; QToolButton *m_reverseToolButton = nullptr;
QLabel *m_threadLabel = 0; QLabel *m_threadLabel = nullptr;
QComboBox *m_threadBox = 0; QComboBox *m_threadBox = nullptr;
BaseTreeView *m_breakView = 0; BaseTreeView *m_breakView = nullptr;
BaseTreeView *m_returnView = 0; BaseTreeView *m_returnView = nullptr;
BaseTreeView *m_localsView = 0; BaseTreeView *m_localsView = nullptr;
BaseTreeView *m_watchersView = 0; BaseTreeView *m_watchersView = nullptr;
WatchTreeView *m_inspectorView = 0; WatchTreeView *m_inspectorView = nullptr;
BaseTreeView *m_registerView = 0; BaseTreeView *m_registerView = nullptr;
BaseTreeView *m_modulesView = 0; BaseTreeView *m_modulesView = nullptr;
BaseTreeView *m_snapshotView = 0; BaseTreeView *m_snapshotView = nullptr;
BaseTreeView *m_sourceFilesView = 0; BaseTreeView *m_sourceFilesView = nullptr;
BaseTreeView *m_stackView = 0; BaseTreeView *m_stackView = nullptr;
BaseTreeView *m_threadsView = 0; BaseTreeView *m_threadsView = nullptr;
QWidget *m_breakWindow = 0; QWidget *m_breakWindow = nullptr;
BreakHandler *m_breakHandler = 0; BreakHandler *m_breakHandler = nullptr;
QWidget *m_returnWindow = 0; QWidget *m_returnWindow = nullptr;
QWidget *m_localsWindow = 0; QWidget *m_localsWindow = nullptr;
QWidget *m_watchersWindow = 0; QWidget *m_watchersWindow = nullptr;
QWidget *m_inspectorWindow = 0; QWidget *m_inspectorWindow = nullptr;
QWidget *m_registerWindow = 0; QWidget *m_registerWindow = nullptr;
QWidget *m_modulesWindow = 0; QWidget *m_modulesWindow = nullptr;
QWidget *m_snapshotWindow = 0; QWidget *m_snapshotWindow = nullptr;
QWidget *m_sourceFilesWindow = 0; QWidget *m_sourceFilesWindow = nullptr;
QWidget *m_stackWindow = 0; QWidget *m_stackWindow = nullptr;
QWidget *m_threadsWindow = 0; QWidget *m_threadsWindow = nullptr;
LogWindow *m_logWindow = 0; LogWindow *m_logWindow = nullptr;
LocalsAndInspectorWindow *m_localsAndInspectorWindow = 0; LocalsAndInspectorWindow *m_localsAndInspectorWindow = nullptr;
bool m_busy; bool m_busy = false;
QString m_lastPermanentStatusMessage; QString m_lastPermanentStatusMessage;
mutable CPlusPlus::Snapshot m_codeModelSnapshot; mutable CPlusPlus::Snapshot m_codeModelSnapshot;
DebuggerPlugin *m_plugin = 0; DebuggerPlugin *m_plugin = nullptr;
SnapshotHandler *m_snapshotHandler = 0; SnapshotHandler *m_snapshotHandler = nullptr;
QTimer m_shutdownTimer; QTimer m_shutdownTimer;
bool m_shuttingDown = false; bool m_shuttingDown = false;
QPointer<DebuggerEngine> m_previouslyActiveEngine; QPointer<DebuggerEngine> m_previouslyActiveEngine;
QPointer<DebuggerRunTool> m_currentRunTool; QPointer<DebuggerRunTool> m_currentRunTool;
DebuggerSettings *m_debuggerSettings = 0; DebuggerSettings *m_debuggerSettings = nullptr;
QStringList m_arguments; QStringList m_arguments;
DebuggerToolTipManager m_toolTipManager; DebuggerToolTipManager m_toolTipManager;
DummyEngine *m_dummyEngine = 0; DummyEngine *m_dummyEngine = nullptr;
const QSharedPointer<GlobalDebuggerOptions> m_globalDebuggerOptions; const QSharedPointer<GlobalDebuggerOptions> m_globalDebuggerOptions;
DebuggerItemManager m_debuggerItemManager; DebuggerItemManager m_debuggerItemManager;
@@ -1042,13 +1042,13 @@ DebuggerPluginPrivate::~DebuggerPluginPrivate()
m_optionPages.clear(); m_optionPages.clear();
delete m_debuggerSettings; delete m_debuggerSettings;
m_debuggerSettings = 0; m_debuggerSettings = nullptr;
delete m_snapshotHandler; delete m_snapshotHandler;
m_snapshotHandler = 0; m_snapshotHandler = nullptr;
delete m_breakHandler; delete m_breakHandler;
m_breakHandler = 0; m_breakHandler = nullptr;
} }
DebuggerEngine *DebuggerPluginPrivate::dummyEngine() DebuggerEngine *DebuggerPluginPrivate::dummyEngine()
@@ -1068,7 +1068,7 @@ static QString msgParameterMissing(const QString &a)
static Kit *guessKitFromAbis(const QList<Abi> &abis) static Kit *guessKitFromAbis(const QList<Abi> &abis)
{ {
Kit *kit = 0; Kit *kit = nullptr;
// Try to find a kit via ABI. // Try to find a kit via ABI.
if (!abis.isEmpty()) { if (!abis.isEmpty()) {
@@ -1852,7 +1852,7 @@ QVariant configValue(const QString &name)
void DebuggerPluginPrivate::onCurrentProjectChanged(Project *project) void DebuggerPluginPrivate::onCurrentProjectChanged(Project *project)
{ {
RunConfiguration *activeRc = 0; RunConfiguration *activeRc = nullptr;
if (project) { if (project) {
Target *target = project->activeTarget(); Target *target = project->activeTarget();
if (target) if (target)

View File

@@ -52,7 +52,7 @@ class DebuggerSourcePathMappingWidget : public QGroupBox
public: public:
typedef QMap<QString, QString> SourcePathMap; typedef QMap<QString, QString> SourcePathMap;
explicit DebuggerSourcePathMappingWidget(QWidget *parent = 0); explicit DebuggerSourcePathMappingWidget(QWidget *parent = nullptr);
SourcePathMap sourcePathMap() const; SourcePathMap sourcePathMap() const;
void setSourcePathMap(const SourcePathMap &); void setSourcePathMap(const SourcePathMap &);

View File

@@ -946,7 +946,7 @@ void DebuggerToolTipHolder::saveSessionData(QXmlStreamWriter &w) const
(by file name and function) acquire the engine, others release. (by file name and function) acquire the engine, others release.
*/ */
static DebuggerToolTipManager *m_instance = 0; static DebuggerToolTipManager *m_instance = nullptr;
DebuggerToolTipManager::DebuggerToolTipManager() DebuggerToolTipManager::DebuggerToolTipManager()
{ {
@@ -955,7 +955,7 @@ DebuggerToolTipManager::DebuggerToolTipManager()
DebuggerToolTipManager::~DebuggerToolTipManager() DebuggerToolTipManager::~DebuggerToolTipManager()
{ {
m_instance = 0; m_instance = nullptr;
} }
void DebuggerToolTipManager::updateVisibleToolTips() void DebuggerToolTipManager::updateVisibleToolTips()

View File

@@ -237,7 +237,7 @@ QString GdbEngine::failedToStartMessage()
// Parse "~:gdb: unknown target exception 0xc0000139 at 0x77bef04e\n" // Parse "~:gdb: unknown target exception 0xc0000139 at 0x77bef04e\n"
// and return an exception message // and return an exception message
static QString msgWinException(const QString &data, unsigned *exCodeIn = 0) static QString msgWinException(const QString &data, unsigned *exCodeIn = nullptr)
{ {
if (exCodeIn) if (exCodeIn)
*exCodeIn = 0; *exCodeIn = 0;

View File

@@ -349,7 +349,7 @@ GdbOptionsPageWidget2::GdbOptionsPageWidget2()
checkBoxBreakOnAbort->setText(CommonOptionsPage::msgSetBreakpointAtFunction("abort")); checkBoxBreakOnAbort->setText(CommonOptionsPage::msgSetBreakpointAtFunction("abort"));
checkBoxBreakOnAbort->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("abort")); checkBoxBreakOnAbort->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("abort"));
QCheckBox *checkBoxEnableReverseDebugging = 0; QCheckBox *checkBoxEnableReverseDebugging = nullptr;
if (isReverseDebuggingEnabled()) { if (isReverseDebuggingEnabled()) {
checkBoxEnableReverseDebugging = new QCheckBox(groupBoxDangerous); checkBoxEnableReverseDebugging = new QCheckBox(groupBoxDangerous);
checkBoxEnableReverseDebugging->setText(GdbOptionsPage::tr("Enable reverse debugging")); checkBoxEnableReverseDebugging->setText(GdbOptionsPage::tr("Enable reverse debugging"));

View File

@@ -49,7 +49,7 @@ class ImageWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ImageWidget(QWidget *parent = 0) : QWidget(parent) {} ImageWidget() {}
void setImage(const QImage &image); void setImage(const QImage &image);
const QImage &image() const { return m_image; } const QImage &image() const { return m_image; }

View File

@@ -43,15 +43,13 @@ class ImageViewer : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ImageViewer(QWidget *parent = 0); explicit ImageViewer(QWidget *parent = nullptr);
void setImage(const QImage &image); void setImage(const QImage &image);
void setInfo(const QString &description); void setInfo(const QString &description);
protected:
void contextMenuEvent(QContextMenuEvent *);
private: private:
void contextMenuEvent(QContextMenuEvent *) final;
void clicked(const QString &); void clicked(const QString &);
QScrollArea *m_scrollArea; QScrollArea *m_scrollArea;
@@ -64,13 +62,13 @@ class PlotViewer : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit PlotViewer(QWidget *parent = 0); explicit PlotViewer(QWidget *parent = nullptr);
typedef std::vector<double> Data; typedef std::vector<double> Data;
void setData(const Data &data); void setData(const Data &data);
void setInfo(const QString &description); void setInfo(const QString &description);
void paintEvent(QPaintEvent *ev); void paintEvent(QPaintEvent *ev) final;
private: private:
Data m_data; Data m_data;

View File

@@ -48,7 +48,7 @@ class LogWindow : public QWidget
Q_OBJECT Q_OBJECT
public: public:
explicit LogWindow(QWidget *parent = 0); explicit LogWindow(QWidget *parent = nullptr);
void setCursor(const QCursor &cursor); void setCursor(const QCursor &cursor);
@@ -59,7 +59,7 @@ public:
static QString logTimeStamp(); static QString logTimeStamp();
static bool writeLogContents(const QPlainTextEdit *editor, QWidget *parent = 0); static bool writeLogContents(const QPlainTextEdit *editor, QWidget *parent = nullptr);
static QChar charForChannel(int channel); static QChar charForChannel(int channel);
static LogChannel channelForChar(QChar c); static LogChannel channelForChar(QChar c);

View File

@@ -55,15 +55,6 @@
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
OutputCollector::OutputCollector(QObject *parent)
: QObject(parent)
{
#ifdef Q_OS_WIN
m_server = 0;
m_socket = 0;
#endif
}
OutputCollector::~OutputCollector() OutputCollector::~OutputCollector()
{ {
shutdown(); shutdown();
@@ -120,8 +111,8 @@ void OutputCollector::shutdown()
{ {
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
delete m_server; // Deletes socket as well (QObject parent) delete m_server; // Deletes socket as well (QObject parent)
m_server = 0; m_server = nullptr;
m_socket = 0; m_socket = nullptr;
#else #else
if (!m_serverPath.isEmpty()) { if (!m_serverPath.isEmpty()) {
::close(m_serverFd); ::close(m_serverFd);

View File

@@ -47,7 +47,7 @@ class OutputCollector : public QObject
Q_OBJECT Q_OBJECT
public: public:
OutputCollector(QObject *parent = 0); OutputCollector() {}
~OutputCollector() override; ~OutputCollector() override;
bool listen(); bool listen();
void shutdown(); void shutdown();
@@ -61,12 +61,12 @@ private:
void bytesAvailable(); void bytesAvailable();
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
void newConnectionAvailable(); void newConnectionAvailable();
QLocalServer *m_server; QLocalServer *m_server = nullptr;
QLocalSocket *m_socket; QLocalSocket *m_socket = nullptr;
#else #else
QString m_serverPath; QString m_serverPath;
int m_serverFd; int m_serverFd;
QSocketNotifier *m_serverNotifier; QSocketNotifier *m_serverNotifier = nullptr;
QString m_errorString; QString m_errorString;
#endif #endif
}; };

View File

@@ -223,7 +223,7 @@ public:
bool contextEvaluate = false; bool contextEvaluate = false;
QTimer connectionTimer; QTimer connectionTimer;
QmlDebug::QDebugMessageClient *msgClient = 0; QmlDebug::QDebugMessageClient *msgClient = nullptr;
QHash<int, QmlCallback> callbackForToken; QHash<int, QmlCallback> callbackForToken;
QMetaObject::Connection startupMessageFilterConnection; QMetaObject::Connection startupMessageFilterConnection;
@@ -938,7 +938,7 @@ static ConsoleItem *constructLogItemTree(const QVariant &result,
return 0; return 0;
QString text; QString text;
ConsoleItem *item = 0; ConsoleItem *item = nullptr;
if (result.type() == QVariant::Map) { if (result.type() == QVariant::Map) {
if (key.isEmpty()) if (key.isEmpty())
text = "Object"; text = "Object";
@@ -1110,7 +1110,7 @@ void QmlEngine::executeDebuggerCommand(const QString &command, DebuggerLanguages
void QmlEnginePrivate::updateScriptSource(const QString &fileName, int lineOffset, int columnOffset, void QmlEnginePrivate::updateScriptSource(const QString &fileName, int lineOffset, int columnOffset,
const QString &source) const QString &source)
{ {
QTextDocument *document = 0; QTextDocument *document = nullptr;
if (sourceDocuments.contains(fileName)) { if (sourceDocuments.contains(fileName)) {
document = sourceDocuments.value(fileName); document = sourceDocuments.value(fileName);
} else { } else {

View File

@@ -33,8 +33,8 @@ namespace Internal {
class RegisterPostMortemAction : public Utils::SavedAction class RegisterPostMortemAction : public Utils::SavedAction
{ {
public: public:
RegisterPostMortemAction(QObject *parent = 0); RegisterPostMortemAction(QObject *parent = nullptr);
void readSettings(const QSettings *settings = 0) override; void readSettings(const QSettings *settings = nullptr) override;
void writeSettings(QSettings *) override {} void writeSettings(QSettings *) override {}
private: private:

View File

@@ -197,7 +197,7 @@ QString CdbSymbolPathListEditor::symbolPath(const QString &cacheDir,
return s; return s;
} }
bool CdbSymbolPathListEditor::isSymbolServerPath(const QString &path, QString *cacheDir /* = 0 */) bool CdbSymbolPathListEditor::isSymbolServerPath(const QString &path, QString *cacheDir /* = nullptr */)
{ {
if (!path.startsWith(QLatin1String(symbolServerPrefixC)) || !path.endsWith(QLatin1String(symbolServerPostfixC))) if (!path.startsWith(QLatin1String(symbolServerPrefixC)) || !path.endsWith(QLatin1String(symbolServerPostfixC)))
return false; return false;
@@ -226,7 +226,7 @@ bool CdbSymbolPathListEditor::isSymbolCachePath(const QString &path, QString *ca
int CdbSymbolPathListEditor::indexOfSymbolPath(const QStringList &paths, int CdbSymbolPathListEditor::indexOfSymbolPath(const QStringList &paths,
CdbSymbolPathListEditor::SymbolPathMode mode, CdbSymbolPathListEditor::SymbolPathMode mode,
QString *cacheDir /* = 0 */) QString *cacheDir /* = nullptr */)
{ {
const int count = paths.size(); const int count = paths.size();
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {

View File

@@ -48,7 +48,7 @@ namespace Internal {
class CacheDirectoryDialog : public QDialog { class CacheDirectoryDialog : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
explicit CacheDirectoryDialog(QWidget *parent = 0); explicit CacheDirectoryDialog(QWidget *parent = nullptr);
void setPath(const QString &p); void setPath(const QString &p);
QString path() const; QString path() const;
@@ -69,7 +69,7 @@ public:
SymbolCachePath SymbolCachePath
}; };
explicit CdbSymbolPathListEditor(QWidget *parent = 0); explicit CdbSymbolPathListEditor(QWidget *parent = nullptr);
static bool promptCacheDirectory(QWidget *parent, QString *cacheDirectory); static bool promptCacheDirectory(QWidget *parent, QString *cacheDirectory);
@@ -81,11 +81,11 @@ public:
// Format a symbol path specification // Format a symbol path specification
static QString symbolPath(const QString &cacheDir, SymbolPathMode mode); static QString symbolPath(const QString &cacheDir, SymbolPathMode mode);
// Check for a symbol server path and extract local cache directory // Check for a symbol server path and extract local cache directory
static bool isSymbolServerPath(const QString &path, QString *cacheDir = 0); static bool isSymbolServerPath(const QString &path, QString *cacheDir = nullptr);
// Check for a symbol cache path and extract local cache directory // Check for a symbol cache path and extract local cache directory
static bool isSymbolCachePath(const QString &path, QString *cacheDir = 0); static bool isSymbolCachePath(const QString &path, QString *cacheDir = nullptr);
// Check for symbol server in list of paths. // Check for symbol server in list of paths.
static int indexOfSymbolPath(const QStringList &paths, SymbolPathMode mode, QString *cacheDir = 0); static int indexOfSymbolPath(const QStringList &paths, SymbolPathMode mode, QString *cacheDir = nullptr);
private: private:
void addSymbolPath(SymbolPathMode mode); void addSymbolPath(SymbolPathMode mode);

View File

@@ -223,7 +223,7 @@ bool getPDBFiles(const QString &peExecutableFileName, QStringList *rc, QString *
{ {
HANDLE hFile = NULL; HANDLE hFile = NULL;
HANDLE hFileMap = NULL; HANDLE hFileMap = NULL;
void *fileMemory = 0; void *fileMemory = nullptr;
bool success = false; bool success = false;
rc->clear(); rc->clear();

View File

@@ -38,7 +38,7 @@ class SymbolPathsDialog : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit SymbolPathsDialog(QWidget *parent = 0); explicit SymbolPathsDialog(QWidget *parent = nullptr);
~SymbolPathsDialog(); ~SymbolPathsDialog();
bool useSymbolCache() const; bool useSymbolCache() const;

View File

@@ -205,8 +205,8 @@ int getUninitializedVariablesI(const Snapshot &snapshot,
return 4; return 4;
// First figure out the function to do a safety name check // First figure out the function to do a safety name check
// and the innermost scope at cursor position // and the innermost scope at cursor position
const Function *function = 0; const Function *function = nullptr;
const Scope *innerMostScope = 0; const Scope *innerMostScope = nullptr;
if (symbolAtLine->isFunction()) { if (symbolAtLine->isFunction()) {
function = symbolAtLine->asFunction(); function = symbolAtLine->asFunction();
if (function->memberCount() == 1) // Skip over function block if (function->memberCount() == 1) // Skip over function block

View File

@@ -41,8 +41,8 @@ class ContextData;
// Editor tooltip support // Editor tooltip support
QString cppExpressionAt(TextEditor::TextEditorWidget *editorWidget, int pos, QString cppExpressionAt(TextEditor::TextEditorWidget *editorWidget, int pos,
int *line, int *column, QString *function = 0, int *line, int *column, QString *function = nullptr,
int *scopeFromLine = 0, int *scopeToLine = 0); int *scopeFromLine = nullptr, int *scopeToLine = nullptr);
QString fixCppExpression(const QString &exp); QString fixCppExpression(const QString &exp);
QString cppFunctionAt(const QString &fileName, int line, int column = 0); QString cppFunctionAt(const QString &fileName, int line, int column = 0);

View File

@@ -64,7 +64,7 @@ static QString currentError()
} }
Terminal::Terminal(QObject *parent) Terminal::Terminal(QObject *parent)
: QObject(parent), m_isUsable(false), m_masterFd(-1), m_masterReader(0) : QObject(parent)
{ {
} }

View File

@@ -44,7 +44,7 @@ class Terminal : public QObject
Q_OBJECT Q_OBJECT
public: public:
Terminal(QObject *parent = 0); Terminal(QObject *parent = nullptr);
void setup(); void setup();
bool isUsable() const; bool isUsable() const;
@@ -62,9 +62,9 @@ signals:
private: private:
void onSlaveReaderActivated(int fd); void onSlaveReaderActivated(int fd);
bool m_isUsable; bool m_isUsable = false;
int m_masterFd; int m_masterFd = -1;
QSocketNotifier *m_masterReader; QSocketNotifier *m_masterReader = nullptr;
QByteArray m_slaveName; QByteArray m_slaveName;
}; };

View File

@@ -50,7 +50,7 @@ class UnstartedAppWatcherDialog : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit UnstartedAppWatcherDialog(QWidget *parent = 0); explicit UnstartedAppWatcherDialog(QWidget *parent = nullptr);
ProjectExplorer::Kit *currentKit() const; ProjectExplorer::Kit *currentKit() const;
ProjectExplorer::DeviceProcessItem currentProcess() const; ProjectExplorer::DeviceProcessItem currentProcess() const;

View File

@@ -43,13 +43,13 @@ class WatchLineEdit : public QLineEdit
Q_PROPERTY(QString text READ text WRITE setText USER false) Q_PROPERTY(QString text READ text WRITE setText USER false)
Q_PROPERTY(QVariant modelData READ modelData WRITE setModelData DESIGNABLE false USER true) Q_PROPERTY(QVariant modelData READ modelData WRITE setModelData DESIGNABLE false USER true)
public: public:
explicit WatchLineEdit(QWidget *parent = 0); explicit WatchLineEdit(QWidget *parent = nullptr);
// Ready-made accessors for item views passing QVariants around // Ready-made accessors for item views passing QVariants around
virtual QVariant modelData() const; virtual QVariant modelData() const;
virtual void setModelData(const QVariant &); virtual void setModelData(const QVariant &);
static WatchLineEdit *create(QVariant::Type t, QWidget *parent = 0); static WatchLineEdit *create(QVariant::Type t, QWidget *parent = nullptr);
}; };
/* Watch delegate line edit for integer numbers based on quint64/qint64. /* Watch delegate line edit for integer numbers based on quint64/qint64.
@@ -63,11 +63,10 @@ class IntegerWatchLineEdit : public WatchLineEdit
Q_PROPERTY(bool Signed READ isSigned WRITE setSigned DESIGNABLE true) Q_PROPERTY(bool Signed READ isSigned WRITE setSigned DESIGNABLE true)
Q_PROPERTY(bool bigInt READ isBigInt WRITE setBigInt DESIGNABLE true) Q_PROPERTY(bool bigInt READ isBigInt WRITE setBigInt DESIGNABLE true)
public: public:
explicit IntegerWatchLineEdit(QWidget *parent = 0); explicit IntegerWatchLineEdit(QWidget *parent = nullptr);
// Ready-made accessors for item views passing QVariants around QVariant modelData() const final;
virtual QVariant modelData() const; void setModelData(const QVariant &) final;
virtual void setModelData(const QVariant &);
int base() const; int base() const;
void setBase(int b); void setBase(int b);
@@ -88,10 +87,10 @@ private:
class FloatWatchLineEdit : public WatchLineEdit class FloatWatchLineEdit : public WatchLineEdit
{ {
public: public:
explicit FloatWatchLineEdit(QWidget *parent = 0); explicit FloatWatchLineEdit(QWidget *parent = nullptr);
virtual QVariant modelData() const; QVariant modelData() const final;
virtual void setModelData(const QVariant &); void setModelData(const QVariant &) final;
}; };
/* Combo box for booleans */ /* Combo box for booleans */
@@ -100,7 +99,7 @@ class BooleanComboBox : public QComboBox
Q_OBJECT Q_OBJECT
Q_PROPERTY(QVariant modelData READ modelData WRITE setModelData DESIGNABLE false USER true) Q_PROPERTY(QVariant modelData READ modelData WRITE setModelData DESIGNABLE false USER true)
public: public:
explicit BooleanComboBox(QWidget *parent = 0); explicit BooleanComboBox(QWidget *parent = nullptr);
virtual QVariant modelData() const; virtual QVariant modelData() const;
virtual void setModelData(const QVariant &); virtual void setModelData(const QVariant &);

View File

@@ -336,7 +336,7 @@ public:
template <class T> T *prepareObject(const WatchItem *item) template <class T> T *prepareObject(const WatchItem *item)
{ {
const QString key = item->key(); const QString key = item->key();
T *t = 0; T *t = nullptr;
if (QWidget *w = findWidget(key)) { if (QWidget *w = findWidget(key)) {
t = qobject_cast<T *>(w); t = qobject_cast<T *>(w);
if (!t) if (!t)
@@ -2229,7 +2229,7 @@ void WatchModel::showEditValue(const WatchItem *item)
// QImage // QImage
int width = 0, height = 0, nbytes = 0, imformat = 0; int width = 0, height = 0, nbytes = 0, imformat = 0;
QByteArray ba; QByteArray ba;
uchar *bits = 0; uchar *bits = nullptr;
if (format == DisplayImageData) { if (format == DisplayImageData) {
ba = QByteArray::fromHex(item->editvalue.toUtf8()); ba = QByteArray::fromHex(item->editvalue.toUtf8());
QTC_ASSERT(ba.size() > 16, return); QTC_ASSERT(ba.size() > 16, return);