Commit 49d48760 authored by hjk's avatar hjk

BinEditor/Debugger: Simplify signal and slot signatures

The IEditor parameter was never used.

Change-Id: Id374d9404701131d6c3ee02ed43fdbf3e3ed8af8
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
parent b462f377
...@@ -196,7 +196,7 @@ bool BinEditorWidget::requestDataAt(int pos) const ...@@ -196,7 +196,7 @@ bool BinEditorWidget::requestDataAt(int pos) const
if (!m_requests.contains(block)) { if (!m_requests.contains(block)) {
m_requests.insert(block); m_requests.insert(block);
emit const_cast<BinEditorWidget*>(this)-> emit const_cast<BinEditorWidget*>(this)->
dataRequested(editor(), m_baseAddr / m_blockSize + block); dataRequested(m_baseAddr / m_blockSize + block);
return true; return true;
} }
return false; return false;
...@@ -230,7 +230,7 @@ void BinEditorWidget::changeDataAt(int pos, char c) ...@@ -230,7 +230,7 @@ void BinEditorWidget::changeDataAt(int pos, char c)
} }
} }
emit dataChanged(editor(), m_baseAddr + pos, QByteArray(1, c)); emit dataChanged(m_baseAddr + pos, QByteArray(1, c));
} }
QByteArray BinEditorWidget::dataMid(int from, int length, bool old) const QByteArray BinEditorWidget::dataMid(int from, int length, bool old) const
...@@ -442,9 +442,9 @@ void BinEditorWidget::scrollContentsBy(int dx, int dy) ...@@ -442,9 +442,9 @@ void BinEditorWidget::scrollContentsBy(int dx, int dy)
const QScrollBar * const scrollBar = verticalScrollBar(); const QScrollBar * const scrollBar = verticalScrollBar();
const int scrollPos = scrollBar->value(); const int scrollPos = scrollBar->value();
if (dy <= 0 && scrollPos == scrollBar->maximum()) if (dy <= 0 && scrollPos == scrollBar->maximum())
emit newRangeRequested(editor(), baseAddress() + m_size); emit newRangeRequested(baseAddress() + m_size);
else if (dy >= 0 && scrollPos == scrollBar->minimum()) else if (dy >= 0 && scrollPos == scrollBar->minimum())
emit newRangeRequested(editor(), baseAddress()); emit newRangeRequested(baseAddress());
} }
void BinEditorWidget::changeEvent(QEvent *e) void BinEditorWidget::changeEvent(QEvent *e)
...@@ -1058,7 +1058,7 @@ bool BinEditorWidget::event(QEvent *e) ...@@ -1058,7 +1058,7 @@ bool BinEditorWidget::event(QEvent *e)
const QScrollBar * const scrollBar = verticalScrollBar(); const QScrollBar * const scrollBar = verticalScrollBar();
const int maximum = scrollBar->maximum(); const int maximum = scrollBar->maximum();
if (maximum && scrollBar->value() >= maximum - 1) { if (maximum && scrollBar->value() >= maximum - 1) {
emit newRangeRequested(editor(), baseAddress() + m_size); emit newRangeRequested(baseAddress() + m_size);
return true; return true;
} }
break; break;
...@@ -1571,7 +1571,7 @@ void BinEditorWidget::jumpToAddress(quint64 address) ...@@ -1571,7 +1571,7 @@ void BinEditorWidget::jumpToAddress(quint64 address)
if (address >= m_baseAddr && address < m_baseAddr + m_size) if (address >= m_baseAddr && address < m_baseAddr + m_size)
setCursorPosition(address - m_baseAddr); setCursorPosition(address - m_baseAddr);
else else
emit newRangeRequested(editor(), address); emit newRangeRequested(address);
} }
void BinEditorWidget::setNewWindowRequestAllowed(bool c) void BinEditorWidget::setNewWindowRequestAllowed(bool c)
......
...@@ -139,11 +139,11 @@ Q_SIGNALS: ...@@ -139,11 +139,11 @@ Q_SIGNALS:
void redoAvailable(bool); void redoAvailable(bool);
void cursorPositionChanged(int position); void cursorPositionChanged(int position);
void dataRequested(Core::IEditor *editor, quint64 block); void dataRequested(quint64 block);
void newWindowRequested(quint64 address); void newWindowRequested(quint64 address);
void newRangeRequested(Core::IEditor *, quint64 address); void newRangeRequested(quint64 address);
void addWatchpointRequested(quint64 address, uint size); void addWatchpointRequested(quint64 address, uint size);
void dataChanged(Core::IEditor *, quint64 address, const QByteArray &data); void dataChanged(quint64 address, const QByteArray &data);
protected: protected:
void scrollContentsBy(int dx, int dy); void scrollContentsBy(int dx, int dy);
......
...@@ -184,10 +184,10 @@ public: ...@@ -184,10 +184,10 @@ public:
Core::IDocument(parent) Core::IDocument(parent)
{ {
m_widget = parent; m_widget = parent;
connect(m_widget, SIGNAL(dataRequested(Core::IEditor*,quint64)), connect(m_widget, SIGNAL(dataRequested(quint64)),
this, SLOT(provideData(Core::IEditor*,quint64))); this, SLOT(provideData(quint64)));
connect(m_widget, SIGNAL(newRangeRequested(Core::IEditor*,quint64)), connect(m_widget, SIGNAL(newRangeRequested(quint64)),
this, SLOT(provideNewRange(Core::IEditor*,quint64))); this, SLOT(provideNewRange(quint64)));
} }
~BinEditorDocument() {} ~BinEditorDocument() {}
...@@ -246,7 +246,8 @@ public: ...@@ -246,7 +246,8 @@ public:
} }
private slots: private slots:
void provideData(Core::IEditor *, quint64 block) { void provideData(quint64 block)
{
if (m_fileName.isEmpty()) if (m_fileName.isEmpty())
return; return;
QFile file(m_fileName); QFile file(m_fileName);
...@@ -266,7 +267,8 @@ private slots: ...@@ -266,7 +267,8 @@ private slots:
} }
} }
void provideNewRange(Core::IEditor *, quint64 offset) { void provideNewRange(quint64 offset)
{
open(0, m_fileName, offset); open(0, m_fileName, offset);
} }
......
...@@ -129,24 +129,12 @@ void MemoryAgent::updateMemoryView(quint64 address, quint64 length) ...@@ -129,24 +129,12 @@ void MemoryAgent::updateMemoryView(quint64 address, quint64 length)
void MemoryAgent::connectBinEditorWidget(QWidget *w) void MemoryAgent::connectBinEditorWidget(QWidget *w)
{ {
connect(w, connect(w, SIGNAL(dataRequested(quint64)), SLOT(fetchLazyData(quint64)));
SIGNAL(dataRequested(Core::IEditor*,quint64)), connect(w, SIGNAL(newWindowRequested(quint64)), SLOT(createBinEditor(quint64)));
SLOT(fetchLazyData(Core::IEditor*,quint64))); connect(w, SIGNAL(newRangeRequested(quint64)), SLOT(provideNewRange(quint64)));
connect(w, connect(w, SIGNAL(dataChanged(quint64,QByteArray)), SLOT(handleDataChanged(quint64,QByteArray)));
SIGNAL(newWindowRequested(quint64)), connect(w, SIGNAL(dataChanged(quint64,QByteArray)), SLOT(handleDataChanged(quint64,QByteArray)));
SLOT(createBinEditor(quint64))); connect(w, SIGNAL(addWatchpointRequested(quint64,uint)), SLOT(handleWatchpointRequest(quint64,uint)));
connect(w,
SIGNAL(newRangeRequested(Core::IEditor*,quint64)),
SLOT(provideNewRange(Core::IEditor*,quint64)));
connect(w,
SIGNAL(dataChanged(Core::IEditor*,quint64,QByteArray)),
SLOT(handleDataChanged(Core::IEditor*,quint64,QByteArray)));
connect(w,
SIGNAL(dataChanged(Core::IEditor*,quint64,QByteArray)),
SLOT(handleDataChanged(Core::IEditor*,quint64,QByteArray)));
connect(w,
SIGNAL(addWatchpointRequested(quint64,uint)),
SLOT(handleWatchpointRequest(quint64,uint)));
} }
bool MemoryAgent::doCreateBinEditor(quint64 addr, unsigned flags, bool MemoryAgent::doCreateBinEditor(quint64 addr, unsigned flags,
...@@ -222,7 +210,7 @@ void MemoryAgent::createBinEditor(quint64 addr) ...@@ -222,7 +210,7 @@ void MemoryAgent::createBinEditor(quint64 addr)
createBinEditor(addr, 0, QList<MemoryMarkup>(), QPoint(), QString(), 0); createBinEditor(addr, 0, QList<MemoryMarkup>(), QPoint(), QString(), 0);
} }
void MemoryAgent::fetchLazyData(IEditor *, quint64 block) void MemoryAgent::fetchLazyData(quint64 block)
{ {
m_engine->fetchMemory(this, sender(), BinBlockSize * block, BinBlockSize); m_engine->fetchMemory(this, sender(), BinBlockSize * block, BinBlockSize);
} }
...@@ -235,15 +223,14 @@ void MemoryAgent::addLazyData(QObject *editorToken, quint64 addr, ...@@ -235,15 +223,14 @@ void MemoryAgent::addLazyData(QObject *editorToken, quint64 addr,
MemoryView::binEditorAddData(w, addr, ba); MemoryView::binEditorAddData(w, addr, ba);
} }
void MemoryAgent::provideNewRange(IEditor *, quint64 address) void MemoryAgent::provideNewRange(quint64 address)
{ {
QWidget *w = qobject_cast<QWidget *>(sender()); QWidget *w = qobject_cast<QWidget *>(sender());
QTC_ASSERT(w, return); QTC_ASSERT(w, return);
MemoryView::setBinEditorRange(w, address, DataRange, BinBlockSize); MemoryView::setBinEditorRange(w, address, DataRange, BinBlockSize);
} }
void MemoryAgent::handleDataChanged(IEditor *, void MemoryAgent::handleDataChanged(quint64 addr, const QByteArray &data)
quint64 addr, const QByteArray &data)
{ {
m_engine->changeMemory(this, sender(), addr, data); m_engine->changeMemory(this, sender(), addr, data);
} }
......
...@@ -95,10 +95,9 @@ public slots: ...@@ -95,10 +95,9 @@ public slots:
void closeViews(); void closeViews();
private slots: private slots:
void fetchLazyData(Core::IEditor *, quint64 block); void fetchLazyData(quint64 block);
void provideNewRange(Core::IEditor *editor, quint64 address); void provideNewRange(quint64 address);
void handleDataChanged(Core::IEditor *editor, quint64 address, void handleDataChanged(quint64 address, const QByteArray &data);
const QByteArray &data);
void handleWatchpointRequest(quint64 address, uint size); void handleWatchpointRequest(quint64 address, uint size);
void updateMemoryView(quint64 address, quint64 length); void updateMemoryView(quint64 address, quint64 length);
void engineStateChanged(Debugger::DebuggerState s); void engineStateChanged(Debugger::DebuggerState s);
......
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