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
abdd3d9d
Commit
abdd3d9d
authored
Dec 11, 2009
by
hjk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debugger: make Add to Watchwindow menu entry work again
parent
b757b346
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
7 deletions
+34
-7
src/plugins/debugger/debuggermanager.cpp
src/plugins/debugger/debuggermanager.cpp
+27
-6
src/plugins/debugger/debuggerplugin.cpp
src/plugins/debugger/debuggerplugin.cpp
+7
-1
No files found.
src/plugins/debugger/debuggermanager.cpp
View file @
abdd3d9d
...
...
@@ -35,6 +35,7 @@
#include "debuggerconstants.h"
#include "idebuggerengine.h"
#include "debuggerstringutils.h"
#include "watchutils.h"
#include "breakwindow.h"
#include "debuggeroutputwindow.h"
...
...
@@ -57,13 +58,16 @@
#ifdef Q_OS_WIN
# include "shared/peutils.h"
#endif
#include <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h>
#include <utils/qtcassert.h>
#include <utils/fancymainwindow.h>
#include <projectexplorer/toolchain.h>
#include <cplusplus/CppDocument.h>
#include <cpptools/cppmodelmanagerinterface.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <texteditor/itexteditor.h>
#include <QtCore/QDebug>
#include <QtCore/QDir>
...
...
@@ -1178,14 +1182,31 @@ void DebuggerManager::dumpLog()
void
DebuggerManager
::
addToWatchWindow
()
{
using
namespace
Core
;
using
namespace
TextEditor
;
// requires a selection, but that's the only case we want...
QObject
*
ob
=
0
;
queryCurrentTextEditor
(
0
,
0
,
&
ob
);
QPlainTextEdit
*
editor
=
qobject_cast
<
QPlainTextEdit
*>
(
ob
);
EditorManager
*
editorManager
=
EditorManager
::
instance
();
if
(
!
editorManager
)
return
;
IEditor
*
editor
=
editorManager
->
currentEditor
();
if
(
!
editor
)
return
;
QTextCursor
tc
=
editor
->
textCursor
();
theDebuggerAction
(
WatchExpression
)
->
setValue
(
tc
.
selectedText
());
ITextEditor
*
textEditor
=
qobject_cast
<
ITextEditor
*>
(
editor
);
if
(
!
textEditor
)
return
;
QTextCursor
tc
;
QPlainTextEdit
*
ptEdit
=
qobject_cast
<
QPlainTextEdit
*>
(
editor
->
widget
());
if
(
ptEdit
)
tc
=
ptEdit
->
textCursor
();
QString
exp
;
if
(
tc
.
hasSelection
())
{
exp
=
tc
.
selectedText
();
}
else
{
int
line
,
column
;
exp
=
cppExpressionAt
(
textEditor
,
tc
.
position
(),
&
line
,
&
column
);
}
if
(
!
exp
.
isEmpty
())
d
->
m_watchHandler
->
watchExpression
(
exp
);
}
void
DebuggerManager
::
setBreakpoint
(
const
QString
&
fileName
,
int
lineNumber
)
...
...
@@ -1647,7 +1668,7 @@ void DebuggerManager::setState(DebuggerState state, bool forced)
if
(
stopped
)
QApplication
::
alert
(
mainWindow
(),
3000
);
d
->
m_actions
.
watchAction
->
setEnabled
(
stopped
);
d
->
m_actions
.
watchAction
->
setEnabled
(
true
);
d
->
m_actions
.
breakAction
->
setEnabled
(
true
);
bool
interruptIsExit
=
!
running
;
...
...
src/plugins/debugger/debuggerplugin.cpp
View file @
abdd3d9d
...
...
@@ -803,8 +803,14 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
cmd
=
am
->
registerAction
(
actions
.
watchAction
,
Constants
::
ADD_TO_WATCH
,
cppeditorcontext
);
//cmd->setDefaultKeySequence(QKeySequence(tr("ALT+D,ALT+W")));
cmd
->
action
()
->
setEnabled
(
true
);
cmd
->
setDefaultKeySequence
(
QKeySequence
(
tr
(
"ALT+D,ALT+W"
)));
mdebug
->
addAction
(
cmd
);
// QTCREATORBUG-342 asks for that unconditionally
//ActionContainer *editorContextMenu =
// am->actionContainer(CppEditor::Constants::M_CONTEXT);
//editorContextMenu->addAction(cmd);
//cmd->setAttribute(Command::CA_Hide);
// Views menu
cmd
=
am
->
registerAction
(
sep
,
QLatin1String
(
"Debugger.Sep.Views"
),
globalcontext
);
...
...
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