Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
f2392ffb
Commit
f2392ffb
authored
Nov 25, 2009
by
hjk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debugger: allow the user to hide the std:: and Qt's namespace
parent
b8dbb120
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
57 additions
and
1 deletion
+57
-1
src/plugins/debugger/debuggeractions.cpp
src/plugins/debugger/debuggeractions.cpp
+16
-0
src/plugins/debugger/debuggeractions.h
src/plugins/debugger/debuggeractions.h
+2
-0
src/plugins/debugger/debuggerplugin.cpp
src/plugins/debugger/debuggerplugin.cpp
+2
-0
src/plugins/debugger/gdb/gdbengine.h
src/plugins/debugger/gdb/gdbengine.h
+1
-0
src/plugins/debugger/idebuggerengine.h
src/plugins/debugger/idebuggerengine.h
+1
-0
src/plugins/debugger/watchhandler.cpp
src/plugins/debugger/watchhandler.cpp
+28
-1
src/plugins/debugger/watchhandler.h
src/plugins/debugger/watchhandler.h
+5
-0
src/plugins/debugger/watchwindow.cpp
src/plugins/debugger/watchwindow.cpp
+2
-0
No files found.
src/plugins/debugger/debuggeractions.cpp
View file @
f2392ffb
...
...
@@ -196,6 +196,22 @@ DebuggerSettings *DebuggerSettings::instance()
item
=
new
SavedAction
(
instance
);
instance
->
insertItem
(
WatchPoint
,
item
);
item
=
new
SavedAction
(
instance
);
item
->
setSettingsKey
(
debugModeGroup
,
QLatin1String
(
"ShowStandardNamespace"
));
item
->
setText
(
tr
(
"Show std:: namespace for types"
));
item
->
setCheckable
(
true
);
item
->
setDefaultValue
(
true
);
item
->
setValue
(
true
);
instance
->
insertItem
(
ShowStdNamespace
,
item
);
item
=
new
SavedAction
(
instance
);
item
->
setSettingsKey
(
debugModeGroup
,
QLatin1String
(
"ShowQtNamespace"
));
item
->
setText
(
tr
(
"Show Qt's namespace for types"
));
item
->
setCheckable
(
true
);
item
->
setDefaultValue
(
true
);
item
->
setValue
(
true
);
instance
->
insertItem
(
ShowQtNamespace
,
item
);
//
// DebuggingHelper
//
...
...
src/plugins/debugger/debuggeractions.h
View file @
f2392ffb
...
...
@@ -112,6 +112,8 @@ enum DebuggerActionCode
WatchPoint
,
AssignValue
,
AssignType
,
ShowStdNamespace
,
ShowQtNamespace
,
// Source List
ListSourceFiles
,
...
...
src/plugins/debugger/debuggerplugin.cpp
View file @
f2392ffb
...
...
@@ -362,6 +362,8 @@ QWidget *CommonOptionsPage::createPage(QWidget *parent)
m_ui
.
checkBoxEnableReverseDebugging
);
m_group
.
insert
(
theDebuggerAction
(
MaximalStackDepth
),
m_ui
.
spinBoxMaximalStackDepth
);
m_group
.
insert
(
theDebuggerAction
(
ShowStdNamespace
),
0
);
m_group
.
insert
(
theDebuggerAction
(
ShowQtNamespace
),
0
);
#ifdef USE_REVERSE_DEBUGGING
m_ui
.
checkBoxEnableReverseDebugging
->
hide
();
...
...
src/plugins/debugger/gdb/gdbengine.h
View file @
f2392ffb
...
...
@@ -111,6 +111,7 @@ private: ////////// General Interface //////////
virtual
void
shutdown
();
virtual
void
executeDebuggerCommand
(
const
QString
&
command
);
virtual
QString
qtNamespace
()
const
{
return
m_dumperHelper
.
qtNamespace
();
}
private:
////////// General State //////////
...
...
src/plugins/debugger/idebuggerengine.h
View file @
f2392ffb
...
...
@@ -120,6 +120,7 @@ public:
virtual
bool
checkConfiguration
(
int
/* toolChain */
,
QString
*
/* errorMessage */
,
QString
*
/* settingsPage */
=
0
)
const
{
return
true
;
}
virtual
bool
isSynchroneous
()
const
{
return
false
;
}
virtual
QString
qtNamespace
()
const
{
return
QString
();
}
protected:
void
showStatusMessage
(
const
QString
&
msg
,
int
timeout
=
-
1
);
DebuggerState
state
()
const
;
...
...
src/plugins/debugger/watchhandler.cpp
View file @
f2392ffb
...
...
@@ -330,6 +330,7 @@ QString WatchData::shadowedName(const QString &name, int seen)
return
QCoreApplication
::
translate
(
"Debugger::Internal::WatchData"
,
"%1 <shadowed %2>"
).
arg
(
name
).
arg
(
seen
);
}
///////////////////////////////////////////////////////////////////////
//
// WatchModel
...
...
@@ -385,6 +386,11 @@ void WatchModel::reinitialize()
endRemoveRows
();
}
void
WatchModel
::
emitAllChanged
()
{
emit
layoutChanged
();
}
void
WatchModel
::
beginCycle
()
{
emit
enableUpdates
(
false
);
...
...
@@ -486,7 +492,7 @@ static inline QRegExp stdStringRegExp(const QString &charType)
return
re
;
}
QString
niceType
(
const
QString
typeIn
)
static
QString
niceType
Helper
(
const
QString
typeIn
)
{
static
QMap
<
QString
,
QString
>
cache
;
const
QMap
<
QString
,
QString
>::
const_iterator
it
=
cache
.
constFind
(
typeIn
);
...
...
@@ -588,6 +594,16 @@ QString niceType(const QString typeIn)
return
type
;
}
QString
WatchModel
::
niceType
(
const
QString
&
typeIn
)
const
{
QString
type
=
niceTypeHelper
(
typeIn
);
if
(
theDebuggerBoolSetting
(
ShowStdNamespace
))
type
=
type
.
remove
(
"std::"
);
if
(
theDebuggerBoolSetting
(
ShowQtNamespace
))
type
=
type
.
remove
(
m_handler
->
m_manager
->
currentEngine
()
->
qtNamespace
());
return
type
;
}
static
QString
formattedValue
(
const
WatchData
&
data
,
int
individualFormat
,
int
typeFormat
)
{
...
...
@@ -1092,6 +1108,10 @@ WatchHandler::WatchHandler(DebuggerManager *manager)
SIGNAL
(
triggered
()),
this
,
SLOT
(
watchExpression
()));
connect
(
theDebuggerAction
(
RemoveWatchExpression
),
SIGNAL
(
triggered
()),
this
,
SLOT
(
removeWatchExpression
()));
connect
(
theDebuggerAction
(
ShowStdNamespace
),
SIGNAL
(
triggered
()),
this
,
SLOT
(
emitAllChanged
()));
connect
(
theDebuggerAction
(
ShowQtNamespace
),
SIGNAL
(
triggered
()),
this
,
SLOT
(
emitAllChanged
()));
}
void
WatchHandler
::
beginCycle
()
...
...
@@ -1125,6 +1145,13 @@ void WatchHandler::cleanup()
#endif
}
void
WatchHandler
::
emitAllChanged
()
{
m_locals
->
emitAllChanged
();
m_watchers
->
emitAllChanged
();
m_tooltips
->
emitAllChanged
();
}
void
WatchHandler
::
insertData
(
const
WatchData
&
data
)
{
MODEL_DEBUG
(
"INSERTDATA: "
<<
data
.
toString
());
...
...
src/plugins/debugger/watchhandler.h
View file @
f2392ffb
...
...
@@ -221,10 +221,14 @@ private:
void
dump
();
void
dumpHelper
(
WatchItem
*
item
);
void
emitAllChanged
();
signals:
void
enableUpdates
(
bool
);
private:
QString
niceType
(
const
QString
&
typeIn
)
const
;
WatchHandler
*
m_handler
;
WatchType
m_type
;
WatchItem
*
m_root
;
...
...
@@ -245,6 +249,7 @@ public:
Q_SLOT
void
watchExpression
(
const
QString
&
exp
);
Q_SLOT
void
removeWatchExpression
();
Q_SLOT
void
removeWatchExpression
(
const
QString
&
exp
);
Q_SLOT
void
emitAllChanged
();
void
beginCycle
();
// called at begin of updateLocals() cycle
void
updateWatchers
();
// called after locals are fetched
void
endCycle
();
// called after all results have been received
...
...
src/plugins/debugger/watchwindow.cpp
View file @
f2392ffb
...
...
@@ -284,6 +284,8 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
menu
.
addAction
(
theDebuggerAction
(
UseToolTipsInLocalsView
));
menu
.
addAction
(
theDebuggerAction
(
AutoDerefPointers
));
menu
.
addAction
(
theDebuggerAction
(
ShowStdNamespace
));
menu
.
addAction
(
theDebuggerAction
(
ShowQtNamespace
));
QAction
*
actAdjustColumnWidths
=
menu
.
addAction
(
tr
(
"Adjust column widths to contents"
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment