Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
6061f4bb
Commit
6061f4bb
authored
Feb 28, 2011
by
Friedemann Kleint
Browse files
Debugger: Quieten bin editor used as memory editor.
parent
d6164fa0
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/bineditor/bineditor.cpp
View file @
6061f4bb
...
...
@@ -35,11 +35,13 @@
#include <texteditor/fontsettings.h>
#include <texteditor/texteditorconstants.h>
#include <coreplugin/editormanager/ieditor.h>
#include <QtCore/QByteArrayMatcher>
#include <QtCore/QDebug>
#include <QtCore/QFile>
#include <QtCore/QTemporaryFile>
#include <QtCore/QVariant>
#include <QtGui/QApplication>
#include <QtGui/QAction>
...
...
@@ -1453,4 +1455,9 @@ void BinEditor::asIntegers(int offset, int count, quint64 &beValue,
}
}
bool
BinEditor
::
isMemoryView
()
const
{
return
editor
()
->
property
(
"MemoryView"
).
toBool
();
}
}
// namespace BINEditor
src/plugins/bineditor/bineditor.h
View file @
6061f4bb
...
...
@@ -116,6 +116,8 @@ public:
QString
addressString
(
quint64
address
);
bool
isMemoryView
()
const
;
// Is a debugger memory view without file?
static
const
int
SearchStride
=
1024
*
1024
;
public
Q_SLOTS
:
...
...
src/plugins/bineditor/bineditorplugin.cpp
View file @
6061f4bb
...
...
@@ -39,6 +39,8 @@
#include <QtCore/QFileInfo>
#include <QtCore/QDebug>
#include <QtCore/QRegExp>
#include <QtCore/QVariant>
#include <QtGui/QMenu>
#include <QtGui/QAction>
#include <QtGui/QMainWindow>
...
...
@@ -60,6 +62,7 @@
#include <texteditor/fontsettings.h>
#include <texteditor/texteditorsettings.h>
#include <utils/reloadpromptutils.h>
#include <utils/qtcassert.h>
using
namespace
BINEditor
;
using
namespace
BINEditor
::
Internal
;
...
...
@@ -231,6 +234,8 @@ public:
private
slots
:
void
provideData
(
Core
::
IEditor
*
,
quint64
block
)
{
if
(
m_fileName
.
isEmpty
())
return
;
QFile
file
(
m_fileName
);
if
(
file
.
open
(
QIODevice
::
ReadOnly
))
{
int
blockSize
=
m_editor
->
dataBlockSize
();
...
...
@@ -268,10 +273,10 @@ public:
QString
suggestedFileName
()
const
{
return
QString
();
}
bool
isModified
()
const
{
return
m_editor
->
isModified
();
}
bool
isModified
()
const
{
return
m_editor
->
isMemoryView
()
?
false
:
m_editor
->
isModified
();
}
bool
isReadOnly
()
const
{
if
(
m_editor
->
editor
()
->
property
(
"
MemoryView
"
).
toBool
())
if
(
m_editor
->
is
MemoryView
())
return
false
;
const
QFileInfo
fi
(
m_fileName
);
return
!
fi
.
isWritable
();
...
...
@@ -371,7 +376,7 @@ public:
QWidget
*
toolBar
()
{
return
m_toolBar
;
}
bool
isTemporary
()
const
{
return
false
;
}
bool
isTemporary
()
const
{
return
m_editor
->
isMemoryView
()
;
}
private
slots
:
void
updateCursorPosition
(
int
position
)
{
...
...
Write
Preview
Supports
Markdown
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