Commit 6061f4bb authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Debugger: Quieten bin editor used as memory editor.

parent d6164fa0
......@@ -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
......@@ -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:
......
......@@ -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->isMemoryView())
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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment