forked from qt-creator/qt-creator
Merge remote branch 'origin/2.0'
Conflicts: doc/qtcreator.qdoc src/plugins/bineditor/bineditorplugin.cpp
This commit is contained in:
BIN
doc/images/qmldesigner-helloworld-edited.png
Normal file
BIN
doc/images/qmldesigner-helloworld-edited.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 9.7 KiB |
BIN
doc/images/qtcreator-overview.png
Normal file
BIN
doc/images/qtcreator-overview.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 101 KiB |
File diff suppressed because it is too large
Load Diff
@@ -57,6 +57,11 @@ qhp.QtCreator.extraFiles = \
|
|||||||
images/qt-logo.png \
|
images/qt-logo.png \
|
||||||
images/sprites-combined.png
|
images/sprites-combined.png
|
||||||
|
|
||||||
|
qhp.QtCreator.subprojects = manual
|
||||||
|
qhp.QtCreator.subprojects.manual.title = Qt Creator Manual
|
||||||
|
qhp.QtCreator.subprojects.manual.indexTitle = Qt Creator Manual
|
||||||
|
qhp.QtCreator.subprojects.manual.type = manual
|
||||||
|
|
||||||
# macros.qdocconf
|
# macros.qdocconf
|
||||||
|
|
||||||
macro.aring.HTML = "å"
|
macro.aring.HTML = "å"
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ void BinEditor::init()
|
|||||||
horizontalScrollBar()->setPageStep(viewport()->width());
|
horizontalScrollBar()->setPageStep(viewport()->width());
|
||||||
verticalScrollBar()->setRange(0, m_numLines - m_numVisibleLines);
|
verticalScrollBar()->setRange(0, m_numLines - m_numVisibleLines);
|
||||||
verticalScrollBar()->setPageStep(m_numVisibleLines);
|
verticalScrollBar()->setPageStep(m_numVisibleLines);
|
||||||
|
ensureCursorVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -393,7 +394,10 @@ bool BinEditor::save(const QString &oldFileName, const QString &newFileName)
|
|||||||
if (output.write(it.value()) < m_blockSize)
|
if (output.write(it.value()) < m_blockSize)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (size % m_blockSize != 0 && !output.resize(size))
|
|
||||||
|
// We may have padded the displayed data, so we have to make sure
|
||||||
|
// changes to that area are not actually written back to disk.
|
||||||
|
if (!output.resize(size))
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
QFile output(newFileName);
|
QFile output(newFileName);
|
||||||
@@ -435,6 +439,7 @@ void BinEditor::setLazyData(quint64 startAddr, int range, int blockSize)
|
|||||||
init();
|
init();
|
||||||
|
|
||||||
setCursorPosition(startAddr - m_baseAddr);
|
setCursorPosition(startAddr - m_baseAddr);
|
||||||
|
viewport()->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::resizeEvent(QResizeEvent *)
|
void BinEditor::resizeEvent(QResizeEvent *)
|
||||||
@@ -445,6 +450,15 @@ void BinEditor::resizeEvent(QResizeEvent *)
|
|||||||
void BinEditor::scrollContentsBy(int dx, int dy)
|
void BinEditor::scrollContentsBy(int dx, int dy)
|
||||||
{
|
{
|
||||||
viewport()->scroll(isRightToLeft() ? -dx : dx, dy * m_lineHeight);
|
viewport()->scroll(isRightToLeft() ? -dx : dx, dy * m_lineHeight);
|
||||||
|
if (m_inLazyMode) {
|
||||||
|
const QScrollBar * const scrollBar = verticalScrollBar();
|
||||||
|
const int scrollPos = scrollBar->value();
|
||||||
|
if (dy <= 0 && scrollPos == scrollBar->maximum())
|
||||||
|
emit newRangeRequested(editorInterface(),
|
||||||
|
baseAddress() + dataSize());
|
||||||
|
else if (dy >= 0 && scrollPos == scrollBar->minimum())
|
||||||
|
emit newRangeRequested(editorInterface(), baseAddress());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditor::changeEvent(QEvent *e)
|
void BinEditor::changeEvent(QEvent *e)
|
||||||
@@ -913,11 +927,6 @@ int BinEditor::cursorPosition() const
|
|||||||
void BinEditor::setCursorPosition(int pos, MoveMode moveMode)
|
void BinEditor::setCursorPosition(int pos, MoveMode moveMode)
|
||||||
{
|
{
|
||||||
pos = qMin(m_size-1, qMax(0, pos));
|
pos = qMin(m_size-1, qMax(0, pos));
|
||||||
if (pos == m_cursorPosition
|
|
||||||
&& (m_anchorPosition == m_cursorPosition || moveMode == KeepAnchor)
|
|
||||||
&& !m_lowNibble)
|
|
||||||
return;
|
|
||||||
|
|
||||||
int oldCursorPosition = m_cursorPosition;
|
int oldCursorPosition = m_cursorPosition;
|
||||||
|
|
||||||
bool hasSelection = m_anchorPosition != m_cursorPosition;
|
bool hasSelection = m_anchorPosition != m_cursorPosition;
|
||||||
@@ -1009,6 +1018,16 @@ bool BinEditor::event(QEvent *e) {
|
|||||||
ensureCursorVisible();
|
ensureCursorVisible();
|
||||||
e->accept();
|
e->accept();
|
||||||
return true;
|
return true;
|
||||||
|
case Qt::Key_Down:
|
||||||
|
if (m_inLazyMode) {
|
||||||
|
const QScrollBar * const scrollBar = verticalScrollBar();
|
||||||
|
if (scrollBar->value() >= scrollBar->maximum() - 1) {
|
||||||
|
emit newRangeRequested(editorInterface(),
|
||||||
|
baseAddress() + dataSize());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:;
|
default:;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1282,9 +1301,9 @@ void BinEditor::contextMenuEvent(QContextMenuEvent *event)
|
|||||||
else if (action == ©HexAction)
|
else if (action == ©HexAction)
|
||||||
copy(false);
|
copy(false);
|
||||||
else if (action == &jumpToBeAddressHere)
|
else if (action == &jumpToBeAddressHere)
|
||||||
setCursorPosition(beAddress - m_baseAddr);
|
jumpToAddress(beAddress);
|
||||||
else if (action == &jumpToLeAddressHere)
|
else if (action == &jumpToLeAddressHere)
|
||||||
setCursorPosition(leAddress - m_baseAddr);
|
jumpToAddress(leAddress);
|
||||||
else if (action == &jumpToBeAddressNewWindow)
|
else if (action == &jumpToBeAddressNewWindow)
|
||||||
emit newWindowRequested(beAddress);
|
emit newWindowRequested(beAddress);
|
||||||
else if (action == &jumpToLeAddressNewWindow)
|
else if (action == &jumpToLeAddressNewWindow)
|
||||||
@@ -1300,12 +1319,18 @@ void BinEditor::setupJumpToMenuAction(QMenu *menu, QAction *actionHere,
|
|||||||
.arg(QString::number(addr, 16)));
|
.arg(QString::number(addr, 16)));
|
||||||
menu->addAction(actionHere);
|
menu->addAction(actionHere);
|
||||||
menu->addAction(actionNew);
|
menu->addAction(actionNew);
|
||||||
if (addr < m_baseAddr || addr >= m_baseAddr + m_size)
|
|
||||||
actionHere->setEnabled(false);
|
|
||||||
if (!m_canRequestNewWindow)
|
if (!m_canRequestNewWindow)
|
||||||
actionNew->setEnabled(false);
|
actionNew->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BinEditor::jumpToAddress(quint64 address)
|
||||||
|
{
|
||||||
|
if (address >= m_baseAddr && address < m_baseAddr + m_data.size())
|
||||||
|
setCursorPosition(address - m_baseAddr);
|
||||||
|
else
|
||||||
|
emit newRangeRequested(editorInterface(), address);
|
||||||
|
}
|
||||||
|
|
||||||
void BinEditor::setNewWindowRequestAllowed()
|
void BinEditor::setNewWindowRequestAllowed()
|
||||||
{
|
{
|
||||||
m_canRequestNewWindow = true;
|
m_canRequestNewWindow = true;
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ public:
|
|||||||
QByteArray data() const;
|
QByteArray data() const;
|
||||||
|
|
||||||
inline int dataSize() const { return m_size; }
|
inline int dataSize() const { return m_size; }
|
||||||
|
quint64 baseAddress() const { return m_baseAddr; }
|
||||||
|
|
||||||
inline bool inLazyMode() const { return m_inLazyMode; }
|
inline bool inLazyMode() const { return m_inLazyMode; }
|
||||||
Q_INVOKABLE void setLazyData(quint64 startAddr, int range, int blockSize = 4096);
|
Q_INVOKABLE void setLazyData(quint64 startAddr, int range, int blockSize = 4096);
|
||||||
@@ -84,6 +85,7 @@ public:
|
|||||||
|
|
||||||
int cursorPosition() const;
|
int cursorPosition() const;
|
||||||
void setCursorPosition(int pos, MoveMode moveMode = MoveAnchor);
|
void setCursorPosition(int pos, MoveMode moveMode = MoveAnchor);
|
||||||
|
void jumpToAddress(quint64 address);
|
||||||
|
|
||||||
void setModified(bool);
|
void setModified(bool);
|
||||||
bool isModified() const;
|
bool isModified() const;
|
||||||
@@ -130,6 +132,7 @@ Q_SIGNALS:
|
|||||||
|
|
||||||
void lazyDataRequested(Core::IEditor *editor, quint64 block, bool synchronous);
|
void lazyDataRequested(Core::IEditor *editor, quint64 block, bool synchronous);
|
||||||
void newWindowRequested(quint64 address);
|
void newWindowRequested(quint64 address);
|
||||||
|
void newRangeRequested(Core::IEditor *, quint64 address);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void scrollContentsBy(int dx, int dy);
|
void scrollContentsBy(int dx, int dy);
|
||||||
|
|||||||
@@ -34,10 +34,13 @@
|
|||||||
#include <QtCore/QFile>
|
#include <QtCore/QFile>
|
||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
|
#include <QtCore/QRegExp>
|
||||||
#include <QtGui/QMenu>
|
#include <QtGui/QMenu>
|
||||||
#include <QtGui/QAction>
|
#include <QtGui/QAction>
|
||||||
#include <QtGui/QMainWindow>
|
#include <QtGui/QMainWindow>
|
||||||
#include <QtGui/QHBoxLayout>
|
#include <QtGui/QHBoxLayout>
|
||||||
|
#include <QtGui/QLineEdit>
|
||||||
|
#include <QtGui/QRegExpValidator>
|
||||||
#include <QtGui/QToolBar>
|
#include <QtGui/QToolBar>
|
||||||
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
@@ -51,7 +54,6 @@
|
|||||||
#include <find/ifindsupport.h>
|
#include <find/ifindsupport.h>
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
#include <texteditor/texteditorsettings.h>
|
#include <texteditor/texteditorsettings.h>
|
||||||
#include <utils/linecolumnlabel.h>
|
|
||||||
#include <utils/reloadpromptutils.h>
|
#include <utils/reloadpromptutils.h>
|
||||||
|
|
||||||
using namespace BINEditor;
|
using namespace BINEditor;
|
||||||
@@ -176,6 +178,8 @@ public:
|
|||||||
m_editor = parent;
|
m_editor = parent;
|
||||||
connect(m_editor, SIGNAL(lazyDataRequested(Core::IEditor *, quint64, bool)),
|
connect(m_editor, SIGNAL(lazyDataRequested(Core::IEditor *, quint64, bool)),
|
||||||
this, SLOT(provideData(Core::IEditor *, quint64)));
|
this, SLOT(provideData(Core::IEditor *, quint64)));
|
||||||
|
connect(m_editor, SIGNAL(newRangeRequested(Core::IEditor*,quint64)),
|
||||||
|
this, SLOT(provideNewRange(Core::IEditor*,quint64)));
|
||||||
}
|
}
|
||||||
~BinEditorFile() {}
|
~BinEditorFile() {}
|
||||||
|
|
||||||
@@ -199,15 +203,16 @@ public:
|
|||||||
emit changed();
|
emit changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool open(const QString &fileName) {
|
bool open(const QString &fileName, quint64 offset = 0) {
|
||||||
QFile file(fileName);
|
QFile file(fileName);
|
||||||
if (file.open(QIODevice::ReadOnly)) {
|
if (offset < static_cast<quint64>(file.size())
|
||||||
|
&& file.open(QIODevice::ReadOnly)) {
|
||||||
m_fileName = fileName;
|
m_fileName = fileName;
|
||||||
if (file.isSequential() && file.size() <= 64 * 1024 * 1024) {
|
qint64 maxRange = 64 * 1024 * 1024;
|
||||||
|
if (file.isSequential() && file.size() <= maxRange) {
|
||||||
m_editor->setData(file.readAll());
|
m_editor->setData(file.readAll());
|
||||||
} else {
|
} else {
|
||||||
m_editor->setLazyData(0, qMin(file.size(),
|
m_editor->setLazyData(offset, maxRange);
|
||||||
static_cast<qint64>(INT_MAX-16)));
|
|
||||||
m_editor->editorInterface()->
|
m_editor->editorInterface()->
|
||||||
setDisplayName(QFileInfo(fileName).fileName());
|
setDisplayName(QFileInfo(fileName).fileName());
|
||||||
}
|
}
|
||||||
@@ -224,12 +229,18 @@ private slots:
|
|||||||
int blockSize = m_editor->lazyDataBlockSize();
|
int blockSize = m_editor->lazyDataBlockSize();
|
||||||
file.seek(block * blockSize);
|
file.seek(block * blockSize);
|
||||||
QByteArray data = file.read(blockSize);
|
QByteArray data = file.read(blockSize);
|
||||||
if (data.size() != blockSize)
|
const int dataSize = data.size();
|
||||||
data.resize(blockSize);
|
if (dataSize != blockSize)
|
||||||
|
data += QByteArray(blockSize - dataSize, 0);
|
||||||
m_editor->addLazyData(block, data);
|
m_editor->addLazyData(block, data);
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void provideNewRange(Core::IEditor *, quint64 offset) {
|
||||||
|
open(m_fileName, offset);
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void setFilename(const QString &filename) {
|
void setFilename(const QString &filename) {
|
||||||
@@ -294,22 +305,30 @@ public:
|
|||||||
m_file = new BinEditorFile(m_editor);
|
m_file = new BinEditorFile(m_editor);
|
||||||
m_context.add(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID);
|
m_context.add(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID);
|
||||||
m_context.add(Constants::C_BINEDITOR);
|
m_context.add(Constants::C_BINEDITOR);
|
||||||
m_cursorPositionLabel = new Utils::LineColumnLabel;
|
m_addressEdit = new QLineEdit;
|
||||||
|
QRegExpValidator * const addressValidator
|
||||||
|
= new QRegExpValidator(QRegExp(QLatin1String("[0-9a-fA-F]{1,16}")),
|
||||||
|
m_addressEdit);
|
||||||
|
m_addressEdit->setValidator(addressValidator);
|
||||||
|
|
||||||
QHBoxLayout *l = new QHBoxLayout;
|
QHBoxLayout *l = new QHBoxLayout;
|
||||||
QWidget *w = new QWidget;
|
QWidget *w = new QWidget;
|
||||||
l->setMargin(0);
|
l->setMargin(0);
|
||||||
l->setContentsMargins(0, 0, 5, 0);
|
l->setContentsMargins(0, 0, 5, 0);
|
||||||
l->addStretch(1);
|
l->addStretch(1);
|
||||||
l->addWidget(m_cursorPositionLabel);
|
l->addWidget(m_addressEdit);
|
||||||
w->setLayout(l);
|
w->setLayout(l);
|
||||||
|
|
||||||
m_toolBar = new QToolBar;
|
m_toolBar = new QToolBar;
|
||||||
m_toolBar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
m_toolBar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||||
m_toolBar->addWidget(w);
|
m_toolBar->addWidget(w);
|
||||||
|
|
||||||
connect(m_editor, SIGNAL(cursorPositionChanged(int)), this, SLOT(updateCursorPosition(int)));
|
connect(m_editor, SIGNAL(cursorPositionChanged(int)), this,
|
||||||
|
SLOT(updateCursorPosition(int)));
|
||||||
connect(m_file, SIGNAL(changed()), this, SIGNAL(changed()));
|
connect(m_file, SIGNAL(changed()), this, SIGNAL(changed()));
|
||||||
|
connect(m_addressEdit, SIGNAL(editingFinished()), this,
|
||||||
|
SLOT(jumpToAddress()));
|
||||||
|
updateCursorPosition(m_editor->cursorPosition());
|
||||||
}
|
}
|
||||||
~BinEditorInterface() {
|
~BinEditorInterface() {
|
||||||
delete m_editor;
|
delete m_editor;
|
||||||
@@ -342,10 +361,14 @@ public:
|
|||||||
|
|
||||||
bool isTemporary() const { return false; }
|
bool isTemporary() const { return false; }
|
||||||
|
|
||||||
public slots:
|
private slots:
|
||||||
void updateCursorPosition(int position) {
|
void updateCursorPosition(int position) {
|
||||||
m_cursorPositionLabel->setText(m_editor->addressString((uint)position),
|
m_addressEdit->setText(QString::number(m_editor->baseAddress() + position, 16));
|
||||||
m_editor->addressString((uint)m_editor->data().size()));
|
}
|
||||||
|
|
||||||
|
void jumpToAddress() {
|
||||||
|
m_editor->jumpToAddress(m_addressEdit->text().toULongLong(0, 16));
|
||||||
|
updateCursorPosition(m_editor->cursorPosition());
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -354,7 +377,7 @@ private:
|
|||||||
BinEditorFile *m_file;
|
BinEditorFile *m_file;
|
||||||
Core::Context m_context;
|
Core::Context m_context;
|
||||||
QToolBar *m_toolBar;
|
QToolBar *m_toolBar;
|
||||||
Utils::LineColumnLabel *m_cursorPositionLabel;
|
QLineEdit *m_addressEdit;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -110,6 +110,9 @@ void MemoryViewAgent::createBinEditor(quint64 addr)
|
|||||||
this, SLOT(fetchLazyData(Core::IEditor *, quint64,bool)));
|
this, SLOT(fetchLazyData(Core::IEditor *, quint64,bool)));
|
||||||
connect(editor->widget(), SIGNAL(newWindowRequested(quint64)),
|
connect(editor->widget(), SIGNAL(newWindowRequested(quint64)),
|
||||||
this, SLOT(createBinEditor(quint64)));
|
this, SLOT(createBinEditor(quint64)));
|
||||||
|
connect(editor->widget(),
|
||||||
|
SIGNAL(newRangeRequested(Core::IEditor *, quint64)), this,
|
||||||
|
SLOT(provideNewRange(Core::IEditor*,quint64)));
|
||||||
m_editors << editor;
|
m_editors << editor;
|
||||||
editorManager->activateEditor(editor);
|
editorManager->activateEditor(editor);
|
||||||
QMetaObject::invokeMethod(editor->widget(), "setNewWindowRequestAllowed");
|
QMetaObject::invokeMethod(editor->widget(), "setNewWindowRequestAllowed");
|
||||||
@@ -141,6 +144,13 @@ void MemoryViewAgent::addLazyData(QObject *editorToken, quint64 addr,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MemoryViewAgent::provideNewRange(Core::IEditor *editor, quint64 address)
|
||||||
|
{
|
||||||
|
QMetaObject::invokeMethod(editor->widget(), "setLazyData",
|
||||||
|
Q_ARG(quint64, address), Q_ARG(int, 1024 * 1024),
|
||||||
|
Q_ARG(int, BinBlockSize));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -58,11 +58,11 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
// Called from Engine
|
// Called from Engine
|
||||||
void addLazyData(QObject *editorToken, quint64 addr, const QByteArray &data);
|
void addLazyData(QObject *editorToken, quint64 addr, const QByteArray &data);
|
||||||
// Called from Editor
|
|
||||||
void fetchLazyData(Core::IEditor *, quint64 block, bool sync);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_SLOT void createBinEditor(quint64 startAddr);
|
Q_SLOT void createBinEditor(quint64 startAddr);
|
||||||
|
Q_SLOT void fetchLazyData(Core::IEditor *, quint64 block, bool sync);
|
||||||
|
Q_SLOT void provideNewRange(Core::IEditor *editor, quint64 address);
|
||||||
|
|
||||||
QList<QPointer<Core::IEditor> > m_editors;
|
QList<QPointer<Core::IEditor> > m_editors;
|
||||||
QPointer<DebuggerEngine> m_engine;
|
QPointer<DebuggerEngine> m_engine;
|
||||||
|
|||||||
@@ -245,12 +245,12 @@ const char * const NEXT_KEY = "F6";
|
|||||||
const char * const REVERSE_KEY = "";
|
const char * const REVERSE_KEY = "";
|
||||||
const char * const RUN_TO_LINE_KEY = "Shift+F8";
|
const char * const RUN_TO_LINE_KEY = "Shift+F8";
|
||||||
const char * const RUN_TO_FUNCTION_KEY = "Ctrl+F6";
|
const char * const RUN_TO_FUNCTION_KEY = "Ctrl+F6";
|
||||||
const char * const JUMP_TO_LINE_KEY = "Alt+D,Alt+L";
|
const char * const JUMP_TO_LINE_KEY = "Ctrl+D,Ctrl+L";
|
||||||
const char * const TOGGLE_BREAK_KEY = "F8";
|
const char * const TOGGLE_BREAK_KEY = "F8";
|
||||||
const char * const BREAK_BY_FUNCTION_KEY = "Alt+D,Alt+F";
|
const char * const BREAK_BY_FUNCTION_KEY = "Ctrl+D,Ctrl+F";
|
||||||
const char * const BREAK_AT_MAIN_KEY = "Alt+D,Alt+M";
|
const char * const BREAK_AT_MAIN_KEY = "Ctrl+D,Ctrl+M";
|
||||||
const char * const ADD_TO_WATCH_KEY = "Alt+D,Alt+W";
|
const char * const ADD_TO_WATCH_KEY = "Ctrl+D,Ctrl+W";
|
||||||
const char * const SNAPSHOT_KEY = "Alt+D,Alt+S";
|
const char * const SNAPSHOT_KEY = "Ctrl+D,Ctrl+S";
|
||||||
#else
|
#else
|
||||||
const char * const INTERRUPT_KEY = "Shift+F5";
|
const char * const INTERRUPT_KEY = "Shift+F5";
|
||||||
const char * const RESET_KEY = "Ctrl+Shift+F5";
|
const char * const RESET_KEY = "Ctrl+Shift+F5";
|
||||||
@@ -265,7 +265,7 @@ const char * const TOGGLE_BREAK_KEY = "F9";
|
|||||||
const char * const BREAK_BY_FUNCTION_KEY = "";
|
const char * const BREAK_BY_FUNCTION_KEY = "";
|
||||||
const char * const BREAK_AT_MAIN_KEY = "";
|
const char * const BREAK_AT_MAIN_KEY = "";
|
||||||
const char * const ADD_TO_WATCH_KEY = "Ctrl+Alt+Q";
|
const char * const ADD_TO_WATCH_KEY = "Ctrl+Alt+Q";
|
||||||
const char * const SNAPSHOT_KEY = "Alt+D,Alt+S";
|
const char * const SNAPSHOT_KEY = "Ctrl+D,Ctrl+S";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace Constants
|
} // namespace Constants
|
||||||
@@ -1400,7 +1400,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
|
|||||||
cmd = am->registerAction(m_actions.watchAction1,
|
cmd = am->registerAction(m_actions.watchAction1,
|
||||||
Constants::ADD_TO_WATCH1, cppeditorcontext);
|
Constants::ADD_TO_WATCH1, cppeditorcontext);
|
||||||
cmd->action()->setEnabled(true);
|
cmd->action()->setEnabled(true);
|
||||||
//cmd->setDefaultKeySequence(QKeySequence(tr("ALT+D,ALT+W")));
|
//cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+D,Ctrl+W")));
|
||||||
m_uiSwitcher->addMenuAction(cmd, Constants::LANG_CPP);
|
m_uiSwitcher->addMenuAction(cmd, Constants::LANG_CPP);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ void GitCommand::run()
|
|||||||
|
|
||||||
// Special hack: Always produce output for diff
|
// Special hack: Always produce output for diff
|
||||||
if (ok && stdOut.isEmpty() && m_jobs.front().arguments.at(0) == QLatin1String("diff")) {
|
if (ok && stdOut.isEmpty() && m_jobs.front().arguments.at(0) == QLatin1String("diff")) {
|
||||||
stdOut += "The file does not differ from HEAD";
|
stdOut += "No difference to HEAD";
|
||||||
} else {
|
} else {
|
||||||
// @TODO: Remove, see below
|
// @TODO: Remove, see below
|
||||||
if (ok && m_jobs.front().arguments.at(0) == QLatin1String("status"))
|
if (ok && m_jobs.front().arguments.at(0) == QLatin1String("status"))
|
||||||
|
|||||||
@@ -116,20 +116,25 @@ QString DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(const QStrin
|
|||||||
if (!Core::ICore::instance())
|
if (!Core::ICore::instance())
|
||||||
return QString();
|
return QString();
|
||||||
const QString dumperSourcePath = Core::ICore::instance()->resourcePath() + QLatin1String("/gdbmacros/");
|
const QString dumperSourcePath = Core::ICore::instance()->resourcePath() + QLatin1String("/gdbmacros/");
|
||||||
QDateTime lastModified = QFileInfo(dumperSourcePath + "gdbmacros.cpp").lastModified();
|
QDateTime sourcesModified = QFileInfo(dumperSourcePath + "gdbmacros.cpp").lastModified();
|
||||||
// We pretend that the lastmodified of gdbmacros.cpp is 5 minutes before what the file system says
|
// We pretend that the lastmodified of gdbmacros.cpp is 5 minutes before what the file system says
|
||||||
// Because afer a installation from the package the modified dates of gdbmacros.cpp
|
// Because afer a installation from the package the modified dates of gdbmacros.cpp
|
||||||
// and the actual library are close to each other, but not deterministic in one direction
|
// and the actual library are close to each other, but not deterministic in one direction
|
||||||
lastModified = lastModified.addSecs(-300);
|
sourcesModified = sourcesModified.addSecs(-300);
|
||||||
|
|
||||||
|
// look for the newest helper library in the different locations
|
||||||
|
QString newestHelper;
|
||||||
|
QDateTime newestHelperModified = sourcesModified; // prevent using one that's older than the sources
|
||||||
QFileInfo fileInfo;
|
QFileInfo fileInfo;
|
||||||
foreach(const QString &directory, debuggingHelperLibraryDirectories(qtInstallData)) {
|
foreach(const QString &directory, debuggingHelperLibraryDirectories(qtInstallData)) {
|
||||||
if (getHelperFileInfoFor(directory, &fileInfo)) {
|
if (getHelperFileInfoFor(directory, &fileInfo)) {
|
||||||
if (fileInfo.lastModified() >= lastModified)
|
if (fileInfo.lastModified() > newestHelperModified) {
|
||||||
return fileInfo.filePath();
|
newestHelper = fileInfo.filePath();
|
||||||
|
newestHelperModified = fileInfo.lastModified();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QString();
|
return newestHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy helper source files to a target directory, replacing older files.
|
// Copy helper source files to a target directory, replacing older files.
|
||||||
|
|||||||
Reference in New Issue
Block a user