forked from qt-creator/qt-creator
Merge commit 'origin/1.1'
This commit is contained in:
2
dist/changes-1.1.0
vendored
2
dist/changes-1.1.0
vendored
@@ -77,5 +77,3 @@ Lots of improvements to
|
|||||||
Additional credits go to:
|
Additional credits go to:
|
||||||
* Martin Aumueller <aumuell@reserv.at> (FakeVim improvements)
|
* Martin Aumueller <aumuell@reserv.at> (FakeVim improvements)
|
||||||
* Kris Wong (different patches)
|
* Kris Wong (different patches)
|
||||||
|
|
||||||
//TODO: this refers to commit c6419ff008bbf1afd2dfa4ed18a09de039cccef6
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ unix:!macx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
target.files += $$OUT_PWD/$$DESTDIR/$$IDE_APP_WRAPPER
|
target.files += $$OUT_PWD/$$DESTDIR/$$IDE_APP_WRAPPER
|
||||||
|
target.files += $$OUT_PWD/$$DESTDIR/$$IDE_APP_TARGET
|
||||||
target.path = /bin
|
target.path = /bin
|
||||||
INSTALLS += target
|
INSTALLS += target
|
||||||
|
|
||||||
|
|||||||
@@ -265,9 +265,14 @@ int ExpressionUnderCursor::startOfFunctionCall(const QTextCursor &cursor)
|
|||||||
break;
|
break;
|
||||||
else if (tk.is(T_LPAREN))
|
else if (tk.is(T_LPAREN))
|
||||||
return startPosition + tk.position();
|
return startPosition + tk.position();
|
||||||
else if (tk.is(T_RPAREN))
|
else if (tk.is(T_RPAREN)) {
|
||||||
index = startOfMatchingBrace(tokens, index);
|
int matchingBrace = startOfMatchingBrace(tokens, index);
|
||||||
else
|
|
||||||
|
if (matchingBrace == index) // If no matching brace found
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
index = matchingBrace;
|
||||||
|
} else
|
||||||
--index;
|
--index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -171,9 +171,16 @@ QString CMakeManager::findQtDir(const ProjectExplorer::Environment &env)
|
|||||||
QFileInfo qmake(path + "/" + possibleCommand);
|
QFileInfo qmake(path + "/" + possibleCommand);
|
||||||
if (qmake.exists()) {
|
if (qmake.exists()) {
|
||||||
if (!qtVersionForQMake(qmake.absoluteFilePath()).isNull()) {
|
if (!qtVersionForQMake(qmake.absoluteFilePath()).isNull()) {
|
||||||
QDir dir(qmake.absoluteDir());
|
QProcess proc;
|
||||||
dir.cdUp();
|
proc.start(qmake.absoluteFilePath(), QStringList() << "-query" << "QT_INSTALL_DATA");
|
||||||
return dir.absolutePath();
|
if (proc.waitForFinished()) {
|
||||||
|
return proc.readAll().trimmed();
|
||||||
|
} else {
|
||||||
|
proc.kill();
|
||||||
|
QDir dir(qmake.absoluteDir());
|
||||||
|
dir.cdUp();
|
||||||
|
return dir.absolutePath();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -835,6 +835,24 @@ QSize SplitterOrView::minimumSizeHint() const
|
|||||||
return QSize(64, 64);
|
return QSize(64, 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSplitter *SplitterOrView::takeSplitter()
|
||||||
|
{
|
||||||
|
QSplitter *oldSplitter = m_splitter;
|
||||||
|
if (m_splitter)
|
||||||
|
m_layout->removeWidget(m_splitter);
|
||||||
|
m_splitter = 0;
|
||||||
|
return oldSplitter;
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorView *SplitterOrView::takeView()
|
||||||
|
{
|
||||||
|
EditorView *oldView = m_view;
|
||||||
|
if (m_view)
|
||||||
|
m_layout->removeWidget(m_view);
|
||||||
|
m_view = 0;
|
||||||
|
return oldView;
|
||||||
|
}
|
||||||
|
|
||||||
void SplitterOrView::split(Qt::Orientation orientation)
|
void SplitterOrView::split(Qt::Orientation orientation)
|
||||||
{
|
{
|
||||||
Q_ASSERT(m_view && m_splitter == 0);
|
Q_ASSERT(m_view && m_splitter == 0);
|
||||||
@@ -903,13 +921,12 @@ void SplitterOrView::unsplit()
|
|||||||
Q_ASSERT(m_splitter->count() == 1);
|
Q_ASSERT(m_splitter->count() == 1);
|
||||||
EditorManager *em = CoreImpl::instance()->editorManager();
|
EditorManager *em = CoreImpl::instance()->editorManager();
|
||||||
SplitterOrView *childSplitterOrView = qobject_cast<SplitterOrView*>(m_splitter->widget(0));
|
SplitterOrView *childSplitterOrView = qobject_cast<SplitterOrView*>(m_splitter->widget(0));
|
||||||
|
|
||||||
QSplitter *oldSplitter = m_splitter;
|
QSplitter *oldSplitter = m_splitter;
|
||||||
m_splitter = 0;
|
m_splitter = 0;
|
||||||
|
|
||||||
if (childSplitterOrView->isSplitter()) {
|
if (childSplitterOrView->isSplitter()) {
|
||||||
Q_ASSERT(childSplitterOrView->view() == 0);
|
Q_ASSERT(childSplitterOrView->view() == 0);
|
||||||
m_splitter = childSplitterOrView->splitter();
|
m_splitter = childSplitterOrView->takeSplitter();
|
||||||
m_layout->addWidget(m_splitter);
|
m_layout->addWidget(m_splitter);
|
||||||
m_layout->setCurrentWidget(m_splitter);
|
m_layout->setCurrentWidget(m_splitter);
|
||||||
} else {
|
} else {
|
||||||
@@ -923,8 +940,7 @@ void SplitterOrView::unsplit()
|
|||||||
}
|
}
|
||||||
em->emptyView(childView);
|
em->emptyView(childView);
|
||||||
} else {
|
} else {
|
||||||
m_view = childView;
|
m_view = childSplitterOrView->takeView();
|
||||||
childSplitterOrView->m_layout->removeWidget(m_view);
|
|
||||||
m_layout->addWidget(m_view);
|
m_layout->addWidget(m_view);
|
||||||
}
|
}
|
||||||
m_layout->setCurrentWidget(m_view);
|
m_layout->setCurrentWidget(m_view);
|
||||||
|
|||||||
@@ -197,6 +197,8 @@ public:
|
|||||||
inline bool hasEditors() const { return m_view && m_view->editorCount() != 0; }
|
inline bool hasEditors() const { return m_view && m_view->editorCount() != 0; }
|
||||||
inline EditorView *view() const { return m_view; }
|
inline EditorView *view() const { return m_view; }
|
||||||
inline QSplitter *splitter() const { return m_splitter; }
|
inline QSplitter *splitter() const { return m_splitter; }
|
||||||
|
QSplitter *takeSplitter();
|
||||||
|
EditorView *takeView();
|
||||||
|
|
||||||
|
|
||||||
SplitterOrView *findView(Core::IEditor *editor);
|
SplitterOrView *findView(Core::IEditor *editor);
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public:
|
|||||||
virtual ~IOutputPane() {}
|
virtual ~IOutputPane() {}
|
||||||
|
|
||||||
virtual QWidget *outputWidget(QWidget *parent) = 0;
|
virtual QWidget *outputWidget(QWidget *parent) = 0;
|
||||||
virtual QList<QWidget*> toolBarWidgets(void) const = 0;
|
virtual QList<QWidget*> toolBarWidgets() const = 0;
|
||||||
virtual QString name() const = 0;
|
virtual QString name() const = 0;
|
||||||
|
|
||||||
// -1 don't show in statusBar
|
// -1 don't show in statusBar
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public:
|
|||||||
~MessageOutputWindow();
|
~MessageOutputWindow();
|
||||||
|
|
||||||
QWidget *outputWidget(QWidget *parent);
|
QWidget *outputWidget(QWidget *parent);
|
||||||
QList<QWidget*> toolBarWidgets(void) const { return QList<QWidget *>(); }
|
QList<QWidget*> toolBarWidgets() const { return QList<QWidget *>(); }
|
||||||
|
|
||||||
QString name() const;
|
QString name() const;
|
||||||
int priorityInStatusBar() const;
|
int priorityInStatusBar() const;
|
||||||
|
|||||||
@@ -1073,20 +1073,6 @@ void CPPEditor::unCommentSelection()
|
|||||||
cursor.endEditBlock();
|
cursor.endEditBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
int CPPEditor::endOfNameAtPosition(int pos)
|
|
||||||
{
|
|
||||||
if (pos == -1)
|
|
||||||
pos = position();
|
|
||||||
|
|
||||||
QChar chr = characterAt(pos);
|
|
||||||
|
|
||||||
// Skip to the start of a name
|
|
||||||
while (chr.isLetterOrNumber() || chr == QLatin1Char('_'))
|
|
||||||
chr = characterAt(++pos);
|
|
||||||
|
|
||||||
return pos;
|
|
||||||
}
|
|
||||||
|
|
||||||
CPPEditor::Link CPPEditor::linkToSymbol(CPlusPlus::Symbol *symbol)
|
CPPEditor::Link CPPEditor::linkToSymbol(CPlusPlus::Symbol *symbol)
|
||||||
{
|
{
|
||||||
const QString fileName = QString::fromUtf8(symbol->fileName(),
|
const QString fileName = QString::fromUtf8(symbol->fileName(),
|
||||||
|
|||||||
@@ -127,8 +127,6 @@ private:
|
|||||||
|
|
||||||
void createToolBar(CPPEditorEditable *editable);
|
void createToolBar(CPPEditorEditable *editable);
|
||||||
|
|
||||||
int endOfNameAtPosition(int pos);
|
|
||||||
|
|
||||||
struct Link
|
struct Link
|
||||||
{
|
{
|
||||||
Link(const QString &fileName = QString(),
|
Link(const QString &fileName = QString(),
|
||||||
|
|||||||
@@ -85,15 +85,15 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
{
|
{
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
QModelIndex index = indexAt(ev->pos());
|
QModelIndex index = indexAt(ev->pos());
|
||||||
QAction *act0 = new QAction("Delete breakpoint", &menu);
|
QAction *act0 = new QAction(tr("Delete breakpoint"), &menu);
|
||||||
act0->setEnabled(index.isValid());
|
act0->setEnabled(index.isValid());
|
||||||
QAction *act1 = new QAction("Adjust column widths to contents", &menu);
|
QAction *act1 = new QAction(tr("Adjust column widths to contents"), &menu);
|
||||||
QAction *act2 = new QAction("Always adjust column widths to contents", &menu);
|
QAction *act2 = new QAction(tr("Always adjust column widths to contents"), &menu);
|
||||||
act2->setCheckable(true);
|
act2->setCheckable(true);
|
||||||
act2->setChecked(m_alwaysResizeColumnsToContents);
|
act2->setChecked(m_alwaysResizeColumnsToContents);
|
||||||
QAction *act3 = new QAction("Edit condition...", &menu);
|
QAction *act3 = new QAction(tr("Edit condition..."), &menu);
|
||||||
act0->setEnabled(index.isValid());
|
act0->setEnabled(index.isValid());
|
||||||
QAction *act4 = new QAction("Syncronize breakpoints", &menu);
|
QAction *act4 = new QAction(tr("Syncronize breakpoints"), &menu);
|
||||||
|
|
||||||
menu.addAction(act0);
|
menu.addAction(act0);
|
||||||
menu.addAction(act3);
|
menu.addAction(act3);
|
||||||
|
|||||||
@@ -96,16 +96,7 @@ QString DebuggerSettings::dump()
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DebuggerSettings *DebuggerSettings::instance()
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Debugger specific actions and settings
|
|
||||||
//
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
DebuggerSettings *theDebuggerSettings()
|
|
||||||
{
|
{
|
||||||
static DebuggerSettings *instance = 0;
|
static DebuggerSettings *instance = 0;
|
||||||
if (instance)
|
if (instance)
|
||||||
@@ -117,18 +108,18 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(SettingsDialog, item);
|
instance->insertItem(SettingsDialog, item);
|
||||||
item->setText(QObject::tr("Debugger properties..."));
|
item->setText(tr("Debugger properties..."));
|
||||||
|
|
||||||
//
|
//
|
||||||
// View
|
// View
|
||||||
//
|
//
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(AdjustColumnWidths, item);
|
instance->insertItem(AdjustColumnWidths, item);
|
||||||
item->setText(QObject::tr("Adjust column widths to contents"));
|
item->setText(tr("Adjust column widths to contents"));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(AlwaysAdjustColumnWidths, item);
|
instance->insertItem(AlwaysAdjustColumnWidths, item);
|
||||||
item->setText(QObject::tr("Always adjust column widths to contents"));
|
item->setText(tr("Always adjust column widths to contents"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -136,15 +127,15 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
//
|
//
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(WatchExpression, item);
|
instance->insertItem(WatchExpression, item);
|
||||||
item->setTextPattern(QObject::tr("Watch expression \"%1\""));
|
item->setTextPattern(tr("Watch expression \"%1\""));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(RemoveWatchExpression, item);
|
instance->insertItem(RemoveWatchExpression, item);
|
||||||
item->setTextPattern(QObject::tr("Remove watch expression \"%1\""));
|
item->setTextPattern(tr("Remove watch expression \"%1\""));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(WatchExpressionInWindow, item);
|
instance->insertItem(WatchExpressionInWindow, item);
|
||||||
item->setTextPattern(QObject::tr("Watch expression \"%1\" in separate window"));
|
item->setTextPattern(tr("Watch expression \"%1\" in separate window"));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(AssignValue, item);
|
instance->insertItem(AssignValue, item);
|
||||||
@@ -154,11 +145,11 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(ExpandItem, item);
|
instance->insertItem(ExpandItem, item);
|
||||||
item->setText(QObject::tr("Expand item"));
|
item->setText(tr("Expand item"));
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(CollapseItem, item);
|
instance->insertItem(CollapseItem, item);
|
||||||
item->setText(QObject::tr("Collapse item"));
|
item->setText(tr("Collapse item"));
|
||||||
|
|
||||||
//
|
//
|
||||||
// DebuggingHelper
|
// DebuggingHelper
|
||||||
@@ -167,7 +158,7 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
instance->insertItem(UseDebuggingHelpers, item);
|
instance->insertItem(UseDebuggingHelpers, item);
|
||||||
item->setDefaultValue(true);
|
item->setDefaultValue(true);
|
||||||
item->setSettingsKey("DebugMode", "UseDebuggingHelper");
|
item->setSettingsKey("DebugMode", "UseDebuggingHelper");
|
||||||
item->setText(QObject::tr("Use Debugging Helper"));
|
item->setText(tr("Use Debugging Helper"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
item->setDefaultValue(true);
|
item->setDefaultValue(true);
|
||||||
|
|
||||||
@@ -183,19 +174,19 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
instance->insertItem(DebugDebuggingHelpers, item);
|
instance->insertItem(DebugDebuggingHelpers, item);
|
||||||
item->setSettingsKey("DebugMode", "DebugDebuggingHelpers");
|
item->setSettingsKey("DebugMode", "DebugDebuggingHelpers");
|
||||||
item->setText(QObject::tr("Debug debugging helper"));
|
item->setText(tr("Debug debugging helper"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
|
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Recheck debugging helper availability"));
|
item->setText(tr("Recheck debugging helper availability"));
|
||||||
instance->insertItem(RecheckDebuggingHelpers, item);
|
instance->insertItem(RecheckDebuggingHelpers, item);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Breakpoints
|
// Breakpoints
|
||||||
//
|
//
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Syncronize breakpoints"));
|
item->setText(tr("Syncronize breakpoints"));
|
||||||
instance->insertItem(SynchronizeBreakpoints, item);
|
instance->insertItem(SynchronizeBreakpoints, item);
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -206,7 +197,7 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
registerFormatGroup->setExclusive(true);
|
registerFormatGroup->setExclusive(true);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Hexadecimal"));
|
item->setText(tr("Hexadecimal"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
item->setSettingsKey("DebugMode", "FormatHexadecimal");
|
item->setSettingsKey("DebugMode", "FormatHexadecimal");
|
||||||
item->setChecked(true);
|
item->setChecked(true);
|
||||||
@@ -214,35 +205,35 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
registerFormatGroup->addAction(item);
|
registerFormatGroup->addAction(item);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Decimal"));
|
item->setText(tr("Decimal"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
item->setSettingsKey("DebugMode", "FormatDecimal");
|
item->setSettingsKey("DebugMode", "FormatDecimal");
|
||||||
instance->insertItem(FormatDecimal, item);
|
instance->insertItem(FormatDecimal, item);
|
||||||
registerFormatGroup->addAction(item);
|
registerFormatGroup->addAction(item);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Octal"));
|
item->setText(tr("Octal"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
item->setSettingsKey("DebugMode", "FormatOctal");
|
item->setSettingsKey("DebugMode", "FormatOctal");
|
||||||
instance->insertItem(FormatOctal, item);
|
instance->insertItem(FormatOctal, item);
|
||||||
registerFormatGroup->addAction(item);
|
registerFormatGroup->addAction(item);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Binary"));
|
item->setText(tr("Binary"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
item->setSettingsKey("DebugMode", "FormatBinary");
|
item->setSettingsKey("DebugMode", "FormatBinary");
|
||||||
instance->insertItem(FormatBinary, item);
|
instance->insertItem(FormatBinary, item);
|
||||||
registerFormatGroup->addAction(item);
|
registerFormatGroup->addAction(item);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Raw"));
|
item->setText(tr("Raw"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
item->setSettingsKey("DebugMode", "FormatRaw");
|
item->setSettingsKey("DebugMode", "FormatRaw");
|
||||||
instance->insertItem(FormatRaw, item);
|
instance->insertItem(FormatRaw, item);
|
||||||
registerFormatGroup->addAction(item);
|
registerFormatGroup->addAction(item);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Natural"));
|
item->setText(tr("Natural"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
item->setSettingsKey("DebugMode", "FormatNatural");
|
item->setSettingsKey("DebugMode", "FormatNatural");
|
||||||
instance->insertItem(FormatNatural, item);
|
instance->insertItem(FormatNatural, item);
|
||||||
@@ -266,13 +257,13 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setSettingsKey("DebugMode", "AutoQuit");
|
item->setSettingsKey("DebugMode", "AutoQuit");
|
||||||
item->setText(QObject::tr("Automatically quit debugger"));
|
item->setText(tr("Automatically quit debugger"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
instance->insertItem(AutoQuit, item);
|
instance->insertItem(AutoQuit, item);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setSettingsKey("DebugMode", "UseToolTips");
|
item->setSettingsKey("DebugMode", "UseToolTips");
|
||||||
item->setText(QObject::tr("Use tooltips when debugging"));
|
item->setText(tr("Use tooltips when debugging"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
instance->insertItem(UseToolTips, item);
|
instance->insertItem(UseToolTips, item);
|
||||||
|
|
||||||
@@ -283,13 +274,13 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setSettingsKey("DebugMode", "ListSourceFiles");
|
item->setSettingsKey("DebugMode", "ListSourceFiles");
|
||||||
item->setText(QObject::tr("List source files"));
|
item->setText(tr("List source files"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
instance->insertItem(ListSourceFiles, item);
|
instance->insertItem(ListSourceFiles, item);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setSettingsKey("DebugMode", "SkipKnownFrames");
|
item->setSettingsKey("DebugMode", "SkipKnownFrames");
|
||||||
item->setText(QObject::tr("Skip known frames"));
|
item->setText(tr("Skip known frames"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
instance->insertItem(SkipKnownFrames, item);
|
instance->insertItem(SkipKnownFrames, item);
|
||||||
|
|
||||||
@@ -315,29 +306,35 @@ DebuggerSettings *theDebuggerSettings()
|
|||||||
instance->insertItem(MaximalStackDepth, item);
|
instance->insertItem(MaximalStackDepth, item);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Reload full stack"));
|
item->setText(tr("Reload full stack"));
|
||||||
instance->insertItem(ExpandStack, item);
|
instance->insertItem(ExpandStack, item);
|
||||||
|
|
||||||
item = new SavedAction(instance);
|
item = new SavedAction(instance);
|
||||||
item->setText(QObject::tr("Execute line"));
|
item->setText(tr("Execute line"));
|
||||||
instance->insertItem(ExecuteCommand, item);
|
instance->insertItem(ExecuteCommand, item);
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// DebuggerActions
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
SavedAction *theDebuggerAction(int code)
|
SavedAction *theDebuggerAction(int code)
|
||||||
{
|
{
|
||||||
return theDebuggerSettings()->item(code);
|
return DebuggerSettings::instance()->item(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool theDebuggerBoolSetting(int code)
|
bool theDebuggerBoolSetting(int code)
|
||||||
{
|
{
|
||||||
return theDebuggerSettings()->item(code)->value().toBool();
|
return DebuggerSettings::instance()->item(code)->value().toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString theDebuggerStringSetting(int code)
|
QString theDebuggerStringSetting(int code)
|
||||||
{
|
{
|
||||||
return theDebuggerSettings()->item(code)->value().toString();
|
return DebuggerSettings::instance()->item(code)->value().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ public:
|
|||||||
|
|
||||||
QString dump();
|
QString dump();
|
||||||
|
|
||||||
|
static DebuggerSettings *instance();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void readSettings(QSettings *settings);
|
void readSettings(QSettings *settings);
|
||||||
void writeSettings(QSettings *settings);
|
void writeSettings(QSettings *settings);
|
||||||
@@ -121,7 +123,6 @@ enum DebuggerActionCode
|
|||||||
};
|
};
|
||||||
|
|
||||||
// singleton access
|
// singleton access
|
||||||
DebuggerSettings *theDebuggerSettings();
|
|
||||||
Core::Utils::SavedAction *theDebuggerAction(int code);
|
Core::Utils::SavedAction *theDebuggerAction(int code);
|
||||||
|
|
||||||
// convienience
|
// convienience
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public:
|
|||||||
DebuggerOutputWindow(QWidget *parent = 0);
|
DebuggerOutputWindow(QWidget *parent = 0);
|
||||||
|
|
||||||
QWidget *outputWidget(QWidget *) { return this; }
|
QWidget *outputWidget(QWidget *) { return this; }
|
||||||
QList<QWidget*> toolBarWidgets(void) const { return QList<QWidget *>(); }
|
QList<QWidget*> toolBarWidgets() const { return QList<QWidget *>(); }
|
||||||
|
|
||||||
QString name() const { return windowTitle(); }
|
QString name() const { return windowTitle(); }
|
||||||
void visibilityChanged(bool /*visible*/) {}
|
void visibilityChanged(bool /*visible*/) {}
|
||||||
|
|||||||
@@ -498,8 +498,9 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
|
|||||||
|
|
||||||
m_gdbRunningContext = uidm->uniqueIdentifier(Constants::GDBRUNNING);
|
m_gdbRunningContext = uidm->uniqueIdentifier(Constants::GDBRUNNING);
|
||||||
|
|
||||||
|
// FIXME: make this a global action
|
||||||
m_breakpointMarginAction = new QAction(this);
|
m_breakpointMarginAction = new QAction(this);
|
||||||
m_breakpointMarginAction->setText("Toggle Breakpoint");
|
m_breakpointMarginAction->setText(tr("Toggle Breakpoint"));
|
||||||
//m_breakpointMarginAction->setIcon(QIcon(":/gdbdebugger/images/breakpoint.svg"));
|
//m_breakpointMarginAction->setIcon(QIcon(":/gdbdebugger/images/breakpoint.svg"));
|
||||||
connect(m_breakpointMarginAction, SIGNAL(triggered()),
|
connect(m_breakpointMarginAction, SIGNAL(triggered()),
|
||||||
this, SLOT(breakpointMarginActionTriggered()));
|
this, SLOT(breakpointMarginActionTriggered()));
|
||||||
@@ -976,7 +977,7 @@ void DebuggerPlugin::writeSettings() const
|
|||||||
QTC_ASSERT(m_manager->mainWindow(), return);
|
QTC_ASSERT(m_manager->mainWindow(), return);
|
||||||
|
|
||||||
QSettings *s = settings();
|
QSettings *s = settings();
|
||||||
theDebuggerSettings()->writeSettings(s);
|
DebuggerSettings::instance()->writeSettings(s);
|
||||||
s->beginGroup(QLatin1String("DebugMode"));
|
s->beginGroup(QLatin1String("DebugMode"));
|
||||||
s->setValue("State", m_manager->mainWindow()->saveState());
|
s->setValue("State", m_manager->mainWindow()->saveState());
|
||||||
s->setValue("Locked", m_toggleLockedAction->isChecked());
|
s->setValue("Locked", m_toggleLockedAction->isChecked());
|
||||||
@@ -986,7 +987,7 @@ void DebuggerPlugin::writeSettings() const
|
|||||||
void DebuggerPlugin::readSettings()
|
void DebuggerPlugin::readSettings()
|
||||||
{
|
{
|
||||||
QSettings *s = settings();
|
QSettings *s = settings();
|
||||||
theDebuggerSettings()->readSettings(s);
|
DebuggerSettings::instance()->readSettings(s);
|
||||||
|
|
||||||
QString defaultCommand("gdb");
|
QString defaultCommand("gdb");
|
||||||
#if defined(Q_OS_WIN32)
|
#if defined(Q_OS_WIN32)
|
||||||
|
|||||||
@@ -121,13 +121,11 @@ QVariant DisassemblerModel::headerData(int section, Qt::Orientation orientation,
|
|||||||
int role) const
|
int role) const
|
||||||
{
|
{
|
||||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
||||||
static const char * const headers[] = {
|
switch (section) {
|
||||||
QT_TR_NOOP("Address"),
|
case 1: return DisassemblerHandler::tr("Address");
|
||||||
QT_TR_NOOP("Symbol"),
|
case 2: return DisassemblerHandler::tr("Symbol");
|
||||||
QT_TR_NOOP("Mnemonic"),
|
case 3: return DisassemblerHandler::tr("Mnemonic");
|
||||||
};
|
};
|
||||||
if (section < 3)
|
|
||||||
return tr(headers[section]);
|
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "disassemblerwindow.h"
|
#include "disassemblerwindow.h"
|
||||||
|
#include "debuggeractions.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
@@ -68,24 +69,23 @@ void DisassemblerWindow::resizeEvent(QResizeEvent *ev)
|
|||||||
void DisassemblerWindow::contextMenuEvent(QContextMenuEvent *ev)
|
void DisassemblerWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||||
{
|
{
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
//QTreeWidgetItem *item = itemAt(ev->pos());
|
|
||||||
QAction *act1 = new QAction("Adjust column widths to contents", &menu);
|
QAction *act1 = new QAction(tr("Adjust column widths to contents"), &menu);
|
||||||
QAction *act2 = new QAction("Always adjust column widths to contents", &menu);
|
QAction *act2 = new QAction(tr("Always adjust column widths to contents"), &menu);
|
||||||
act2->setCheckable(true);
|
act2->setCheckable(true);
|
||||||
|
// FIXME: make this a SavedAction
|
||||||
act2->setChecked(m_alwaysResizeColumnsToContents);
|
act2->setChecked(m_alwaysResizeColumnsToContents);
|
||||||
QAction *act3 = new QAction("Reload disassembler listing", &menu);
|
QAction *act3 = new QAction(tr("Reload disassembler listing"), &menu);
|
||||||
QAction *act4 = new QAction("Always reload disassembler listing", &menu);
|
QAction *act4 = new QAction(tr("Always reload disassembler listing"), &menu);
|
||||||
act4->setCheckable(true);
|
act4->setCheckable(true);
|
||||||
act4->setChecked(m_alwaysReloadContents);
|
act4->setChecked(m_alwaysReloadContents);
|
||||||
//if (item) {
|
|
||||||
// menu.addAction(act0);
|
|
||||||
// menu.addSeparator();
|
|
||||||
//}
|
|
||||||
menu.addAction(act3);
|
menu.addAction(act3);
|
||||||
//menu.addAction(act4);
|
//menu.addAction(act4);
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
menu.addAction(act1);
|
menu.addAction(act1);
|
||||||
menu.addAction(act2);
|
menu.addAction(act2);
|
||||||
|
menu.addSeparator();
|
||||||
|
menu.addAction(theDebuggerAction(SettingsDialog));
|
||||||
|
|
||||||
QAction *act = menu.exec(ev->globalPos());
|
QAction *act = menu.exec(ev->globalPos());
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
#include "debuggerdialogs.h"
|
#include "debuggerdialogs.h"
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
@@ -60,6 +61,8 @@
|
|||||||
#include <QtGui/QMainWindow>
|
#include <QtGui/QMainWindow>
|
||||||
#include <QtGui/QMessageBox>
|
#include <QtGui/QMessageBox>
|
||||||
#include <QtGui/QToolTip>
|
#include <QtGui/QToolTip>
|
||||||
|
#include <QtGui/QDialogButtonBox>
|
||||||
|
#include <QtGui/QPushButton>
|
||||||
|
|
||||||
#if defined(Q_OS_LINUX) || defined(Q_OS_MAC)
|
#if defined(Q_OS_LINUX) || defined(Q_OS_MAC)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -233,6 +236,8 @@ void GdbEngine::initializeConnections()
|
|||||||
|
|
||||||
connect(theDebuggerAction(ExpandStack), SIGNAL(triggered()),
|
connect(theDebuggerAction(ExpandStack), SIGNAL(triggered()),
|
||||||
this, SLOT(reloadFullStack()));
|
this, SLOT(reloadFullStack()));
|
||||||
|
connect(theDebuggerAction(MaximalStackDepth), SIGNAL(triggered()),
|
||||||
|
this, SLOT(reloadFullStack()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GdbEngine::initializeVariables()
|
void GdbEngine::initializeVariables()
|
||||||
@@ -1534,7 +1539,7 @@ int GdbEngine::currentFrame() const
|
|||||||
|
|
||||||
bool GdbEngine::startDebugger()
|
bool GdbEngine::startDebugger()
|
||||||
{
|
{
|
||||||
debugMessage(theDebuggerSettings()->dump());
|
debugMessage(DebuggerSettings::instance()->dump());
|
||||||
QStringList gdbArgs;
|
QStringList gdbArgs;
|
||||||
|
|
||||||
if (m_gdbProc.state() != QProcess::NotRunning) {
|
if (m_gdbProc.state() != QProcess::NotRunning) {
|
||||||
@@ -2727,7 +2732,7 @@ void GdbEngine::setToolTipExpression(const QPoint &pos, const QString &exp0)
|
|||||||
|
|
||||||
if (!hasLetterOrNumber(exp)) {
|
if (!hasLetterOrNumber(exp)) {
|
||||||
QToolTip::showText(m_toolTipPos,
|
QToolTip::showText(m_toolTipPos,
|
||||||
"'" + exp + "' contains no identifier");
|
tr("'%1' contains no identifier").arg(exp));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2750,8 +2755,8 @@ void GdbEngine::setToolTipExpression(const QPoint &pos, const QString &exp0)
|
|||||||
|
|
||||||
if (hasSideEffects(exp)) {
|
if (hasSideEffects(exp)) {
|
||||||
QToolTip::showText(m_toolTipPos,
|
QToolTip::showText(m_toolTipPos,
|
||||||
"Cowardly refusing to evaluate expression '" + exp
|
tr("Cowardly refusing to evaluate expression '%1' "
|
||||||
+ "' with potential side effects");
|
"with potential side effects").arg(exp));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2763,7 +2768,7 @@ void GdbEngine::setToolTipExpression(const QPoint &pos, const QString &exp0)
|
|||||||
qDebug() << "THIS IN ROW " << i;
|
qDebug() << "THIS IN ROW " << i;
|
||||||
if (m_currentLocals.childAt(i).type.startsWith(exp)) {
|
if (m_currentLocals.childAt(i).type.startsWith(exp)) {
|
||||||
QToolTip::showText(m_toolTipPos,
|
QToolTip::showText(m_toolTipPos,
|
||||||
exp + ": type of current 'this'");
|
tr("%1: type of current 'this'").arg(exp));
|
||||||
qDebug() << " TOOLTIP CRASH SUPPRESSED";
|
qDebug() << " TOOLTIP CRASH SUPPRESSED";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -3001,12 +3006,10 @@ void GdbEngine::runDebuggingHelper(const WatchData &data0, bool dumpChildren)
|
|||||||
} else if (outertype == m_namespace + "QObjectSlot"
|
} else if (outertype == m_namespace + "QObjectSlot"
|
||||||
|| outertype == m_namespace + "QObjectSignal") {
|
|| outertype == m_namespace + "QObjectSignal") {
|
||||||
// we need the number out of something like
|
// we need the number out of something like
|
||||||
// iname="local.ob.slots.[2]deleteLater()"
|
// iname="local.ob.slots.2" // ".deleteLater()"?
|
||||||
int lastOpened = data.iname.lastIndexOf('[');
|
int pos = data.iname.lastIndexOf('.');
|
||||||
int lastClosed = data.iname.lastIndexOf(']');
|
QString slotNumber = data.iname.mid(pos + 1);
|
||||||
QString slotNumber = "-1";
|
QTC_ASSERT(slotNumber.toInt() != -1, /**/);
|
||||||
if (lastOpened != -1 && lastClosed != -1)
|
|
||||||
slotNumber = data.iname.mid(lastOpened + 1, lastClosed - lastOpened - 1);
|
|
||||||
extraArgs[0] = slotNumber;
|
extraArgs[0] = slotNumber;
|
||||||
} else if (outertype == m_namespace + "QMap" || outertype == m_namespace + "QMultiMap") {
|
} else if (outertype == m_namespace + "QMap" || outertype == m_namespace + "QMultiMap") {
|
||||||
QString nodetype;
|
QString nodetype;
|
||||||
@@ -3329,7 +3332,7 @@ void GdbEngine::updateWatchModel2()
|
|||||||
"(" + data->type + ") " + data->exp + " = " + data->value);
|
"(" + data->type + ") " + data->exp + " = " + data->value);
|
||||||
} else {
|
} else {
|
||||||
QToolTip::showText(m_toolTipPos,
|
QToolTip::showText(m_toolTipPos,
|
||||||
"Cannot evaluate expression: " + m_toolTipExpression);
|
tr("Cannot evaluate expression: %1").arg(m_toolTipExpression));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3952,9 +3955,23 @@ void GdbEngine::handleVarListChildren(const GdbResultRecord &record,
|
|||||||
foreach (const GdbMi &child, children.children())
|
foreach (const GdbMi &child, children.children())
|
||||||
handleVarListChildrenHelper(child, data);
|
handleVarListChildrenHelper(child, data);
|
||||||
|
|
||||||
if (!isAccessSpecifier(data.variable.split('.').takeLast())) {
|
if (children.children().isEmpty()) {
|
||||||
|
// happens e.g. if no debug information is present or
|
||||||
|
// if the class really has no children
|
||||||
|
WatchData data1;
|
||||||
|
data1.iname = data.iname + ".child";
|
||||||
|
data1.value = tr("<no information>");
|
||||||
|
data1.childCount = 0;
|
||||||
|
data1.setAllUnneeded();
|
||||||
|
insertData(data1);
|
||||||
|
data.setAllUnneeded();
|
||||||
|
insertData(data);
|
||||||
|
} else if (!isAccessSpecifier(data.variable.split('.').takeLast())) {
|
||||||
data.setChildrenUnneeded();
|
data.setChildrenUnneeded();
|
||||||
insertData(data);
|
insertData(data);
|
||||||
|
} else {
|
||||||
|
// this skips the spurious "public", "private" etc levels
|
||||||
|
// gdb produces
|
||||||
}
|
}
|
||||||
} else if (record.resultClass == GdbResultError) {
|
} else if (record.resultClass == GdbResultError) {
|
||||||
data.setError(record.data.findChild("msg").data());
|
data.setError(record.data.findChild("msg").data());
|
||||||
@@ -4040,6 +4057,29 @@ QString GdbEngine::dumperLibraryName() const
|
|||||||
return q->m_dumperLib;
|
return q->m_dumperLib;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GdbEngine::showDebuggingHelperWarning()
|
||||||
|
{
|
||||||
|
QMessageBox dialog(q->mainWindow());
|
||||||
|
QPushButton *qtPref = dialog.addButton(tr("Open Qt preferences"), QMessageBox::ActionRole);
|
||||||
|
QPushButton *helperOff = dialog.addButton(tr("Turn helper usage off"), QMessageBox::ActionRole);
|
||||||
|
QPushButton *justContinue = dialog.addButton(tr("Continue anyway"), QMessageBox::AcceptRole);
|
||||||
|
dialog.setDefaultButton(justContinue);
|
||||||
|
dialog.setWindowTitle(tr("Debugging helper missing"));
|
||||||
|
dialog.setText(tr("The debugger did not find the debugging helper library."));
|
||||||
|
dialog.setInformativeText(tr("The debugging helper is used to nicely format the values of Qt "
|
||||||
|
"data types and some STL data types. "
|
||||||
|
"It must be compiled for each Qt version, "
|
||||||
|
"you can do this in the Qt preferences page by selecting "
|
||||||
|
"a Qt installation and clicking on 'Rebuild' for the debugging "
|
||||||
|
"helper."));
|
||||||
|
dialog.exec();
|
||||||
|
if (dialog.clickedButton() == qtPref) {
|
||||||
|
Core::ICore::instance()->showOptionsDialog("Qt4", "Qt Versions");
|
||||||
|
} else if (dialog.clickedButton() == helperOff) {
|
||||||
|
theDebuggerAction(UseDebuggingHelpers)->setValue(qVariantFromValue(false), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GdbEngine::tryLoadDebuggingHelpers()
|
void GdbEngine::tryLoadDebuggingHelpers()
|
||||||
{
|
{
|
||||||
if (m_debuggingHelperState != DebuggingHelperUninitialized)
|
if (m_debuggingHelperState != DebuggingHelperUninitialized)
|
||||||
@@ -4055,6 +4095,8 @@ void GdbEngine::tryLoadDebuggingHelpers()
|
|||||||
" %1 EXISTS: %2, EXECUTABLE: %3").arg(lib)
|
" %1 EXISTS: %2, EXECUTABLE: %3").arg(lib)
|
||||||
.arg(QFileInfo(lib).exists())
|
.arg(QFileInfo(lib).exists())
|
||||||
.arg(QFileInfo(lib).isExecutable()));
|
.arg(QFileInfo(lib).isExecutable()));
|
||||||
|
if (theDebuggerBoolSetting(UseDebuggingHelpers))
|
||||||
|
showDebuggingHelperWarning();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ private:
|
|||||||
//
|
//
|
||||||
// Own stuff
|
// Own stuff
|
||||||
//
|
//
|
||||||
|
void showDebuggingHelperWarning();
|
||||||
int currentFrame() const;
|
int currentFrame() const;
|
||||||
QString currentWorkingDirectory() const { return m_pwd; }
|
QString currentWorkingDirectory() const { return m_pwd; }
|
||||||
|
|
||||||
|
|||||||
@@ -75,10 +75,8 @@ QVariant RegisterHandler::data(const QModelIndex &index, int role) const
|
|||||||
|
|
||||||
if (role == Qt::DisplayRole) {
|
if (role == Qt::DisplayRole) {
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
case 0:
|
case 0: return reg.name;
|
||||||
return reg.name;
|
case 1: return reg.value;
|
||||||
case 1:
|
|
||||||
return reg.value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (role == Qt::TextColorRole && reg.changed && index.column() == 1)
|
if (role == Qt::TextColorRole && reg.changed && index.column() == 1)
|
||||||
@@ -90,12 +88,10 @@ QVariant RegisterHandler::headerData(int section, Qt::Orientation orientation,
|
|||||||
int role) const
|
int role) const
|
||||||
{
|
{
|
||||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
||||||
static const char * const headers[] = {
|
switch (section) {
|
||||||
QT_TR_NOOP("Name"),
|
case 0: return tr("Name");
|
||||||
QT_TR_NOOP("Value"),
|
case 1: return tr("Value");
|
||||||
};
|
};
|
||||||
if (section < 2)
|
|
||||||
return tr(headers[section]);
|
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,15 +81,15 @@ void RegisterWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
//QString format = model()->property(PROPERTY_REGISTER_FORMAT).toString();
|
//QString format = model()->property(PROPERTY_REGISTER_FORMAT).toString();
|
||||||
//qDebug() << "FORMAT: " << format;
|
//qDebug() << "FORMAT: " << format;
|
||||||
|
|
||||||
actions[Adjust] = menu.addAction("Adjust column widths to contents");
|
actions[Adjust] = menu.addAction(tr("Adjust column widths to contents"));
|
||||||
|
|
||||||
actions[AlwaysAdjust] = menu.addAction("Always adjust column widths to contents");
|
actions[AlwaysAdjust] = menu.addAction(tr("Always adjust column widths to contents"));
|
||||||
actions[AlwaysAdjust]->setCheckable(true);
|
actions[AlwaysAdjust]->setCheckable(true);
|
||||||
actions[AlwaysAdjust]->setChecked(m_alwaysResizeColumnsToContents);
|
actions[AlwaysAdjust]->setChecked(m_alwaysResizeColumnsToContents);
|
||||||
|
|
||||||
actions[Reload] = menu.addAction("Reload register listing");
|
actions[Reload] = menu.addAction(tr("Reload register listing"));
|
||||||
|
|
||||||
actions[AlwaysReload] = menu.addAction("Always reload register listing");
|
actions[AlwaysReload] = menu.addAction(tr("Always reload register listing"));
|
||||||
actions[AlwaysReload]->setCheckable(true);
|
actions[AlwaysReload]->setCheckable(true);
|
||||||
actions[AlwaysReload]->setChecked(m_alwaysReloadContents);
|
actions[AlwaysReload]->setChecked(m_alwaysReloadContents);
|
||||||
|
|
||||||
|
|||||||
@@ -489,8 +489,8 @@ void ScriptEngine::setToolTipExpression(const QPoint &pos, const QString &exp0)
|
|||||||
|
|
||||||
if (hasSideEffects(exp)) {
|
if (hasSideEffects(exp)) {
|
||||||
QToolTip::showText(m_toolTipPos,
|
QToolTip::showText(m_toolTipPos,
|
||||||
"Cowardly refusing to evaluate expression '" + exp
|
tr("Cowardly refusing to evaluate expression '%1' "
|
||||||
+ "' with potential side effects");
|
"with potential side effects").arg(exp));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,10 +53,11 @@ bool StackFrame::isUsable() const
|
|||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
StackHandler::StackHandler(QObject *parent)
|
StackHandler::StackHandler(QObject *parent)
|
||||||
: QAbstractTableModel(parent), m_currentIndex(0)
|
: QAbstractTableModel(parent),
|
||||||
|
m_positionIcon(QIcon(":/gdbdebugger/images/location.svg")),
|
||||||
|
m_emptyIcon(QIcon(":/gdbdebugger/images/empty.svg"))
|
||||||
{
|
{
|
||||||
m_emptyIcon = QIcon(":/gdbdebugger/images/empty.svg");
|
m_currentIndex = 0;
|
||||||
m_positionIcon = QIcon(":/gdbdebugger/images/location.svg");
|
|
||||||
m_canExpand = false;
|
m_canExpand = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +79,11 @@ QVariant StackHandler::data(const QModelIndex &index, int role) const
|
|||||||
|
|
||||||
if (index.row() == m_stackFrames.size()) {
|
if (index.row() == m_stackFrames.size()) {
|
||||||
if (role == Qt::DisplayRole && index.column() == 0)
|
if (role == Qt::DisplayRole && index.column() == 0)
|
||||||
return "<...>";
|
return tr("...");
|
||||||
|
if (role == Qt::DisplayRole && index.column() == 1)
|
||||||
|
return tr("<More>");
|
||||||
|
if (role == Qt::DecorationRole && index.column() == 0)
|
||||||
|
return m_emptyIcon;
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,15 +120,13 @@ QVariant StackHandler::data(const QModelIndex &index, int role) const
|
|||||||
QVariant StackHandler::headerData(int section, Qt::Orientation orientation, int role) const
|
QVariant StackHandler::headerData(int section, Qt::Orientation orientation, int role) const
|
||||||
{
|
{
|
||||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
||||||
static const char * const headers[] = {
|
switch (section) {
|
||||||
QT_TR_NOOP("Level"),
|
case 0: return tr("Level");
|
||||||
QT_TR_NOOP("Function"),
|
case 1: return tr("Function");
|
||||||
QT_TR_NOOP("File"),
|
case 2: return tr("File");
|
||||||
QT_TR_NOOP("Line"),
|
case 3: return tr("Line");
|
||||||
QT_TR_NOOP("Address")
|
case 4: return tr("Address");
|
||||||
};
|
};
|
||||||
if (section < 5)
|
|
||||||
return tr(headers[section]);
|
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
@@ -229,7 +232,7 @@ QVariant ThreadsHandler::data(const QModelIndex &index, int role) const
|
|||||||
return "???";
|
return "???";
|
||||||
}
|
}
|
||||||
} else if (role == Qt::ToolTipRole) {
|
} else if (role == Qt::ToolTipRole) {
|
||||||
return "Thread: " + QString::number(m_threads.at(index.row()).id);
|
return tr("Thread: %1").arg(m_threads.at(index.row()).id);
|
||||||
} else if (role == Qt::DecorationRole && index.column() == 0) {
|
} else if (role == Qt::DecorationRole && index.column() == 0) {
|
||||||
// Return icon that indicates whether this is the active stack frame
|
// Return icon that indicates whether this is the active stack frame
|
||||||
return (index.row() == m_currentIndex) ? m_positionIcon : m_emptyIcon;
|
return (index.row() == m_currentIndex) ? m_positionIcon : m_emptyIcon;
|
||||||
@@ -241,11 +244,8 @@ QVariant ThreadsHandler::data(const QModelIndex &index, int role) const
|
|||||||
QVariant ThreadsHandler::headerData(int section, Qt::Orientation orientation, int role) const
|
QVariant ThreadsHandler::headerData(int section, Qt::Orientation orientation, int role) const
|
||||||
{
|
{
|
||||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
||||||
static const char * const headers[] = {
|
|
||||||
QT_TR_NOOP("Thread ID"),
|
|
||||||
};
|
|
||||||
if (section < 1)
|
if (section < 1)
|
||||||
return tr(headers[section]);
|
return tr("Thread ID");
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,8 +86,8 @@ private:
|
|||||||
|
|
||||||
QList<StackFrame> m_stackFrames;
|
QList<StackFrame> m_stackFrames;
|
||||||
int m_currentIndex;
|
int m_currentIndex;
|
||||||
QIcon m_positionIcon;
|
const QVariant m_positionIcon;
|
||||||
QIcon m_emptyIcon;
|
const QVariant m_emptyIcon;
|
||||||
bool m_canExpand;
|
bool m_canExpand;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ static QList<WatchData> initialSet()
|
|||||||
root.state = 0;
|
root.state = 0;
|
||||||
root.level = 0;
|
root.level = 0;
|
||||||
root.row = 0;
|
root.row = 0;
|
||||||
root.name = QLatin1String("Root");
|
root.name = WatchHandler::tr("Root");
|
||||||
root.parentIndex = -1;
|
root.parentIndex = -1;
|
||||||
root.childIndex.append(1);
|
root.childIndex.append(1);
|
||||||
root.childIndex.append(2);
|
root.childIndex.append(2);
|
||||||
@@ -302,7 +302,7 @@ static QList<WatchData> initialSet()
|
|||||||
|
|
||||||
WatchData local;
|
WatchData local;
|
||||||
local.iname = QLatin1String("local");
|
local.iname = QLatin1String("local");
|
||||||
local.name = QLatin1String("Locals");
|
local.name = WatchHandler::tr("Locals");
|
||||||
local.state = 0;
|
local.state = 0;
|
||||||
local.level = 1;
|
local.level = 1;
|
||||||
local.row = 0;
|
local.row = 0;
|
||||||
@@ -311,7 +311,7 @@ static QList<WatchData> initialSet()
|
|||||||
|
|
||||||
WatchData tooltip;
|
WatchData tooltip;
|
||||||
tooltip.iname = QLatin1String("tooltip");
|
tooltip.iname = QLatin1String("tooltip");
|
||||||
tooltip.name = QLatin1String("Tooltip");
|
tooltip.name = WatchHandler::tr("Tooltip");
|
||||||
tooltip.state = 0;
|
tooltip.state = 0;
|
||||||
tooltip.level = 1;
|
tooltip.level = 1;
|
||||||
tooltip.row = 1;
|
tooltip.row = 1;
|
||||||
@@ -320,7 +320,7 @@ static QList<WatchData> initialSet()
|
|||||||
|
|
||||||
WatchData watch;
|
WatchData watch;
|
||||||
watch.iname = QLatin1String("watch");
|
watch.iname = QLatin1String("watch");
|
||||||
watch.name = QLatin1String("Watchers");
|
watch.name = WatchHandler::tr("Watchers");
|
||||||
watch.state = 0;
|
watch.state = 0;
|
||||||
watch.level = 1;
|
watch.level = 1;
|
||||||
watch.row = 2;
|
watch.row = 2;
|
||||||
@@ -711,13 +711,13 @@ void WatchHandler::rebuildModel()
|
|||||||
dummy.row = 0;
|
dummy.row = 0;
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
dummy.iname = QLatin1String("local.dummy");
|
dummy.iname = QLatin1String("local.dummy");
|
||||||
dummy.name = QLatin1String("<No Locals>");
|
dummy.name = tr("<No Locals>");
|
||||||
} else if (i == 2) {
|
} else if (i == 2) {
|
||||||
dummy.iname = QLatin1String("tooltip.dummy");
|
dummy.iname = QLatin1String("tooltip.dummy");
|
||||||
dummy.name = QLatin1String("<No Tooltip>");
|
dummy.name = tr("<No Tooltip>");
|
||||||
} else {
|
} else {
|
||||||
dummy.iname = QLatin1String("watch.dummy");
|
dummy.iname = QLatin1String("watch.dummy");
|
||||||
dummy.name = QLatin1String("<No Watchers>");
|
dummy.name = tr("<No Watchers>");
|
||||||
}
|
}
|
||||||
dummy.level = 2;
|
dummy.level = 2;
|
||||||
dummy.parentIndex = i;
|
dummy.parentIndex = i;
|
||||||
|
|||||||
@@ -164,8 +164,8 @@ void WatchWindow::keyPressEvent(QKeyEvent *ev)
|
|||||||
void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
||||||
{
|
{
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
QAction *act1 = new QAction("Adjust column widths to contents", &menu);
|
QAction *act1 = new QAction(tr("Adjust column widths to contents"), &menu);
|
||||||
QAction *act2 = new QAction("Always adjust column widths to contents", &menu);
|
QAction *act2 = new QAction(tr("Always adjust column widths to contents"), &menu);
|
||||||
act2->setCheckable(true);
|
act2->setCheckable(true);
|
||||||
act2->setChecked(m_alwaysResizeColumnsToContents);
|
act2->setChecked(m_alwaysResizeColumnsToContents);
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
else if (act == act2)
|
else if (act == act2)
|
||||||
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
|
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
|
||||||
else if (act == act3)
|
else if (act == act3)
|
||||||
theDebuggerAction(WatchExpression)->trigger("<Edit>");
|
theDebuggerAction(WatchExpression)->trigger(tr("<Edit>"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WatchWindow::resizeColumnsToContents()
|
void WatchWindow::resizeColumnsToContents()
|
||||||
|
|||||||
@@ -278,9 +278,9 @@ public:
|
|||||||
typedef QTextCursor::MoveMode MoveMode;
|
typedef QTextCursor::MoveMode MoveMode;
|
||||||
void moveToEndOfDocument() { m_tc.movePosition(EndOfDocument, MoveAnchor); }
|
void moveToEndOfDocument() { m_tc.movePosition(EndOfDocument, MoveAnchor); }
|
||||||
void moveToStartOfLine() { m_tc.movePosition(StartOfLine, MoveAnchor); }
|
void moveToStartOfLine() { m_tc.movePosition(StartOfLine, MoveAnchor); }
|
||||||
void moveToEndOfLine() { m_tc.movePosition(EndOfLine, MoveAnchor); }
|
void moveToEndOfLine();
|
||||||
void moveUp(int n = 1) { m_tc.movePosition(Up, MoveAnchor, n); }
|
void moveUp(int n = 1) { moveDown(-n); }
|
||||||
void moveDown(int n = 1) { m_tc.movePosition(Down, MoveAnchor, n); }
|
void moveDown(int n = 1); // { m_tc.movePosition(Down, MoveAnchor, n); }
|
||||||
void moveRight(int n = 1) { m_tc.movePosition(Right, MoveAnchor, n); }
|
void moveRight(int n = 1) { m_tc.movePosition(Right, MoveAnchor, n); }
|
||||||
void moveLeft(int n = 1) { m_tc.movePosition(Left, MoveAnchor, n); }
|
void moveLeft(int n = 1) { m_tc.movePosition(Left, MoveAnchor, n); }
|
||||||
void setAnchor() { m_anchor = m_tc.position(); }
|
void setAnchor() { m_anchor = m_tc.position(); }
|
||||||
@@ -289,7 +289,7 @@ public:
|
|||||||
|
|
||||||
void handleFfTt(int key);
|
void handleFfTt(int key);
|
||||||
|
|
||||||
// helper function for handleCommand. return 1 based line index.
|
// helper function for handleExCommand. return 1 based line index.
|
||||||
int readLineCode(QString &cmd);
|
int readLineCode(QString &cmd);
|
||||||
void selectRange(int beginLine, int endLine);
|
void selectRange(int beginLine, int endLine);
|
||||||
|
|
||||||
@@ -351,7 +351,7 @@ public:
|
|||||||
bool m_needMoreUndo;
|
bool m_needMoreUndo;
|
||||||
|
|
||||||
// extra data for '.'
|
// extra data for '.'
|
||||||
void replay(const QString &text);
|
void replay(const QString &text, int count);
|
||||||
QString m_dotCommand;
|
QString m_dotCommand;
|
||||||
bool m_inReplay; // true if we are executing a '.'
|
bool m_inReplay; // true if we are executing a '.'
|
||||||
|
|
||||||
@@ -411,10 +411,13 @@ QStringList FakeVimHandler::Private::m_commandHistory;
|
|||||||
FakeVimHandler::Private::Private(FakeVimHandler *parent, QWidget *widget)
|
FakeVimHandler::Private::Private(FakeVimHandler *parent, QWidget *widget)
|
||||||
{
|
{
|
||||||
q = parent;
|
q = parent;
|
||||||
|
|
||||||
m_textedit = qobject_cast<QTextEdit *>(widget);
|
m_textedit = qobject_cast<QTextEdit *>(widget);
|
||||||
m_plaintextedit = qobject_cast<QPlainTextEdit *>(widget);
|
m_plaintextedit = qobject_cast<QPlainTextEdit *>(widget);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void FakeVimHandler::Private::init()
|
||||||
|
{
|
||||||
m_mode = CommandMode;
|
m_mode = CommandMode;
|
||||||
m_submode = NoSubMode;
|
m_submode = NoSubMode;
|
||||||
m_subsubmode = NoSubSubMode;
|
m_subsubmode = NoSubSubMode;
|
||||||
@@ -592,7 +595,6 @@ EventResult FakeVimHandler::Private::handleKey(int key, int unmodified,
|
|||||||
const QString &text)
|
const QString &text)
|
||||||
{
|
{
|
||||||
//qDebug() << "KEY: " << key << text << "POS: " << m_tc.position();
|
//qDebug() << "KEY: " << key << text << "POS: " << m_tc.position();
|
||||||
//qDebug() << "\nUNDO: " << m_undoStack << "\nREDO: " << m_redoStack;
|
|
||||||
if (m_mode == InsertMode)
|
if (m_mode == InsertMode)
|
||||||
return handleInsertMode(key, unmodified, text);
|
return handleInsertMode(key, unmodified, text);
|
||||||
if (m_mode == CommandMode)
|
if (m_mode == CommandMode)
|
||||||
@@ -603,6 +605,26 @@ EventResult FakeVimHandler::Private::handleKey(int key, int unmodified,
|
|||||||
return EventUnhandled;
|
return EventUnhandled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FakeVimHandler::Private::moveDown(int n)
|
||||||
|
{
|
||||||
|
// m_tc.movePosition(Down, MoveAnchor, n); does not work for "hidden"
|
||||||
|
// documents like in the autotests
|
||||||
|
const QTextBlock &block = m_tc.block();
|
||||||
|
const int col = m_tc.position() - block.position();
|
||||||
|
const int line = block.blockNumber();
|
||||||
|
const int pos = m_tc.document()->findBlockByNumber(line + n).position();
|
||||||
|
setPosition(pos + qMin(block.length(), col));
|
||||||
|
setPosition(pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FakeVimHandler::Private::moveToEndOfLine()
|
||||||
|
{
|
||||||
|
// m_tc.movePosition(EndOfLine, MoveAnchor) does not work for "hidden"
|
||||||
|
// documents like in the autotests
|
||||||
|
const QTextBlock &block = m_tc.block();
|
||||||
|
setPosition(block.position() + block.length() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
|
void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
|
||||||
{
|
{
|
||||||
//qDebug() << "ANCHOR: " << position() << anchor();
|
//qDebug() << "ANCHOR: " << position() << anchor();
|
||||||
@@ -1012,7 +1034,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
|
|||||||
qDebug() << "REPEATING" << m_dotCommand;
|
qDebug() << "REPEATING" << m_dotCommand;
|
||||||
QString savedCommand = m_dotCommand;
|
QString savedCommand = m_dotCommand;
|
||||||
m_dotCommand.clear();
|
m_dotCommand.clear();
|
||||||
replay(savedCommand);
|
replay(savedCommand, count());
|
||||||
enterCommandMode();
|
enterCommandMode();
|
||||||
m_dotCommand = savedCommand;
|
m_dotCommand = savedCommand;
|
||||||
} else if (key == '<' && m_visualMode == NoVisualMode) {
|
} else if (key == '<' && m_visualMode == NoVisualMode) {
|
||||||
@@ -1647,6 +1669,7 @@ void FakeVimHandler::Private::selectRange(int beginLine, int endLine)
|
|||||||
void FakeVimHandler::Private::handleCommand(const QString &cmd)
|
void FakeVimHandler::Private::handleCommand(const QString &cmd)
|
||||||
{
|
{
|
||||||
m_tc = EDITOR(textCursor());
|
m_tc = EDITOR(textCursor());
|
||||||
|
init();
|
||||||
handleExCommand(cmd);
|
handleExCommand(cmd);
|
||||||
EDITOR(setTextCursor(m_tc));
|
EDITOR(setTextCursor(m_tc));
|
||||||
}
|
}
|
||||||
@@ -1780,7 +1803,8 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
|
|||||||
updateMiniBuffer();
|
updateMiniBuffer();
|
||||||
} else if (reNormal.indexIn(cmd) != -1) { // :normal
|
} else if (reNormal.indexIn(cmd) != -1) { // :normal
|
||||||
enterCommandMode();
|
enterCommandMode();
|
||||||
replay(reNormal.cap(3));
|
//qDebug() << "REPLAY: " << reNormal.cap(3);
|
||||||
|
replay(reNormal.cap(3), 1);
|
||||||
} else if (reSet.indexIn(cmd) != -1) { // :set
|
} else if (reSet.indexIn(cmd) != -1) { // :set
|
||||||
showBlackMessage(QString());
|
showBlackMessage(QString());
|
||||||
QString arg = reSet.cap(2);
|
QString arg = reSet.cap(2);
|
||||||
@@ -2353,11 +2377,11 @@ void FakeVimHandler::Private::handleStartOfLine()
|
|||||||
moveToFirstNonBlankOnLine();
|
moveToFirstNonBlankOnLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FakeVimHandler::Private::replay(const QString &command)
|
void FakeVimHandler::Private::replay(const QString &command, int n)
|
||||||
{
|
{
|
||||||
//qDebug() << "REPLAY: " << command;
|
//qDebug() << "REPLAY: " << command;
|
||||||
m_inReplay = true;
|
m_inReplay = true;
|
||||||
for (int i = count(); --i >= 0; )
|
for (int i = n; --i >= 0; )
|
||||||
foreach (QChar c, command)
|
foreach (QChar c, command)
|
||||||
handleKey(c.unicode(), c.unicode(), QString(c));
|
handleKey(c.unicode(), c.unicode(), QString(c));
|
||||||
m_inReplay = false;
|
m_inReplay = false;
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ void SearchResultTreeItemDelegate::paint(QPainter *painter, const QStyleOptionVi
|
|||||||
}
|
}
|
||||||
|
|
||||||
int SearchResultTreeItemDelegate::drawLineNumber(QPainter *painter, const QStyleOptionViewItemV3 &option,
|
int SearchResultTreeItemDelegate::drawLineNumber(QPainter *painter, const QStyleOptionViewItemV3 &option,
|
||||||
const QModelIndex &index) const
|
const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
static const int lineNumberAreaHorizontalPadding = 4;
|
static const int lineNumberAreaHorizontalPadding = 4;
|
||||||
const bool isSelected = option.state & QStyle::State_Selected;
|
const bool isSelected = option.state & QStyle::State_Selected;
|
||||||
@@ -90,10 +90,10 @@ int SearchResultTreeItemDelegate::drawLineNumber(QPainter *painter, const QStyle
|
|||||||
else if (!(option.state & QStyle::State_Enabled))
|
else if (!(option.state & QStyle::State_Enabled))
|
||||||
cg = QPalette::Disabled;
|
cg = QPalette::Disabled;
|
||||||
|
|
||||||
painter->fillRect(lineNumberAreaRect, QBrush(isSelected?
|
painter->fillRect(lineNumberAreaRect, QBrush(isSelected ?
|
||||||
option.palette.brush(cg, QPalette::Highlight):QBrush(qRgb(230, 230, 230))));
|
option.palette.brush(cg, QPalette::Highlight) : QBrush(qRgb(230, 230, 230))));
|
||||||
painter->setPen(isSelected?
|
painter->setPen(isSelected ?
|
||||||
option.palette.color(cg, QPalette::HighlightedText):Qt::darkGray);
|
option.palette.color(cg, QPalette::HighlightedText) : Qt::darkGray);
|
||||||
painter->drawText(lineNumberAreaRect.adjusted(0, 0, -lineNumberAreaHorizontalPadding, 0),
|
painter->drawText(lineNumberAreaRect.adjusted(0, 0, -lineNumberAreaHorizontalPadding, 0),
|
||||||
Qt::AlignRight, QString::number(lineNumber));
|
Qt::AlignRight, QString::number(lineNumber));
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ int SearchResultTreeItemDelegate::drawLineNumber(QPainter *painter, const QStyle
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SearchResultTreeItemDelegate::drawMarker(QPainter *painter, const QModelIndex &index, const QString text,
|
void SearchResultTreeItemDelegate::drawMarker(QPainter *painter, const QModelIndex &index, const QString text,
|
||||||
const QRect &rect) const
|
const QRect &rect) const
|
||||||
{
|
{
|
||||||
const int textMargin = QApplication::style()->pixelMetric(QStyle::PM_FocusFrameHMargin) + 1;
|
const int textMargin = QApplication::style()->pixelMetric(QStyle::PM_FocusFrameHMargin) + 1;
|
||||||
int searchTermStart = index.model()->data(index, ItemDataRoles::SearchTermStartRole).toInt();
|
int searchTermStart = index.model()->data(index, ItemDataRoles::SearchTermStartRole).toInt();
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace Find {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
namespace ItemDataRoles {
|
namespace ItemDataRoles {
|
||||||
|
|
||||||
enum roles
|
enum Roles
|
||||||
{
|
{
|
||||||
TypeRole = Qt::UserRole,
|
TypeRole = Qt::UserRole,
|
||||||
FileNameRole,
|
FileNameRole,
|
||||||
@@ -49,6 +49,6 @@ enum roles
|
|||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Find
|
} // namespace Find
|
||||||
} // namespace itemDataRoles
|
} // namespace ItemDataRoles
|
||||||
|
|
||||||
#endif // SEARCHRESULTTREEITEMROLES_H
|
#endif // SEARCHRESULTTREEITEMROLES_H
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
using namespace Find::Internal;
|
using namespace Find::Internal;
|
||||||
|
|
||||||
SearchResultTreeItem::SearchResultTreeItem(SearchResultTreeItem::itemType type, const SearchResultTreeItem *parent)
|
SearchResultTreeItem::SearchResultTreeItem(SearchResultTreeItem::ItemType type, const SearchResultTreeItem *parent)
|
||||||
: m_type(type), m_parent(parent)
|
: m_type(type), m_parent(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -41,33 +41,33 @@ SearchResultTreeItem::~SearchResultTreeItem()
|
|||||||
clearChildren();
|
clearChildren();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchResultTreeItem::clearChildren(void)
|
void SearchResultTreeItem::clearChildren()
|
||||||
{
|
{
|
||||||
qDeleteAll(m_children);
|
qDeleteAll(m_children);
|
||||||
m_children.clear();
|
m_children.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
SearchResultTreeItem::itemType SearchResultTreeItem::getItemType(void) const
|
SearchResultTreeItem::ItemType SearchResultTreeItem::itemType() const
|
||||||
{
|
{
|
||||||
return m_type;
|
return m_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SearchResultTreeItem::getChildrenCount(void) const
|
int SearchResultTreeItem::childrenCount() const
|
||||||
{
|
{
|
||||||
return m_children.count();
|
return m_children.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
int SearchResultTreeItem::getRowOfItem(void) const
|
int SearchResultTreeItem::rowOfItem() const
|
||||||
{
|
{
|
||||||
return (m_parent?m_parent->m_children.indexOf(const_cast<SearchResultTreeItem*>(this)):0);
|
return (m_parent ? m_parent->m_children.indexOf(const_cast<SearchResultTreeItem*>(this)):0);
|
||||||
}
|
}
|
||||||
|
|
||||||
const SearchResultTreeItem* SearchResultTreeItem::getChild(int index) const
|
const SearchResultTreeItem* SearchResultTreeItem::childAt(int index) const
|
||||||
{
|
{
|
||||||
return m_children.at(index);
|
return m_children.at(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
const SearchResultTreeItem *SearchResultTreeItem::getParent(void) const
|
const SearchResultTreeItem *SearchResultTreeItem::parent() const
|
||||||
{
|
{
|
||||||
return m_parent;
|
return m_parent;
|
||||||
}
|
}
|
||||||
@@ -78,8 +78,10 @@ void SearchResultTreeItem::appendChild(SearchResultTreeItem *child)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SearchResultTextRow::SearchResultTextRow(int index, int lineNumber,
|
SearchResultTextRow::SearchResultTextRow(int index, int lineNumber,
|
||||||
const QString &rowText, int searchTermStart, int searchTermLength, const SearchResultTreeItem *parent)
|
const QString &rowText,
|
||||||
: SearchResultTreeItem(resultRow, parent),
|
int searchTermStart, int searchTermLength,
|
||||||
|
const SearchResultTreeItem *parent):
|
||||||
|
SearchResultTreeItem(ResultRow, parent),
|
||||||
m_index(index),
|
m_index(index),
|
||||||
m_lineNumber(lineNumber),
|
m_lineNumber(lineNumber),
|
||||||
m_rowText(rowText),
|
m_rowText(rowText),
|
||||||
@@ -113,12 +115,13 @@ int SearchResultTextRow::searchTermLength() const
|
|||||||
return m_searchTermLength;
|
return m_searchTermLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
SearchResultFile::SearchResultFile(const QString &fileName, const SearchResultTreeItem *parent)
|
SearchResultFile::SearchResultFile(const QString &fileName, const SearchResultTreeItem *parent):
|
||||||
: SearchResultTreeItem(resultFile, parent), m_fileName(fileName)
|
SearchResultTreeItem(ResultFile, parent),
|
||||||
|
m_fileName(fileName)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SearchResultFile::getFileName(void) const
|
QString SearchResultFile::fileName() const
|
||||||
{
|
{
|
||||||
return m_fileName;
|
return m_fileName;
|
||||||
}
|
}
|
||||||
@@ -126,6 +129,7 @@ QString SearchResultFile::getFileName(void) const
|
|||||||
void SearchResultFile::appendResultLine(int index, int lineNumber, const QString &rowText, int searchTermStart,
|
void SearchResultFile::appendResultLine(int index, int lineNumber, const QString &rowText, int searchTermStart,
|
||||||
int searchTermLength)
|
int searchTermLength)
|
||||||
{
|
{
|
||||||
SearchResultTreeItem *child = new SearchResultTextRow(index, lineNumber, rowText, searchTermStart, searchTermLength, this);
|
SearchResultTreeItem *child = new SearchResultTextRow(index, lineNumber, rowText,
|
||||||
|
searchTermStart, searchTermLength, this);
|
||||||
appendChild(child);
|
appendChild(child);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,35 +42,35 @@ class SearchResultTreeItem;
|
|||||||
class SearchResultTreeItem
|
class SearchResultTreeItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum itemType
|
enum ItemType
|
||||||
{
|
{
|
||||||
root,
|
Root,
|
||||||
resultRow,
|
ResultRow,
|
||||||
resultFile
|
ResultFile
|
||||||
};
|
};
|
||||||
|
|
||||||
SearchResultTreeItem(itemType type = root, const SearchResultTreeItem *parent = NULL);
|
SearchResultTreeItem(ItemType type = Root, const SearchResultTreeItem *parent = NULL);
|
||||||
virtual ~SearchResultTreeItem();
|
virtual ~SearchResultTreeItem();
|
||||||
|
|
||||||
itemType getItemType() const;
|
ItemType itemType() const;
|
||||||
const SearchResultTreeItem *getParent() const;
|
const SearchResultTreeItem *parent() const;
|
||||||
const SearchResultTreeItem *getChild(int index) const;
|
const SearchResultTreeItem *childAt(int index) const;
|
||||||
void appendChild(SearchResultTreeItem *child);
|
void appendChild(SearchResultTreeItem *child);
|
||||||
int getChildrenCount() const;
|
int childrenCount() const;
|
||||||
int getRowOfItem() const;
|
int rowOfItem() const;
|
||||||
void clearChildren();
|
void clearChildren();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
itemType m_type;
|
ItemType m_type;
|
||||||
const SearchResultTreeItem *m_parent;
|
const SearchResultTreeItem *m_parent;
|
||||||
QList<SearchResultTreeItem *> m_children;
|
QList<SearchResultTreeItem *> m_children;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SearchResultTextRow: public SearchResultTreeItem
|
class SearchResultTextRow : public SearchResultTreeItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SearchResultTextRow(int index, int lineNumber, const QString &rowText, int searchTermStart,
|
SearchResultTextRow(int index, int lineNumber, const QString &rowText, int searchTermStart,
|
||||||
int searchTermLength, const SearchResultTreeItem *parent);
|
int searchTermLength, const SearchResultTreeItem *parent);
|
||||||
int index() const;
|
int index() const;
|
||||||
QString rowText() const;
|
QString rowText() const;
|
||||||
int lineNumber() const;
|
int lineNumber() const;
|
||||||
@@ -85,13 +85,13 @@ private:
|
|||||||
int m_searchTermLength;
|
int m_searchTermLength;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SearchResultFile: public SearchResultTreeItem
|
class SearchResultFile : public SearchResultTreeItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SearchResultFile(const QString &fileName, const SearchResultTreeItem *parent);
|
SearchResultFile(const QString &fileName, const SearchResultTreeItem *parent);
|
||||||
QString getFileName() const;
|
QString fileName() const;
|
||||||
void appendResultLine(int index, int lineNumber, const QString &rowText, int searchTermStart,
|
void appendResultLine(int index, int lineNumber, const QString &rowText, int searchTermStart,
|
||||||
int searchTermLength);
|
int searchTermLength);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_fileName;
|
QString m_fileName;
|
||||||
|
|||||||
@@ -37,9 +37,11 @@
|
|||||||
using namespace Find::Internal;
|
using namespace Find::Internal;
|
||||||
|
|
||||||
SearchResultTreeModel::SearchResultTreeModel(QObject *parent)
|
SearchResultTreeModel::SearchResultTreeModel(QObject *parent)
|
||||||
: QAbstractItemModel(parent), m_lastAppendedResultFile(0)
|
: QAbstractItemModel(parent)
|
||||||
|
, m_lastAppendedResultFile(0)
|
||||||
{
|
{
|
||||||
m_rootItem = new SearchResultTreeItem();
|
m_rootItem = new SearchResultTreeItem();
|
||||||
|
m_textEditorFont = QFont("Courier");
|
||||||
}
|
}
|
||||||
|
|
||||||
SearchResultTreeModel::~SearchResultTreeModel()
|
SearchResultTreeModel::~SearchResultTreeModel()
|
||||||
@@ -47,8 +49,13 @@ SearchResultTreeModel::~SearchResultTreeModel()
|
|||||||
delete m_rootItem;
|
delete m_rootItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SearchResultTreeModel::setTextEditorFont(const QFont &font)
|
||||||
|
{
|
||||||
|
m_textEditorFont = font;
|
||||||
|
}
|
||||||
|
|
||||||
QModelIndex SearchResultTreeModel::index(int row, int column,
|
QModelIndex SearchResultTreeModel::index(int row, int column,
|
||||||
const QModelIndex &parent) const
|
const QModelIndex &parent) const
|
||||||
{
|
{
|
||||||
if (!hasIndex(row, column, parent))
|
if (!hasIndex(row, column, parent))
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
@@ -60,7 +67,7 @@ QModelIndex SearchResultTreeModel::index(int row, int column,
|
|||||||
else
|
else
|
||||||
parentItem = static_cast<const SearchResultTreeItem*>(parent.internalPointer());
|
parentItem = static_cast<const SearchResultTreeItem*>(parent.internalPointer());
|
||||||
|
|
||||||
const SearchResultTreeItem *childItem = parentItem->getChild(row);
|
const SearchResultTreeItem *childItem = parentItem->childAt(row);
|
||||||
if (childItem)
|
if (childItem)
|
||||||
return createIndex(row, column, (void *)childItem);
|
return createIndex(row, column, (void *)childItem);
|
||||||
else
|
else
|
||||||
@@ -73,12 +80,12 @@ QModelIndex SearchResultTreeModel::parent(const QModelIndex &index) const
|
|||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
|
|
||||||
const SearchResultTreeItem *childItem = static_cast<const SearchResultTreeItem*>(index.internalPointer());
|
const SearchResultTreeItem *childItem = static_cast<const SearchResultTreeItem*>(index.internalPointer());
|
||||||
const SearchResultTreeItem *parentItem = childItem->getParent();
|
const SearchResultTreeItem *parentItem = childItem->parent();
|
||||||
|
|
||||||
if (parentItem == m_rootItem)
|
if (parentItem == m_rootItem)
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
|
|
||||||
return createIndex(parentItem->getRowOfItem(), 0, (void *)parentItem);
|
return createIndex(parentItem->rowOfItem(), 0, (void *)parentItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
int SearchResultTreeModel::rowCount(const QModelIndex &parent) const
|
int SearchResultTreeModel::rowCount(const QModelIndex &parent) const
|
||||||
@@ -93,7 +100,7 @@ int SearchResultTreeModel::rowCount(const QModelIndex &parent) const
|
|||||||
else
|
else
|
||||||
parentItem = static_cast<const SearchResultTreeItem*>(parent.internalPointer());
|
parentItem = static_cast<const SearchResultTreeItem*>(parent.internalPointer());
|
||||||
|
|
||||||
return parentItem->getChildrenCount();
|
return parentItem->childrenCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
int SearchResultTreeModel::columnCount(const QModelIndex &parent) const
|
int SearchResultTreeModel::columnCount(const QModelIndex &parent) const
|
||||||
@@ -111,12 +118,12 @@ QVariant SearchResultTreeModel::data(const QModelIndex &index, int role) const
|
|||||||
|
|
||||||
QVariant result;
|
QVariant result;
|
||||||
|
|
||||||
if (item->getItemType() == SearchResultTreeItem::resultRow)
|
if (item->itemType() == SearchResultTreeItem::ResultRow)
|
||||||
{
|
{
|
||||||
const SearchResultTextRow *row = static_cast<const SearchResultTextRow *>(item);
|
const SearchResultTextRow *row = static_cast<const SearchResultTextRow *>(item);
|
||||||
result = data(row, role);
|
result = data(row, role);
|
||||||
}
|
}
|
||||||
else if (item->getItemType() == SearchResultTreeItem::resultFile)
|
else if (item->itemType() == SearchResultTreeItem::ResultFile)
|
||||||
{
|
{
|
||||||
const SearchResultFile *file = static_cast<const SearchResultFile *>(item);
|
const SearchResultFile *file = static_cast<const SearchResultFile *>(item);
|
||||||
result = data(file, role);
|
result = data(file, role);
|
||||||
@@ -135,7 +142,7 @@ QVariant SearchResultTreeModel::data(const SearchResultTextRow *row, int role) c
|
|||||||
result = row->rowText().trimmed();
|
result = row->rowText().trimmed();
|
||||||
break;
|
break;
|
||||||
case Qt::FontRole:
|
case Qt::FontRole:
|
||||||
result = QFont("courier");
|
result = m_textEditorFont;
|
||||||
break;
|
break;
|
||||||
case ItemDataRoles::ResultLineRole:
|
case ItemDataRoles::ResultLineRole:
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
@@ -158,8 +165,8 @@ QVariant SearchResultTreeModel::data(const SearchResultTextRow *row, int role) c
|
|||||||
break;
|
break;
|
||||||
case ItemDataRoles::FileNameRole:
|
case ItemDataRoles::FileNameRole:
|
||||||
{
|
{
|
||||||
const SearchResultFile *file = dynamic_cast<const SearchResultFile *>(row->getParent());
|
const SearchResultFile *file = dynamic_cast<const SearchResultFile *>(row->parent());
|
||||||
result = file->getFileName();
|
result = file->fileName();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@@ -179,22 +186,15 @@ QVariant SearchResultTreeModel::data(const SearchResultFile *file, int role) con
|
|||||||
case Qt::BackgroundRole:
|
case Qt::BackgroundRole:
|
||||||
result = QColor(qRgb(245, 245, 245));
|
result = QColor(qRgb(245, 245, 245));
|
||||||
break;
|
break;
|
||||||
case Qt::FontRole:
|
|
||||||
{
|
|
||||||
QFont font;
|
|
||||||
font.setPointSize(font.pointSize() + 1);
|
|
||||||
result = font;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
result = file->getFileName() + " (" + QString::number(file->getChildrenCount()) + ")";
|
result = file->fileName() + " (" + QString::number(file->childrenCount()) + ")";
|
||||||
break;
|
break;
|
||||||
case ItemDataRoles::FileNameRole:
|
case ItemDataRoles::FileNameRole:
|
||||||
case Qt::ToolTipRole:
|
case Qt::ToolTipRole:
|
||||||
result = file->getFileName();
|
result = file->fileName();
|
||||||
break;
|
break;
|
||||||
case ItemDataRoles::ResultLinesCountRole:
|
case ItemDataRoles::ResultLinesCountRole:
|
||||||
result = file->getChildrenCount();
|
result = file->childrenCount();
|
||||||
break;
|
break;
|
||||||
case ItemDataRoles::TypeRole:
|
case ItemDataRoles::TypeRole:
|
||||||
result = "file";
|
result = "file";
|
||||||
@@ -220,20 +220,20 @@ void SearchResultTreeModel::appendResultFile(const QString &fileName)
|
|||||||
{
|
{
|
||||||
m_lastAppendedResultFile = new SearchResultFile(fileName, m_rootItem);
|
m_lastAppendedResultFile = new SearchResultFile(fileName, m_rootItem);
|
||||||
|
|
||||||
beginInsertRows(QModelIndex(), m_rootItem->getChildrenCount(), m_rootItem->getChildrenCount());
|
beginInsertRows(QModelIndex(), m_rootItem->childrenCount(), m_rootItem->childrenCount());
|
||||||
m_rootItem->appendChild(m_lastAppendedResultFile);
|
m_rootItem->appendChild(m_lastAppendedResultFile);
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchResultTreeModel::appendResultLine(int index, int lineNumber, const QString &rowText, int searchTermStart,
|
void SearchResultTreeModel::appendResultLine(int index, int lineNumber, const QString &rowText,
|
||||||
int searchTermLength)
|
int searchTermStart, int searchTermLength)
|
||||||
{
|
{
|
||||||
if (!m_lastAppendedResultFile)
|
if (!m_lastAppendedResultFile)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QModelIndex lastFile(createIndex(m_lastAppendedResultFile->getRowOfItem(), 0, m_lastAppendedResultFile));
|
QModelIndex lastFile(createIndex(m_lastAppendedResultFile->rowOfItem(), 0, m_lastAppendedResultFile));
|
||||||
|
|
||||||
beginInsertRows(lastFile, m_lastAppendedResultFile->getChildrenCount(), m_lastAppendedResultFile->getChildrenCount());
|
beginInsertRows(lastFile, m_lastAppendedResultFile->childrenCount(), m_lastAppendedResultFile->childrenCount());
|
||||||
m_lastAppendedResultFile->appendResultLine(index, lineNumber, rowText, searchTermStart, searchTermLength);
|
m_lastAppendedResultFile->appendResultLine(index, lineNumber, rowText, searchTermStart, searchTermLength);
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
|
|
||||||
@@ -241,15 +241,15 @@ void SearchResultTreeModel::appendResultLine(int index, int lineNumber, const QS
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SearchResultTreeModel::appendResultLine(int index, const QString &fileName, int lineNumber, const QString &rowText,
|
void SearchResultTreeModel::appendResultLine(int index, const QString &fileName, int lineNumber, const QString &rowText,
|
||||||
int searchTermStart, int searchTermLength)
|
int searchTermStart, int searchTermLength)
|
||||||
{
|
{
|
||||||
if (!m_lastAppendedResultFile || (m_lastAppendedResultFile->getFileName() != fileName))
|
if (!m_lastAppendedResultFile || (m_lastAppendedResultFile->fileName() != fileName))
|
||||||
appendResultFile(fileName);
|
appendResultFile(fileName);
|
||||||
|
|
||||||
appendResultLine(index, lineNumber, rowText, searchTermStart, searchTermLength);
|
appendResultLine(index, lineNumber, rowText, searchTermStart, searchTermLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchResultTreeModel::clear(void)
|
void SearchResultTreeModel::clear()
|
||||||
{
|
{
|
||||||
m_lastAppendedResultFile = NULL;
|
m_lastAppendedResultFile = NULL;
|
||||||
m_rootItem->clearChildren();
|
m_rootItem->clearChildren();
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#define SEARCHRESULTTREEMODEL_H
|
#define SEARCHRESULTTREEMODEL_H
|
||||||
|
|
||||||
#include <QtCore/QAbstractItemModel>
|
#include <QtCore/QAbstractItemModel>
|
||||||
|
#include <QtGui/QFont>
|
||||||
|
|
||||||
namespace Find {
|
namespace Find {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -47,8 +48,9 @@ public:
|
|||||||
SearchResultTreeModel(QObject *parent = 0);
|
SearchResultTreeModel(QObject *parent = 0);
|
||||||
~SearchResultTreeModel();
|
~SearchResultTreeModel();
|
||||||
|
|
||||||
QModelIndex index(int row, int column,
|
void setTextEditorFont(const QFont &font);
|
||||||
const QModelIndex &parent = QModelIndex()) const;
|
|
||||||
|
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
|
||||||
QModelIndex parent(const QModelIndex &child) const;
|
QModelIndex parent(const QModelIndex &child) const;
|
||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
@@ -57,25 +59,26 @@ public:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void jumpToSearchResult(const QString &fileName, int lineNumber,
|
void jumpToSearchResult(const QString &fileName, int lineNumber,
|
||||||
int searchTermStart, int searchTermLength);
|
int searchTermStart, int searchTermLength);
|
||||||
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
|
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void clear();
|
void clear();
|
||||||
void appendResultLine(int index, int lineNumber, const QString &rowText, int searchTermStart,
|
void appendResultLine(int index, int lineNumber, const QString &rowText,
|
||||||
int searchTermLength);
|
int searchTermStart, int searchTermLength);
|
||||||
void appendResultLine(int index, const QString &fileName, int lineNumber, const QString &rowText, int searchTermStart,
|
void appendResultLine(int index, const QString &fileName, int lineNumber, const QString &rowText,
|
||||||
int searchTermLength);
|
int searchTermStart, int searchTermLength);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void appendResultFile(const QString &fileName);
|
void appendResultFile(const QString &fileName);
|
||||||
QVariant data(const SearchResultTextRow *row, int role) const;
|
QVariant data(const SearchResultTextRow *row, int role) const;
|
||||||
QVariant data(const SearchResultFile *file, int role) const;
|
QVariant data(const SearchResultFile *file, int role) const;
|
||||||
void initializeData(void);
|
void initializeData();
|
||||||
void disposeData(void);
|
void disposeData();
|
||||||
|
|
||||||
SearchResultTreeItem *m_rootItem;
|
SearchResultTreeItem *m_rootItem;
|
||||||
SearchResultFile *m_lastAppendedResultFile;
|
SearchResultFile *m_lastAppendedResultFile;
|
||||||
|
QFont m_textEditorFont;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -37,7 +37,8 @@
|
|||||||
using namespace Find::Internal;
|
using namespace Find::Internal;
|
||||||
|
|
||||||
SearchResultTreeView::SearchResultTreeView(QWidget *parent)
|
SearchResultTreeView::SearchResultTreeView(QWidget *parent)
|
||||||
: QTreeView(parent), m_autoExpandResults(false)
|
: QTreeView(parent)
|
||||||
|
, m_autoExpandResults(false)
|
||||||
{
|
{
|
||||||
m_model = new SearchResultTreeModel(this);
|
m_model = new SearchResultTreeModel(this);
|
||||||
setModel(m_model);
|
setModel(m_model);
|
||||||
@@ -46,7 +47,7 @@ SearchResultTreeView::SearchResultTreeView(QWidget *parent)
|
|||||||
setIndentation(14);
|
setIndentation(14);
|
||||||
header()->hide();
|
header()->hide();
|
||||||
|
|
||||||
connect (this, SIGNAL(activated(QModelIndex)), this, SLOT(emitJumpToSearchResult(QModelIndex)));
|
connect(this, SIGNAL(activated(QModelIndex)), this, SLOT(emitJumpToSearchResult(QModelIndex)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchResultTreeView::setAutoExpandResults(bool expand)
|
void SearchResultTreeView::setAutoExpandResults(bool expand)
|
||||||
@@ -54,13 +55,18 @@ void SearchResultTreeView::setAutoExpandResults(bool expand)
|
|||||||
m_autoExpandResults = expand;
|
m_autoExpandResults = expand;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchResultTreeView::clear(void)
|
void SearchResultTreeView::setTextEditorFont(const QFont &font)
|
||||||
|
{
|
||||||
|
m_model->setTextEditorFont(font);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SearchResultTreeView::clear()
|
||||||
{
|
{
|
||||||
m_model->clear();
|
m_model->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchResultTreeView::appendResultLine(int index, const QString &fileName, int lineNumber, const QString &rowText,
|
void SearchResultTreeView::appendResultLine(int index, const QString &fileName, int lineNumber, const QString &rowText,
|
||||||
int searchTermStart, int searchTermLength)
|
int searchTermStart, int searchTermLength)
|
||||||
{
|
{
|
||||||
int rowsBefore = m_model->rowCount();
|
int rowsBefore = m_model->rowCount();
|
||||||
m_model->appendResultLine(index, fileName, lineNumber, rowText, searchTermStart, searchTermLength);
|
m_model->appendResultLine(index, fileName, lineNumber, rowText, searchTermStart, searchTermLength);
|
||||||
|
|||||||
@@ -44,16 +44,18 @@ class SearchResultTreeView : public QTreeView
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
SearchResultTreeView(QWidget *parent = 0);
|
SearchResultTreeView(QWidget *parent = 0);
|
||||||
|
|
||||||
void setAutoExpandResults(bool expand);
|
void setAutoExpandResults(bool expand);
|
||||||
|
void setTextEditorFont(const QFont &font);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void jumpToSearchResult(int index, const QString &fileName, int lineNumber,
|
void jumpToSearchResult(int index, const QString &fileName, int lineNumber,
|
||||||
int searchTermStart, int searchTermLength);
|
int searchTermStart, int searchTermLength);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void clear();
|
void clear();
|
||||||
void appendResultLine(int index, const QString &fileName, int lineNumber, const QString &lineText,
|
void appendResultLine(int index, const QString &fileName, int lineNumber, const QString &lineText,
|
||||||
int searchTermStart, int searchTermLength);
|
int searchTermStart, int searchTermLength);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void emitJumpToSearchResult(const QModelIndex &index);
|
void emitJumpToSearchResult(const QModelIndex &index);
|
||||||
|
|||||||
@@ -82,6 +82,43 @@ SearchResultWindow::~SearchResultWindow()
|
|||||||
m_items.clear();
|
m_items.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SearchResultWindow::visibilityChanged(bool /*visible*/)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget *SearchResultWindow::outputWidget(QWidget *)
|
||||||
|
{
|
||||||
|
return m_widget;
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<QWidget*> SearchResultWindow::toolBarWidgets() const
|
||||||
|
{
|
||||||
|
return QList<QWidget*>() << m_expandCollapseToolButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SearchResultWindow::clearContents()
|
||||||
|
{
|
||||||
|
m_widget->setCurrentWidget(m_searchResultTreeView);
|
||||||
|
m_searchResultTreeView->clear();
|
||||||
|
qDeleteAll(m_items);
|
||||||
|
m_items.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SearchResultWindow::showNoMatchesFound()
|
||||||
|
{
|
||||||
|
m_widget->setCurrentWidget(m_noMatchesFoundDisplay);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SearchResultWindow::isEmpty() const
|
||||||
|
{
|
||||||
|
return (m_searchResultTreeView->model()->rowCount() < 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int SearchResultWindow::numberOfResults() const
|
||||||
|
{
|
||||||
|
return m_searchResultTreeView->model()->rowCount();
|
||||||
|
}
|
||||||
|
|
||||||
bool SearchResultWindow::hasFocus()
|
bool SearchResultWindow::hasFocus()
|
||||||
{
|
{
|
||||||
return m_searchResultTreeView->hasFocus();
|
return m_searchResultTreeView->hasFocus();
|
||||||
@@ -98,41 +135,9 @@ void SearchResultWindow::setFocus()
|
|||||||
m_searchResultTreeView->setFocus();
|
m_searchResultTreeView->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchResultWindow::visibilityChanged(bool /*visible*/)
|
void SearchResultWindow::setTextEditorFont(const QFont &font)
|
||||||
{
|
{
|
||||||
}
|
m_searchResultTreeView->setTextEditorFont(font);
|
||||||
|
|
||||||
QWidget *SearchResultWindow::outputWidget(QWidget *)
|
|
||||||
{
|
|
||||||
return m_widget;
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<QWidget*> SearchResultWindow::toolBarWidgets(void) const
|
|
||||||
{
|
|
||||||
return QList<QWidget*>() << m_expandCollapseToolButton;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SearchResultWindow::clearContents()
|
|
||||||
{
|
|
||||||
m_widget->setCurrentWidget(m_searchResultTreeView);
|
|
||||||
m_searchResultTreeView->clear();
|
|
||||||
qDeleteAll(m_items);
|
|
||||||
m_items.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SearchResultWindow::showNoMatchesFound(void)
|
|
||||||
{
|
|
||||||
m_widget->setCurrentWidget(m_noMatchesFoundDisplay);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SearchResultWindow::isEmpty() const
|
|
||||||
{
|
|
||||||
return (m_searchResultTreeView->model()->rowCount() < 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
int SearchResultWindow::numberOfResults() const
|
|
||||||
{
|
|
||||||
return m_searchResultTreeView->model()->rowCount();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchResultWindow::handleJumpToSearchResult(int index, const QString &fileName, int lineNumber,
|
void SearchResultWindow::handleJumpToSearchResult(int index, const QString &fileName, int lineNumber,
|
||||||
@@ -169,7 +174,7 @@ void SearchResultWindow::handleExpandCollapseToolButton(bool checked)
|
|||||||
m_searchResultTreeView->collapseAll();
|
m_searchResultTreeView->collapseAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchResultWindow::readSettings(void)
|
void SearchResultWindow::readSettings()
|
||||||
{
|
{
|
||||||
QSettings *s = Core::ICore::instance()->settings();
|
QSettings *s = Core::ICore::instance()->settings();
|
||||||
if (s) {
|
if (s) {
|
||||||
@@ -179,7 +184,7 @@ void SearchResultWindow::readSettings(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchResultWindow::writeSettings(void)
|
void SearchResultWindow::writeSettings()
|
||||||
{
|
{
|
||||||
QSettings *s = Core::ICore::instance()->settings();
|
QSettings *s = Core::ICore::instance()->settings();
|
||||||
if (s) {
|
if (s) {
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public:
|
|||||||
~SearchResultWindow();
|
~SearchResultWindow();
|
||||||
|
|
||||||
QWidget *outputWidget(QWidget *);
|
QWidget *outputWidget(QWidget *);
|
||||||
QList<QWidget*> toolBarWidgets(void) const;
|
QList<QWidget*> toolBarWidgets() const;
|
||||||
|
|
||||||
QString name() const { return tr("Search Results"); }
|
QString name() const { return tr("Search Results"); }
|
||||||
int priorityInStatusBar() const;
|
int priorityInStatusBar() const;
|
||||||
@@ -75,11 +75,13 @@ public:
|
|||||||
bool canFocus();
|
bool canFocus();
|
||||||
void setFocus();
|
void setFocus();
|
||||||
|
|
||||||
|
void setTextEditorFont(const QFont &font);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void clearContents();
|
void clearContents();
|
||||||
void showNoMatchesFound();
|
void showNoMatchesFound();
|
||||||
ResultWindowItem *addResult(const QString &fileName, int lineNumber, const QString &lineText,
|
ResultWindowItem *addResult(const QString &fileName, int lineNumber, const QString &lineText,
|
||||||
int searchTermStart, int searchTermLength);
|
int searchTermStart, int searchTermLength);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleExpandCollapseToolButton(bool checked);
|
void handleExpandCollapseToolButton(bool checked);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ using namespace Core::Utils;
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class DirModel: public QDirModel
|
class DirModel : public QDirModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DirModel(QObject *parent)
|
DirModel(QObject *parent)
|
||||||
@@ -121,11 +121,11 @@ private:
|
|||||||
GenericProjectWizardDialog::GenericProjectWizardDialog(QWidget *parent)
|
GenericProjectWizardDialog::GenericProjectWizardDialog(QWidget *parent)
|
||||||
: QWizard(parent)
|
: QWizard(parent)
|
||||||
{
|
{
|
||||||
setWindowTitle(tr("Import Existing Project"));
|
setWindowTitle(tr("Import of Makefile-based Project"));
|
||||||
|
|
||||||
// first page
|
// first page
|
||||||
m_firstPage = new FileWizardPage;
|
m_firstPage = new FileWizardPage;
|
||||||
m_firstPage->setTitle(tr("Import Project"));
|
m_firstPage->setTitle(tr("Generic Project"));
|
||||||
m_firstPage->setNameLabel(tr("Project name:"));
|
m_firstPage->setNameLabel(tr("Project name:"));
|
||||||
m_firstPage->setPathLabel(tr("Location:"));
|
m_firstPage->setPathLabel(tr("Location:"));
|
||||||
|
|
||||||
@@ -178,6 +178,11 @@ QString GenericProjectWizardDialog::path() const
|
|||||||
return m_firstPage->path();
|
return m_firstPage->path();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GenericProjectWizardDialog::setPath(const QString &path)
|
||||||
|
{
|
||||||
|
m_firstPage->setPath(path);
|
||||||
|
}
|
||||||
|
|
||||||
QString GenericProjectWizardDialog::projectName() const
|
QString GenericProjectWizardDialog::projectName() const
|
||||||
{
|
{
|
||||||
return m_firstPage->name();
|
return m_firstPage->name();
|
||||||
@@ -201,6 +206,7 @@ void GenericProjectWizardDialog::updateFilesView(const QModelIndex ¤t,
|
|||||||
|
|
||||||
void GenericProjectWizardDialog::initializePage(int id)
|
void GenericProjectWizardDialog::initializePage(int id)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(id)
|
||||||
#if 0
|
#if 0
|
||||||
if (id == m_secondPageId) {
|
if (id == m_secondPageId) {
|
||||||
using namespace Core::Utils;
|
using namespace Core::Utils;
|
||||||
@@ -237,8 +243,8 @@ Core::BaseFileWizardParameters GenericProjectWizard::parameters()
|
|||||||
{
|
{
|
||||||
static Core::BaseFileWizardParameters parameters(ProjectWizard);
|
static Core::BaseFileWizardParameters parameters(ProjectWizard);
|
||||||
parameters.setIcon(QIcon(":/wizards/images/console.png"));
|
parameters.setIcon(QIcon(":/wizards/images/console.png"));
|
||||||
parameters.setName(tr("Existing Project"));
|
parameters.setName(tr("Import of Makefile-based Project"));
|
||||||
parameters.setDescription(tr("Import Existing Project"));
|
parameters.setDescription(tr("Creates a generic project, supporting any build system."));
|
||||||
parameters.setCategory(QLatin1String("Projects"));
|
parameters.setCategory(QLatin1String("Projects"));
|
||||||
parameters.setTrCategory(tr("Projects"));
|
parameters.setTrCategory(tr("Projects"));
|
||||||
return parameters;
|
return parameters;
|
||||||
@@ -251,6 +257,8 @@ QWizard *GenericProjectWizard::createWizardDialog(QWidget *parent,
|
|||||||
GenericProjectWizardDialog *wizard = new GenericProjectWizardDialog(parent);
|
GenericProjectWizardDialog *wizard = new GenericProjectWizardDialog(parent);
|
||||||
setupWizard(wizard);
|
setupWizard(wizard);
|
||||||
|
|
||||||
|
wizard->setPath(defaultPath);
|
||||||
|
|
||||||
foreach (QWizardPage *p, extensionPages)
|
foreach (QWizardPage *p, extensionPages)
|
||||||
wizard->addPage(p);
|
wizard->addPage(p);
|
||||||
|
|
||||||
@@ -302,6 +310,8 @@ bool GenericProjectWizard::isValidDir(const QFileInfo &fileInfo) const
|
|||||||
Core::GeneratedFiles GenericProjectWizard::generateFiles(const QWizard *w,
|
Core::GeneratedFiles GenericProjectWizard::generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const
|
QString *errorMessage) const
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(errorMessage)
|
||||||
|
|
||||||
const GenericProjectWizardDialog *wizard = qobject_cast<const GenericProjectWizardDialog *>(w);
|
const GenericProjectWizardDialog *wizard = qobject_cast<const GenericProjectWizardDialog *>(w);
|
||||||
const QString projectPath = wizard->path();
|
const QString projectPath = wizard->path();
|
||||||
const QDir dir(projectPath);
|
const QDir dir(projectPath);
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ public:
|
|||||||
virtual ~GenericProjectWizardDialog();
|
virtual ~GenericProjectWizardDialog();
|
||||||
|
|
||||||
QString path() const;
|
QString path() const;
|
||||||
|
void setPath(const QString &path);
|
||||||
|
|
||||||
QString projectName() const;
|
QString projectName() const;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public:
|
|||||||
~PerforceOutputWindow();
|
~PerforceOutputWindow();
|
||||||
|
|
||||||
QWidget *outputWidget(QWidget *parent);
|
QWidget *outputWidget(QWidget *parent);
|
||||||
QList<QWidget*> toolBarWidgets(void) const { return QList<QWidget *>(); }
|
QList<QWidget*> toolBarWidgets() const { return QList<QWidget *>(); }
|
||||||
|
|
||||||
QString name() const;
|
QString name() const;
|
||||||
int priorityInStatusBar() const;
|
int priorityInStatusBar() const;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class CompileOutputWindow : public Core::IOutputPane
|
|||||||
public:
|
public:
|
||||||
CompileOutputWindow(BuildManager *bm);
|
CompileOutputWindow(BuildManager *bm);
|
||||||
QWidget *outputWidget(QWidget *);
|
QWidget *outputWidget(QWidget *);
|
||||||
QList<QWidget*> toolBarWidgets(void) const { return QList<QWidget *>(); }
|
QList<QWidget*> toolBarWidgets() const { return QList<QWidget *>(); }
|
||||||
QString name() const { return tr("Compile Output"); }
|
QString name() const { return tr("Compile Output"); }
|
||||||
int priorityInStatusBar() const;
|
int priorityInStatusBar() const;
|
||||||
void clearContents();
|
void clearContents();
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public:
|
|||||||
~OutputPane();
|
~OutputPane();
|
||||||
|
|
||||||
QWidget *outputWidget(QWidget *);
|
QWidget *outputWidget(QWidget *);
|
||||||
QList<QWidget*> toolBarWidgets(void) const;
|
QList<QWidget*> toolBarWidgets() const;
|
||||||
QString name() const;
|
QString name() const;
|
||||||
int priorityInStatusBar() const;
|
int priorityInStatusBar() const;
|
||||||
void clearContents();
|
void clearContents();
|
||||||
|
|||||||
@@ -2,13 +2,11 @@
|
|||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>ProjectExplorer::Internal::RemoveFileDialog</class>
|
<class>ProjectExplorer::Internal::RemoveFileDialog</class>
|
||||||
<widget class="QDialog" name="ProjectExplorer::Internal::RemoveFileDialog">
|
<widget class="QDialog" name="ProjectExplorer::Internal::RemoveFileDialog">
|
||||||
<property name="geometry">
|
<property name="sizePolicy">
|
||||||
<rect>
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
<x>0</x>
|
<horstretch>0</horstretch>
|
||||||
<y>0</y>
|
<verstretch>0</verstretch>
|
||||||
<width>237</width>
|
</sizepolicy>
|
||||||
<height>171</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Remove File</string>
|
<string>Remove File</string>
|
||||||
@@ -16,13 +14,25 @@
|
|||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="fileToDeleteLabel">
|
<widget class="QLabel" name="fileToDeleteLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>File to delete:</string>
|
<string>File to remove:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="fileNameLabel">
|
<widget class="QLabel" name="fileNameLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<family>Courier New</family>
|
<family>Courier New</family>
|
||||||
@@ -65,6 +75,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
@@ -75,27 +91,7 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources/>
|
||||||
<include location="../../libs/cplusplus/cplusplus.qrc"/>
|
|
||||||
<include location="../../libs/extensionsystem/pluginview.qrc"/>
|
|
||||||
<include location="../bookmarks/bookmarks.qrc"/>
|
|
||||||
<include location="../coreplugin/core.qrc"/>
|
|
||||||
<include location="../coreplugin/fancyactionbar.qrc"/>
|
|
||||||
<include location="../cppeditor/cppeditor.qrc"/>
|
|
||||||
<include location="../cpptools/cpptools.qrc"/>
|
|
||||||
<include location="../designer/designer.qrc"/>
|
|
||||||
<include location="../find/find.qrc"/>
|
|
||||||
<include location="../gdbdebugger/gdbdebugger.qrc"/>
|
|
||||||
<include location="../help/help.qrc"/>
|
|
||||||
<include location="../perforce/perforce.qrc"/>
|
|
||||||
<include location="projectexplorer.qrc"/>
|
|
||||||
<include location="../../../shared/proparser/proparser.qrc"/>
|
|
||||||
<include location="../qt4projectmanager/qt4projectmanager.qrc"/>
|
|
||||||
<include location="../qt4projectmanager/wizards/wizards.qrc"/>
|
|
||||||
<include location="../quickopen/quickopen.qrc"/>
|
|
||||||
<include location="../resourceeditor/resourceeditor.qrc"/>
|
|
||||||
<include location="../texteditor/texteditor.qrc"/>
|
|
||||||
</resources>
|
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public:
|
|||||||
~TaskWindow();
|
~TaskWindow();
|
||||||
|
|
||||||
QWidget *outputWidget(QWidget *);
|
QWidget *outputWidget(QWidget *);
|
||||||
QList<QWidget*> toolBarWidgets(void) const;
|
QList<QWidget*> toolBarWidgets() const;
|
||||||
|
|
||||||
QString name() const { return tr("Build Issues"); }
|
QString name() const { return tr("Build Issues"); }
|
||||||
int priorityInStatusBar() const;
|
int priorityInStatusBar() const;
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ QWidget *Qt4RunConfiguration::configurationWidget()
|
|||||||
|
|
||||||
void Qt4RunConfiguration::save(PersistentSettingsWriter &writer) const
|
void Qt4RunConfiguration::save(PersistentSettingsWriter &writer) const
|
||||||
{
|
{
|
||||||
QDir projectDir(QFileInfo(project()->file()->fileName()).absoluteDir());
|
const QDir projectDir = QFileInfo(project()->file()->fileName()).absoluteDir();
|
||||||
writer.saveValue("CommandLineArguments", m_commandLineArguments);
|
writer.saveValue("CommandLineArguments", m_commandLineArguments);
|
||||||
writer.saveValue("ProFile", projectDir.relativeFilePath(m_proFilePath));
|
writer.saveValue("ProFile", projectDir.relativeFilePath(m_proFilePath));
|
||||||
writer.saveValue("UserSetName", m_userSetName);
|
writer.saveValue("UserSetName", m_userSetName);
|
||||||
@@ -238,7 +238,7 @@ void Qt4RunConfiguration::save(PersistentSettingsWriter &writer) const
|
|||||||
void Qt4RunConfiguration::restore(const PersistentSettingsReader &reader)
|
void Qt4RunConfiguration::restore(const PersistentSettingsReader &reader)
|
||||||
{
|
{
|
||||||
ApplicationRunConfiguration::restore(reader);
|
ApplicationRunConfiguration::restore(reader);
|
||||||
QDir projectDir(QFileInfo(project()->file()->fileName()).absoluteDir());
|
const QDir projectDir = QFileInfo(project()->file()->fileName()).absoluteDir();
|
||||||
m_commandLineArguments = reader.restoreValue("CommandLineArguments").toStringList();
|
m_commandLineArguments = reader.restoreValue("CommandLineArguments").toStringList();
|
||||||
m_proFilePath = projectDir.filePath(reader.restoreValue("ProFile").toString());
|
m_proFilePath = projectDir.filePath(reader.restoreValue("ProFile").toString());
|
||||||
m_userSetName = reader.restoreValue("UserSetName").toBool();
|
m_userSetName = reader.restoreValue("UserSetName").toBool();
|
||||||
|
|||||||
@@ -870,9 +870,12 @@ void QtVersion::setPath(const QString &path)
|
|||||||
QString QtVersion::dumperLibrary() const
|
QString QtVersion::dumperLibrary() const
|
||||||
{
|
{
|
||||||
uint hash = qHash(path());
|
uint hash = qHash(path());
|
||||||
|
QString qtInstallData = versionInfo().value("QT_INSTALL_DATA");
|
||||||
|
if (qtInstallData.isEmpty())
|
||||||
|
qtInstallData = path();
|
||||||
QStringList directories;
|
QStringList directories;
|
||||||
directories
|
directories
|
||||||
<< (path() + "/qtc-debugging-helper/")
|
<< (qtInstallData + "/qtc-debugging-helper/")
|
||||||
<< (QApplication::applicationDirPath() + "/../qtc-debugging-helper/" + QString::number(hash)) + "/"
|
<< (QApplication::applicationDirPath() + "/../qtc-debugging-helper/" + QString::number(hash)) + "/"
|
||||||
<< (QDesktopServices::storageLocation(QDesktopServices::DataLocation) + "/qtc-debugging-helper/" + QString::number(hash)) + "/";
|
<< (QDesktopServices::storageLocation(QDesktopServices::DataLocation) + "/qtc-debugging-helper/" + QString::number(hash)) + "/";
|
||||||
foreach(const QString &directory, directories) {
|
foreach(const QString &directory, directories) {
|
||||||
@@ -1375,6 +1378,12 @@ bool QtVersion::hasDebuggingHelper() const
|
|||||||
return m_hasDebuggingHelper;
|
return m_hasDebuggingHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TODO buildDebuggingHelperLibrary needs to be accessible outside of the
|
||||||
|
// qt4versionmanager
|
||||||
|
// That probably means moving qt4version management into either the projectexplorer
|
||||||
|
// (The Projectexplorer plugin probably needs some splitting up, most of the stuff
|
||||||
|
// could be in a plugin shared by qt4projectmanager, cmakemanager and debugger.)
|
||||||
QString QtVersion::buildDebuggingHelperLibrary()
|
QString QtVersion::buildDebuggingHelperLibrary()
|
||||||
{
|
{
|
||||||
// Locations to try:
|
// Locations to try:
|
||||||
@@ -1384,9 +1393,12 @@ QString QtVersion::buildDebuggingHelperLibrary()
|
|||||||
|
|
||||||
QString output;
|
QString output;
|
||||||
uint hash = qHash(path());
|
uint hash = qHash(path());
|
||||||
|
QString qtInstallData = versionInfo().value("QT_INSTALL_DATA");
|
||||||
|
if (qtInstallData.isEmpty())
|
||||||
|
qtInstallData = path();
|
||||||
QStringList directories;
|
QStringList directories;
|
||||||
directories
|
directories
|
||||||
<< path() + "/qtc-debugging-helper/"
|
<< qtInstallData + "/qtc-debugging-helper/"
|
||||||
<< QApplication::applicationDirPath() + "/../qtc-debugging-helper/" + QString::number(hash) +"/"
|
<< QApplication::applicationDirPath() + "/../qtc-debugging-helper/" + QString::number(hash) +"/"
|
||||||
<< QDesktopServices::storageLocation (QDesktopServices::DataLocation) + "/qtc-debugging-helper/" + QString::number(hash) +"/";
|
<< QDesktopServices::storageLocation (QDesktopServices::DataLocation) + "/qtc-debugging-helper/" + QString::number(hash) +"/";
|
||||||
|
|
||||||
@@ -1420,6 +1432,21 @@ QString QtVersion::buildDebuggingHelperLibrary()
|
|||||||
ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment();
|
ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment();
|
||||||
addToEnvironment(env);
|
addToEnvironment(env);
|
||||||
|
|
||||||
|
// TODO this is a hack to get, to be removed and rewritten for 1.2
|
||||||
|
//
|
||||||
|
// For MSVC and MINGW, we need a toolchain to get the right environment
|
||||||
|
ProjectExplorer::ToolChain *toolChain = 0;
|
||||||
|
ProjectExplorer::ToolChain::ToolChainType t = toolchainType();
|
||||||
|
if (t == ProjectExplorer::ToolChain::MinGW)
|
||||||
|
toolChain = ProjectExplorer::ToolChain::createMinGWToolChain("g++", mingwDirectory());
|
||||||
|
else if(t == ProjectExplorer::ToolChain::MSVC)
|
||||||
|
toolChain = ProjectExplorer::ToolChain::createMSVCToolChain(msvcVersion());
|
||||||
|
if (toolChain) {
|
||||||
|
toolChain->addToEnvironment(env);
|
||||||
|
delete toolChain;
|
||||||
|
toolChain = 0;
|
||||||
|
}
|
||||||
|
|
||||||
qmake.setEnvironment(env.toStringList());
|
qmake.setEnvironment(env.toStringList());
|
||||||
qmake.setWorkingDirectory(directory);
|
qmake.setWorkingDirectory(directory);
|
||||||
qmake.setProcessChannelMode(QProcess::MergedChannels);
|
qmake.setProcessChannelMode(QProcess::MergedChannels);
|
||||||
@@ -1437,7 +1464,6 @@ QString QtVersion::buildDebuggingHelperLibrary()
|
|||||||
// and think about how to fix that later
|
// and think about how to fix that later
|
||||||
|
|
||||||
QString make;
|
QString make;
|
||||||
ProjectExplorer::ToolChain::ToolChainType t = toolchainType();
|
|
||||||
if (t == ProjectExplorer::ToolChain::MinGW)
|
if (t == ProjectExplorer::ToolChain::MinGW)
|
||||||
make = "mingw32-make.exe";
|
make = "mingw32-make.exe";
|
||||||
else if(t == ProjectExplorer::ToolChain::MSVC || t == ProjectExplorer::ToolChain::WINCE)
|
else if(t == ProjectExplorer::ToolChain::MSVC || t == ProjectExplorer::ToolChain::WINCE)
|
||||||
|
|||||||
@@ -56,21 +56,21 @@ class InfoItemConfigurationCross : public SPEInfoItem
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InfoItemConfigurationCross(): SPEInfoItem("", Configuration) {}
|
InfoItemConfigurationCross(): SPEInfoItem("", Configuration) {}
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Debug and Release"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Debug and Release"); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class InfoItemConfigurationDebug : public SPEInfoItem
|
class InfoItemConfigurationDebug : public SPEInfoItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InfoItemConfigurationDebug(): SPEInfoItem("debug", Configuration) {}
|
InfoItemConfigurationDebug(): SPEInfoItem("debug", Configuration) {}
|
||||||
QString name(void) const {return QCoreApplication::translate("SimpleProEditor", "Debug specific");}
|
QString name() const {return QCoreApplication::translate("SimpleProEditor", "Debug specific");}
|
||||||
};
|
};
|
||||||
|
|
||||||
class InfoItemConfigurationRelease : public SPEInfoItem
|
class InfoItemConfigurationRelease : public SPEInfoItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InfoItemConfigurationRelease(): SPEInfoItem("release", Configuration) {}
|
InfoItemConfigurationRelease(): SPEInfoItem("release", Configuration) {}
|
||||||
QString name(void) const {return QCoreApplication::translate("SimpleProEditor", "Release specific");}
|
QString name() const {return QCoreApplication::translate("SimpleProEditor", "Release specific");}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -79,28 +79,28 @@ class InfoItemPlatformCross : public SPEInfoItem
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InfoItemPlatformCross(): SPEInfoItem("", Platform) {}
|
InfoItemPlatformCross(): SPEInfoItem("", Platform) {}
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "All platforms"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "All platforms"); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class InfoItemPlatformWindows : public SPEInfoItem
|
class InfoItemPlatformWindows : public SPEInfoItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InfoItemPlatformWindows(): SPEInfoItem("win32", Platform) {}
|
InfoItemPlatformWindows(): SPEInfoItem("win32", Platform) {}
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "MS Windows specific"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "MS Windows specific"); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class InfoItemPlatformUnix : public SPEInfoItem
|
class InfoItemPlatformUnix : public SPEInfoItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InfoItemPlatformUnix(): SPEInfoItem("unix", Platform) {}
|
InfoItemPlatformUnix(): SPEInfoItem("unix", Platform) {}
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Linux/Unix specific"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Linux/Unix specific"); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class InfoItemPlatformOSX : public SPEInfoItem
|
class InfoItemPlatformOSX : public SPEInfoItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InfoItemPlatformOSX(): SPEInfoItem("macx", Platform) {}
|
InfoItemPlatformOSX(): SPEInfoItem("macx", Platform) {}
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Mac OSX specific"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Mac OSX specific"); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -113,8 +113,8 @@ public:
|
|||||||
m_data.insert(keyImageFileName, ":/variableimages/images/target.png");
|
m_data.insert(keyImageFileName, ":/variableimages/images/target.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Target Options");}
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Target Options");}
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Type and name of the target.");
|
"Type and name of the target.");
|
||||||
@@ -129,8 +129,8 @@ public:
|
|||||||
m_data.insert(keyImageFileName, ":/variableimages/images/defines.png");
|
m_data.insert(keyImageFileName, ":/variableimages/images/defines.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Preprocessor Definitions");}
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Preprocessor Definitions");}
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Setting of the preprocessor definitions.");
|
"Setting of the preprocessor definitions.");
|
||||||
@@ -146,8 +146,8 @@ public:
|
|||||||
m_data.insert(keyImageFileName, ":/variableimages/images/includes.png");
|
m_data.insert(keyImageFileName, ":/variableimages/images/includes.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Include path"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Include path"); }
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Setting of the pathes where the header files are located.");
|
"Setting of the pathes where the header files are located.");
|
||||||
@@ -162,8 +162,8 @@ public:
|
|||||||
m_data.insert(keyImageFileName, ":/variableimages/images/libs.png");
|
m_data.insert(keyImageFileName, ":/variableimages/images/libs.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Libraries");}
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Libraries");}
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Defining the libraries to link the target against and the pathes where these are located.");
|
"Defining the libraries to link the target against and the pathes where these are located.");
|
||||||
@@ -179,8 +179,8 @@ public:
|
|||||||
m_data.insert(keyImageFileName, ":/variableimages/images/sources.png");
|
m_data.insert(keyImageFileName, ":/variableimages/images/sources.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Source Files");}
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Source Files");}
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"");
|
"");
|
||||||
@@ -196,8 +196,8 @@ public:
|
|||||||
m_data.insert(keyImageFileName, ":/variableimages/images/headers.png");
|
m_data.insert(keyImageFileName, ":/variableimages/images/headers.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Header Files");}
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Header Files");}
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"");
|
"");
|
||||||
@@ -213,8 +213,8 @@ public:
|
|||||||
m_data.insert(keyImageFileName, ":/variableimages/images/forms.png");
|
m_data.insert(keyImageFileName, ":/variableimages/images/forms.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Forms");}
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Forms");}
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"");
|
"");
|
||||||
@@ -229,8 +229,8 @@ public:
|
|||||||
m_data.insert(keyImageFileName, ":/variableimages/images/qtmodules.png");
|
m_data.insert(keyImageFileName, ":/variableimages/images/qtmodules.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Qt Modules");}
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Qt Modules");}
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Setting up which of the Qt modules will be used in the target application.");
|
"Setting up which of the Qt modules will be used in the target application.");
|
||||||
@@ -246,8 +246,8 @@ public:
|
|||||||
m_data.insert(keyImageFileName, ":/variableimages/images/resources.png");
|
m_data.insert(keyImageFileName, ":/variableimages/images/resources.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Resource files");}
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Resource files");}
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"");
|
"");
|
||||||
@@ -258,8 +258,8 @@ class InfoItemVariableTarget : public SPEInfoItem
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InfoItemVariableTarget(): SPEInfoItem("TARGET", Variable) {}
|
InfoItemVariableTarget(): SPEInfoItem("TARGET", Variable) {}
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Target name");}
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Target name");}
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"The name of the resulting target.");
|
"The name of the resulting target.");
|
||||||
@@ -270,8 +270,8 @@ class InfoItemVariableConfig : public SPEInfoItem
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InfoItemVariableConfig(): SPEInfoItem("CONFIG", Variable) {}
|
InfoItemVariableConfig(): SPEInfoItem("CONFIG", Variable) {}
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Configuration");}
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Configuration");}
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Configuration.");
|
"Configuration.");
|
||||||
@@ -282,8 +282,8 @@ class InfoItemVariableDestdir : public SPEInfoItem
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InfoItemVariableDestdir(): SPEInfoItem("DESTDIR", Variable) {}
|
InfoItemVariableDestdir(): SPEInfoItem("DESTDIR", Variable) {}
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Destination directory");}
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Destination directory");}
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Where the resulting target will be created.");
|
"Where the resulting target will be created.");
|
||||||
@@ -300,8 +300,8 @@ public:
|
|||||||
m_data.insert(keyIncludedByDefault, true);
|
m_data.insert(keyIncludedByDefault, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "QtCore Module"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtCore Module"); }
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Core non-GUI classes used by other modules");
|
"Core non-GUI classes used by other modules");
|
||||||
@@ -316,8 +316,8 @@ public:
|
|||||||
m_data.insert(keyIncludedByDefault, true);
|
m_data.insert(keyIncludedByDefault, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "QtGui Module"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtGui Module"); }
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Graphical user interface components");
|
"Graphical user interface components");
|
||||||
@@ -332,8 +332,8 @@ public:
|
|||||||
m_data.insert(keyIncludedByDefault, false);
|
m_data.insert(keyIncludedByDefault, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "QtNetwork Module"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtNetwork Module"); }
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Classes for network programming");
|
"Classes for network programming");
|
||||||
@@ -348,8 +348,8 @@ public:
|
|||||||
m_data.insert(keyIncludedByDefault, false);
|
m_data.insert(keyIncludedByDefault, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "QtOpenGL Module"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtOpenGL Module"); }
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"OpenGL support classes");
|
"OpenGL support classes");
|
||||||
@@ -364,8 +364,8 @@ public:
|
|||||||
m_data.insert(keyIncludedByDefault, false);
|
m_data.insert(keyIncludedByDefault, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "QtSql Module"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtSql Module"); }
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Classes for database integration using SQL");
|
"Classes for database integration using SQL");
|
||||||
@@ -380,8 +380,8 @@ public:
|
|||||||
m_data.insert(keyIncludedByDefault, false);
|
m_data.insert(keyIncludedByDefault, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "QtScript Module"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtScript Module"); }
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Classes for evaluating Qt Scripts");
|
"Classes for evaluating Qt Scripts");
|
||||||
@@ -396,8 +396,8 @@ public:
|
|||||||
m_data.insert(keyIncludedByDefault, false);
|
m_data.insert(keyIncludedByDefault, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "QtSvg Module"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtSvg Module"); }
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Classes for displaying the contents of SVG files");
|
"Classes for displaying the contents of SVG files");
|
||||||
@@ -412,8 +412,8 @@ public:
|
|||||||
m_data.insert(keyIncludedByDefault, false);
|
m_data.insert(keyIncludedByDefault, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "QtWebKit Module"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtWebKit Module"); }
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Classes for displaying and editing Web content");
|
"Classes for displaying and editing Web content");
|
||||||
@@ -428,8 +428,8 @@ public:
|
|||||||
m_data.insert(keyIncludedByDefault, false);
|
m_data.insert(keyIncludedByDefault, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "QtXml Module"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtXml Module"); }
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Classes for handling XML");
|
"Classes for handling XML");
|
||||||
@@ -444,8 +444,8 @@ public:
|
|||||||
m_data.insert(keyIncludedByDefault, false);
|
m_data.insert(keyIncludedByDefault, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "QtXmlPatterns Module"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtXmlPatterns Module"); }
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"An XQuery/XPath engine for XML and custom data models");
|
"An XQuery/XPath engine for XML and custom data models");
|
||||||
@@ -460,8 +460,8 @@ public:
|
|||||||
m_data.insert(keyIncludedByDefault, false);
|
m_data.insert(keyIncludedByDefault, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Phonon Module"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Phonon Module"); }
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Multimedia framework classes");
|
"Multimedia framework classes");
|
||||||
@@ -476,8 +476,8 @@ public:
|
|||||||
m_data.insert(keyIncludedByDefault, false);
|
m_data.insert(keyIncludedByDefault, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Qt3Support Module"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Qt3Support Module"); }
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Classes that ease porting from Qt 3 to Qt 4");
|
"Classes that ease porting from Qt 3 to Qt 4");
|
||||||
@@ -492,8 +492,8 @@ public:
|
|||||||
m_data.insert(keyIncludedByDefault, false);
|
m_data.insert(keyIncludedByDefault, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "QtTest Module"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtTest Module"); }
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Tool classes for unit testing");
|
"Tool classes for unit testing");
|
||||||
@@ -508,8 +508,8 @@ public:
|
|||||||
m_data.insert(keyIncludedByDefault, false);
|
m_data.insert(keyIncludedByDefault, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "QtDBus module"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtDBus module"); }
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Classes for Inter-Process Communication using the D-Bus");
|
"Classes for Inter-Process Communication using the D-Bus");
|
||||||
@@ -526,8 +526,8 @@ public:
|
|||||||
m_data.insert(keyIncludedByDefault, false);
|
m_data.insert(keyIncludedByDefault, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Application"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Application"); }
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Create a standalone application");
|
"Create a standalone application");
|
||||||
@@ -542,8 +542,8 @@ public:
|
|||||||
m_data.insert(keyIncludedByDefault, false);
|
m_data.insert(keyIncludedByDefault, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Dynamic Library"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Dynamic Library"); }
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Create a dynamic library for usage in other applications");
|
"Create a dynamic library for usage in other applications");
|
||||||
@@ -558,8 +558,8 @@ public:
|
|||||||
m_data.insert(keyIncludedByDefault, false);
|
m_data.insert(keyIncludedByDefault, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Static Library"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Static Library"); }
|
||||||
QString description(void) const
|
QString description() const
|
||||||
{
|
{
|
||||||
return QCoreApplication::translate("SimpleProEditor",
|
return QCoreApplication::translate("SimpleProEditor",
|
||||||
"Create a static library for usage in other applications");
|
"Create a static library for usage in other applications");
|
||||||
@@ -571,35 +571,35 @@ class InfoItemOperatorsAdd : public SPEInfoItem
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InfoItemOperatorsAdd(): SPEInfoItem("+=", Operator) {}
|
InfoItemOperatorsAdd(): SPEInfoItem("+=", Operator) {}
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Add Operator"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Add Operator"); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class InfoItemOperatorsRemove : public SPEInfoItem
|
class InfoItemOperatorsRemove : public SPEInfoItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InfoItemOperatorsRemove(): SPEInfoItem("-=", Operator) {}
|
InfoItemOperatorsRemove(): SPEInfoItem("-=", Operator) {}
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Remove Operator"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Remove Operator"); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class InfoItemOperatorsReplace : public SPEInfoItem
|
class InfoItemOperatorsReplace : public SPEInfoItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InfoItemOperatorsReplace(): SPEInfoItem("~=", Operator) {}
|
InfoItemOperatorsReplace(): SPEInfoItem("~=", Operator) {}
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Replace Operator"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Replace Operator"); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class InfoItemOperatorsSet : public SPEInfoItem
|
class InfoItemOperatorsSet : public SPEInfoItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InfoItemOperatorsSet(): SPEInfoItem("=", Operator) {}
|
InfoItemOperatorsSet(): SPEInfoItem("=", Operator) {}
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Set Operator"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Set Operator"); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class InfoItemOperatorsUniqueAdd : public SPEInfoItem
|
class InfoItemOperatorsUniqueAdd : public SPEInfoItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InfoItemOperatorsUniqueAdd(): SPEInfoItem("*=", Operator) {}
|
InfoItemOperatorsUniqueAdd(): SPEInfoItem("*=", Operator) {}
|
||||||
QString name(void) const { return QCoreApplication::translate("SimpleProEditor", "Unique Add Operator"); }
|
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Unique Add Operator"); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -625,7 +625,7 @@ QVariant SPEInfoItem::data(const QString &key) const
|
|||||||
return m_data.value(key);
|
return m_data.value(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
const SPEInfoItem *SPEInfoItem::parentItem(void) const
|
const SPEInfoItem *SPEInfoItem::parentItem() const
|
||||||
{
|
{
|
||||||
return m_parentItem;
|
return m_parentItem;
|
||||||
}
|
}
|
||||||
@@ -651,7 +651,7 @@ QString SPEInfoItem::id() const
|
|||||||
return m_id;
|
return m_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
SPEInfoItem::InfoKind SPEInfoItem::infoKind(void) const
|
SPEInfoItem::InfoKind SPEInfoItem::infoKind() const
|
||||||
{
|
{
|
||||||
return m_infoKind;
|
return m_infoKind;
|
||||||
}
|
}
|
||||||
@@ -686,7 +686,7 @@ void SPEInfo::addListToHash(const QList<SPEInfoItem*> &list)
|
|||||||
m_itemHash.insert(qMakePair(item->infoKind(), item->id()), item);
|
m_itemHash.insert(qMakePair(item->infoKind(), item->id()), item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SPEInfo::initializeLists(void)
|
void SPEInfo::initializeLists()
|
||||||
{
|
{
|
||||||
InfoItemConfigurationCross *infoItemConfigurationCross = new InfoItemConfigurationCross;
|
InfoItemConfigurationCross *infoItemConfigurationCross = new InfoItemConfigurationCross;
|
||||||
InfoItemConfigurationDebug *infoItemConfigurationDebug = new InfoItemConfigurationDebug;
|
InfoItemConfigurationDebug *infoItemConfigurationDebug = new InfoItemConfigurationDebug;
|
||||||
@@ -762,7 +762,7 @@ void SPEInfo::initializeLists(void)
|
|||||||
m_listsInitialized = true;
|
m_listsInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SPEInfo::deleteLists(void)
|
void SPEInfo::deleteLists()
|
||||||
{
|
{
|
||||||
m_itemHash.clear();
|
m_itemHash.clear();
|
||||||
|
|
||||||
|
|||||||
@@ -52,12 +52,12 @@ public:
|
|||||||
SPEInfoItem(const QString &id, InfoKind kind);
|
SPEInfoItem(const QString &id, InfoKind kind);
|
||||||
virtual ~SPEInfoItem() {}
|
virtual ~SPEInfoItem() {}
|
||||||
|
|
||||||
QString id(void) const;
|
QString id() const;
|
||||||
InfoKind infoKind(void) const;
|
InfoKind infoKind() const;
|
||||||
virtual QString name(void) const;
|
virtual QString name() const;
|
||||||
virtual QString description(void) const;
|
virtual QString description() const;
|
||||||
QVariant data(const QString &key) const;
|
QVariant data(const QString &key) const;
|
||||||
const SPEInfoItem *parentItem(void) const;
|
const SPEInfoItem *parentItem() const;
|
||||||
void setParentItem(const SPEInfoItem *parentItem);
|
void setParentItem(const SPEInfoItem *parentItem);
|
||||||
|
|
||||||
bool isAncestorOf(const SPEInfoItem *ancestor) const;
|
bool isAncestorOf(const SPEInfoItem *ancestor) const;
|
||||||
@@ -92,8 +92,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static void addListToHash(const QList<SPEInfoItem*> &list);
|
static void addListToHash(const QList<SPEInfoItem*> &list);
|
||||||
static void initializeLists(void);
|
static void initializeLists();
|
||||||
static void deleteLists(void);
|
static void deleteLists();
|
||||||
|
|
||||||
static QList<SPEInfoItem*> m_configurationList;
|
static QList<SPEInfoItem*> m_configurationList;
|
||||||
static QList<SPEInfoItem*> m_platformList;
|
static QList<SPEInfoItem*> m_platformList;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public:
|
|||||||
~SubversionOutputWindow();
|
~SubversionOutputWindow();
|
||||||
|
|
||||||
QWidget *outputWidget(QWidget *parent);
|
QWidget *outputWidget(QWidget *parent);
|
||||||
QList<QWidget*> toolBarWidgets(void) const {
|
QList<QWidget*> toolBarWidgets() const {
|
||||||
return QList<QWidget *>();
|
return QList<QWidget *>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <texteditor/texteditoractionhandler.h>
|
#include <texteditor/texteditoractionhandler.h>
|
||||||
|
#include <find/searchresultwindow.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QtCore/QtPlugin>
|
#include <QtCore/QtPlugin>
|
||||||
@@ -63,7 +64,8 @@ TextEditorPlugin::TextEditorPlugin()
|
|||||||
: m_settings(0),
|
: m_settings(0),
|
||||||
m_wizard(0),
|
m_wizard(0),
|
||||||
m_editorFactory(0),
|
m_editorFactory(0),
|
||||||
m_lineNumberFilter(0)
|
m_lineNumberFilter(0),
|
||||||
|
m_searchResultWindow(0)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!m_instance, return);
|
QTC_ASSERT(!m_instance, return);
|
||||||
m_instance = this;
|
m_instance = this;
|
||||||
@@ -137,6 +139,13 @@ bool TextEditorPlugin::initialize(const QStringList &arguments, QString *errorMe
|
|||||||
void TextEditorPlugin::extensionsInitialized()
|
void TextEditorPlugin::extensionsInitialized()
|
||||||
{
|
{
|
||||||
m_editorFactory->actionHandler()->initializeActions();
|
m_editorFactory->actionHandler()->initializeActions();
|
||||||
|
|
||||||
|
m_searchResultWindow = ExtensionSystem::PluginManager::instance()->getObject<Find::SearchResultWindow>();
|
||||||
|
|
||||||
|
connect(m_settings, SIGNAL(fontSettingsChanged(TextEditor::FontSettings)),
|
||||||
|
this, SLOT(updateSearchResultsFont(TextEditor::FontSettings)));
|
||||||
|
|
||||||
|
updateSearchResultsFont(m_settings->fontSettings());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEditorPlugin::initializeEditor(PlainTextEditor *editor)
|
void TextEditorPlugin::initializeEditor(PlainTextEditor *editor)
|
||||||
@@ -155,5 +164,10 @@ void TextEditorPlugin::invokeCompletion()
|
|||||||
editor->triggerCompletions();
|
editor->triggerCompletions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TextEditorPlugin::updateSearchResultsFont(const FontSettings &settings)
|
||||||
|
{
|
||||||
|
if (m_searchResultWindow)
|
||||||
|
m_searchResultWindow->setTextEditorFont(QFont(settings.family(), settings.fontSize()));
|
||||||
|
}
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN(TextEditorPlugin)
|
Q_EXPORT_PLUGIN(TextEditorPlugin)
|
||||||
|
|||||||
@@ -32,6 +32,10 @@
|
|||||||
|
|
||||||
#include <extensionsystem/iplugin.h>
|
#include <extensionsystem/iplugin.h>
|
||||||
|
|
||||||
|
namespace Find {
|
||||||
|
class SearchResultWindow;
|
||||||
|
}
|
||||||
|
|
||||||
namespace TextEditor {
|
namespace TextEditor {
|
||||||
|
|
||||||
class FontSettings;
|
class FontSettings;
|
||||||
@@ -65,6 +69,7 @@ public:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void invokeCompletion();
|
void invokeCompletion();
|
||||||
|
void updateSearchResultsFont(const TextEditor::FontSettings &);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static TextEditorPlugin *m_instance;
|
static TextEditorPlugin *m_instance;
|
||||||
@@ -72,6 +77,7 @@ private:
|
|||||||
TextFileWizard *m_wizard;
|
TextFileWizard *m_wizard;
|
||||||
PlainTextEditorFactory *m_editorFactory;
|
PlainTextEditorFactory *m_editorFactory;
|
||||||
LineNumberFilter *m_lineNumberFilter;
|
LineNumberFilter *m_lineNumberFilter;
|
||||||
|
Find::SearchResultWindow *m_searchResultWindow;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -177,6 +177,7 @@ void QrcEditor::resolveLocationIssues(QStringList &files)
|
|||||||
const QString dotdotSlash = QLatin1String("../");
|
const QString dotdotSlash = QLatin1String("../");
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int count = files.count();
|
int count = files.count();
|
||||||
|
int initialCount = files.count();
|
||||||
|
|
||||||
// Find first troublesome file
|
// Find first troublesome file
|
||||||
for (; i < count; i++) {
|
for (; i < count; i++) {
|
||||||
@@ -213,10 +214,14 @@ void QrcEditor::resolveLocationIssues(QStringList &files)
|
|||||||
message.setWindowTitle(tr("Invalid file"));
|
message.setWindowTitle(tr("Invalid file"));
|
||||||
message.setIcon(QMessageBox::Warning);
|
message.setIcon(QMessageBox::Warning);
|
||||||
QPushButton * const copyButton = message.addButton(tr("Copy"), QMessageBox::ActionRole);
|
QPushButton * const copyButton = message.addButton(tr("Copy"), QMessageBox::ActionRole);
|
||||||
QPushButton * const skipButton = message.addButton(tr("Don't add"), QMessageBox::DestructiveRole);
|
QPushButton * skipButton = NULL;
|
||||||
|
if (initialCount > 1)
|
||||||
|
{
|
||||||
|
skipButton = message.addButton(tr("Skip"), QMessageBox::DestructiveRole);
|
||||||
|
message.setEscapeButton(skipButton);
|
||||||
|
}
|
||||||
QPushButton * const abortButton = message.addButton(tr("Abort"), QMessageBox::RejectRole);
|
QPushButton * const abortButton = message.addButton(tr("Abort"), QMessageBox::RejectRole);
|
||||||
message.setDefaultButton(copyButton);
|
message.setDefaultButton(copyButton);
|
||||||
message.setEscapeButton(skipButton);
|
|
||||||
message.setText(tr("The file %1 is not in a subdirectory of the resource file. Continuing will result in an invalid resource file.")
|
message.setText(tr("The file %1 is not in a subdirectory of the resource file. Continuing will result in an invalid resource file.")
|
||||||
.arg(QDir::toNativeSeparators(file)));
|
.arg(QDir::toNativeSeparators(file)));
|
||||||
message.exec();
|
message.exec();
|
||||||
@@ -226,7 +231,12 @@ void QrcEditor::resolveLocationIssues(QStringList &files)
|
|||||||
i--; // Compensate i++
|
i--; // Compensate i++
|
||||||
} else if (message.clickedButton() == copyButton) {
|
} else if (message.clickedButton() == copyButton) {
|
||||||
const QFileInfo fi(file);
|
const QFileInfo fi(file);
|
||||||
const QFileInfo suggestion(dir, fi.fileName());
|
QFileInfo suggestion;
|
||||||
|
QDir tmpTarget(dir.path() + QString(QDir::separator()) + QString("Resources"));;
|
||||||
|
if (tmpTarget.exists())
|
||||||
|
suggestion.setFile(tmpTarget, fi.fileName());
|
||||||
|
else
|
||||||
|
suggestion.setFile(dir, fi.fileName());
|
||||||
const QString copyName = QFileDialog::getSaveFileName(this, tr("Choose copy location"),
|
const QString copyName = QFileDialog::getSaveFileName(this, tr("Choose copy location"),
|
||||||
suggestion.absoluteFilePath());
|
suggestion.absoluteFilePath());
|
||||||
if (!copyName.isEmpty()) {
|
if (!copyName.isEmpty()) {
|
||||||
|
|||||||
@@ -199,9 +199,8 @@ ResourceView::ResourceView(QUndoStack *history, QWidget *parent) :
|
|||||||
enableContextMenu(true);
|
enableContextMenu(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
ResourceView::~ResourceView(void)
|
ResourceView::~ResourceView()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResourceView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous)
|
void ResourceView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous)
|
||||||
@@ -477,7 +476,7 @@ void ResourceView::onEditAlias()
|
|||||||
changeAlias(index);
|
changeAlias(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ResourceView::load(QString fileName)
|
bool ResourceView::load(const QString &fileName)
|
||||||
{
|
{
|
||||||
const QFileInfo fi(fileName);
|
const QFileInfo fi(fileName);
|
||||||
m_qrcModel->setFileName(fi.absoluteFilePath());
|
m_qrcModel->setFileName(fi.absoluteFilePath());
|
||||||
@@ -488,7 +487,7 @@ bool ResourceView::load(QString fileName)
|
|||||||
return m_qrcModel->reload();
|
return m_qrcModel->reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ResourceView::save(void)
|
bool ResourceView::save()
|
||||||
{
|
{
|
||||||
return m_qrcModel->save();
|
return m_qrcModel->save();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,10 +84,10 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
ResourceView(QUndoStack *history, QWidget *parent = 0);
|
ResourceView(QUndoStack *history, QWidget *parent = 0);
|
||||||
~ResourceView(void);
|
~ResourceView();
|
||||||
|
|
||||||
bool load(QString fileName);
|
bool load(const QString &fileName);
|
||||||
bool save(void);
|
bool save();
|
||||||
QString fileName() const;
|
QString fileName() const;
|
||||||
void setFileName(const QString &fileName);
|
void setFileName(const QString &fileName);
|
||||||
|
|
||||||
@@ -114,9 +114,9 @@ public:
|
|||||||
bool defaultAddFileEnabled() const;
|
bool defaultAddFileEnabled() const;
|
||||||
|
|
||||||
void findSamePlacePostDeletionModelIndex(int &row, QModelIndex &parent) const;
|
void findSamePlacePostDeletionModelIndex(int &row, QModelIndex &parent) const;
|
||||||
EntryBackup * removeEntry(const QModelIndex &index);
|
EntryBackup *removeEntry(const QModelIndex &index);
|
||||||
void addFiles(int prefixIndex, const QStringList &fileNames, int cursorFile,
|
void addFiles(int prefixIndex, const QStringList &fileNames, int cursorFile,
|
||||||
int &firstFile, int &lastFile);
|
int &firstFile, int &lastFile);
|
||||||
void removeFiles(int prefixIndex, int firstFileIndex, int lastFileIndex);
|
void removeFiles(int prefixIndex, int firstFileIndex, int lastFileIndex);
|
||||||
QStringList fileNamesToAdd();
|
QStringList fileNamesToAdd();
|
||||||
QModelIndex addPrefix();
|
QModelIndex addPrefix();
|
||||||
@@ -158,8 +158,8 @@ public:
|
|||||||
void changeValue(const QModelIndex &nodeIndex, NodeProperty property, const QString &value);
|
void changeValue(const QModelIndex &nodeIndex, NodeProperty property, const QString &value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void addUndoCommand(const QModelIndex &nodeIndex, NodeProperty property, const QString &before,
|
void addUndoCommand(const QModelIndex &nodeIndex, NodeProperty property,
|
||||||
const QString &after);
|
const QString &before, const QString &after);
|
||||||
|
|
||||||
QPoint m_releasePos;
|
QPoint m_releasePos;
|
||||||
|
|
||||||
|
|||||||
@@ -45,31 +45,35 @@ class tst_FakeVim : public QObject
|
|||||||
public:
|
public:
|
||||||
tst_FakeVim();
|
tst_FakeVim();
|
||||||
|
|
||||||
void setup();
|
|
||||||
void send(const QString &command); // send a normal command
|
|
||||||
void sendEx(const QString &command); // send an ex command
|
|
||||||
|
|
||||||
QString cleaned(QString wanted) { wanted.remove('$'); return wanted; }
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void changeStatusData(const QString &info) { m_statusData = info; }
|
void changeStatusData(const QString &info) { m_statusData = info; }
|
||||||
void changeStatusMessage(const QString &info) { m_statusMessage = info; }
|
void changeStatusMessage(const QString &info) { m_statusMessage = info; }
|
||||||
void changeExtraInformation(const QString &info) { m_infoMessage = info; }
|
void changeExtraInformation(const QString &info) { m_infoMessage = info; }
|
||||||
|
|
||||||
public:
|
|
||||||
QString m_statusMessage;
|
|
||||||
QString m_statusData;
|
|
||||||
QString m_infoMessage;
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void commandI();
|
void commandI();
|
||||||
void commandDollar();
|
void commandDollar();
|
||||||
|
void commandDown();
|
||||||
|
void commandUp();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void setup();
|
||||||
|
void send(const QString &command); // send a normal command
|
||||||
|
void sendEx(const QString &command); // send an ex command
|
||||||
|
|
||||||
|
bool checkContentsHelper(QString expected, const char* file, int line);
|
||||||
|
bool checkHelper(bool isExCommand, QString cmd, QString expected,
|
||||||
|
const char* file, int line);
|
||||||
|
QString insertCursor(const QString &needle0);
|
||||||
|
|
||||||
QPlainTextEdit m_editor;
|
QPlainTextEdit m_editor;
|
||||||
FakeVimHandler m_handler;
|
FakeVimHandler m_handler;
|
||||||
QList<QTextEdit::ExtraSelection> m_selection;
|
QList<QTextEdit::ExtraSelection> m_selection;
|
||||||
|
|
||||||
|
QString m_statusMessage;
|
||||||
|
QString m_statusData;
|
||||||
|
QString m_infoMessage;
|
||||||
|
|
||||||
static const QString lines;
|
static const QString lines;
|
||||||
static const QString escape;
|
static const QString escape;
|
||||||
};
|
};
|
||||||
@@ -91,7 +95,6 @@ const QString tst_FakeVim::escape = QChar(27);
|
|||||||
tst_FakeVim::tst_FakeVim()
|
tst_FakeVim::tst_FakeVim()
|
||||||
: m_handler(&m_editor, this)
|
: m_handler(&m_editor, this)
|
||||||
{
|
{
|
||||||
|
|
||||||
QObject::connect(&m_handler, SIGNAL(commandBufferChanged(QString)),
|
QObject::connect(&m_handler, SIGNAL(commandBufferChanged(QString)),
|
||||||
this, SLOT(changeStatusMessage(QString)));
|
this, SLOT(changeStatusMessage(QString)));
|
||||||
QObject::connect(&m_handler, SIGNAL(extraInformationChanged(QString)),
|
QObject::connect(&m_handler, SIGNAL(extraInformationChanged(QString)),
|
||||||
@@ -106,6 +109,12 @@ void tst_FakeVim::setup()
|
|||||||
m_statusData.clear();
|
m_statusData.clear();
|
||||||
m_infoMessage.clear();
|
m_infoMessage.clear();
|
||||||
m_editor.setPlainText(lines);
|
m_editor.setPlainText(lines);
|
||||||
|
QTextCursor tc = m_editor.textCursor();
|
||||||
|
tc.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor);
|
||||||
|
m_editor.setTextCursor(tc);
|
||||||
|
m_editor.setPlainText(lines);
|
||||||
|
//m_editor.show();
|
||||||
|
//qApp->exec();
|
||||||
QCOMPARE(m_editor.toPlainText(), lines);
|
QCOMPARE(m_editor.toPlainText(), lines);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,75 +128,118 @@ void tst_FakeVim::sendEx(const QString &command)
|
|||||||
m_handler.handleCommand(command);
|
m_handler.handleCommand(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define checkContents(wanted) \
|
bool tst_FakeVim::checkContentsHelper(QString want, const char* file, int line)
|
||||||
do { QString want = cleaned(wanted); \
|
{
|
||||||
QString got = m_editor.toPlainText(); \
|
QString got = m_editor.toPlainText();
|
||||||
QStringList wantlist = want.split('\n'); \
|
int pos = m_editor.textCursor().position();
|
||||||
QStringList gotlist = got.split('\n'); \
|
got = got.left(pos) + "@" + got.mid(pos);
|
||||||
QCOMPARE(gotlist.size(), wantlist.size()); \
|
QStringList wantlist = want.split('\n');
|
||||||
for (int i = 0; i < wantlist.size() && i < gotlist.size(); ++i) { \
|
QStringList gotlist = got.split('\n');
|
||||||
QString g = QString("line %1: %2").arg(i + 1).arg(gotlist.at(i)); \
|
if (!QTest::qCompare(gotlist.size(), wantlist.size(), "", "", file, line)) {
|
||||||
QString w = QString("line %1: %2").arg(i + 1).arg(wantlist.at(i)); \
|
qDebug() << "WANT: " << want;
|
||||||
QCOMPARE(g, w); \
|
qDebug() << "GOT: " << got;
|
||||||
} \
|
return false;
|
||||||
} while (0)
|
}
|
||||||
|
for (int i = 0; i < wantlist.size() && i < gotlist.size(); ++i) {
|
||||||
|
QString g = QString("line %1: %2").arg(i + 1).arg(gotlist.at(i));
|
||||||
|
QString w = QString("line %1: %2").arg(i + 1).arg(wantlist.at(i));
|
||||||
|
if (!QTest::qCompare(g, w, "", "", file, line)) {
|
||||||
|
qDebug() << "WANT: " << want;
|
||||||
|
qDebug() << "GOT: " << got;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#define checkText(cmd, wanted) \
|
bool tst_FakeVim::checkHelper(bool ex, QString cmd, QString expected,
|
||||||
do { \
|
const char *file, int line)
|
||||||
send(cmd); \
|
{
|
||||||
checkContents(wanted); \
|
if (ex)
|
||||||
int p = (wanted).indexOf('$'); \
|
sendEx(cmd);
|
||||||
QCOMPARE(m_editor.textCursor().position(), p); \
|
else
|
||||||
} while (0)
|
send(cmd);
|
||||||
|
return checkContentsHelper(expected, file, line);
|
||||||
|
}
|
||||||
|
|
||||||
#define checkTextEx(cmd, wanted) \
|
|
||||||
do { \
|
|
||||||
sendEx(cmd); \
|
|
||||||
checkContents(wanted); \
|
|
||||||
int p = (wanted).indexOf('$'); \
|
|
||||||
QCOMPARE(m_editor.textCursor().position(), p); \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#define checkPosition(cmd, pos) \
|
#define checkContents(expected) \
|
||||||
do { \
|
do { if (!checkContentsHelper(expected, __FILE__, __LINE__)) return; } while (0)
|
||||||
send(cmd); \
|
|
||||||
QCOMPARE(m_editor.textCursor().position(), pos); \
|
// Runs a "normal" command and checks the result.
|
||||||
} while (0)
|
// Cursor position is marked by a '@' in the expected contents.
|
||||||
|
#define check(cmd, expected) \
|
||||||
|
do { if (!checkHelper(false, cmd, expected, __FILE__, __LINE__)) \
|
||||||
|
return; } while (0)
|
||||||
|
|
||||||
|
// Runs an ex command and checks the result.
|
||||||
|
// Cursor position is marked by a '@' in the expected contents.
|
||||||
|
#define checkEx(cmd, expected) \
|
||||||
|
do { if (!checkHelper(true, cmd, expected, __FILE__, __LINE__)) \
|
||||||
|
return; } while (0)
|
||||||
|
|
||||||
|
QString tst_FakeVim::insertCursor(const QString &needle0)
|
||||||
|
{
|
||||||
|
QString needle = needle0;
|
||||||
|
needle.remove('@');
|
||||||
|
QString lines0 = lines;
|
||||||
|
lines0.replace(needle, needle0);
|
||||||
|
//qDebug() << "LINES: " << lines0;
|
||||||
|
return lines0;
|
||||||
|
}
|
||||||
|
|
||||||
void tst_FakeVim::commandI()
|
void tst_FakeVim::commandI()
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
setup();
|
setup();
|
||||||
|
|
||||||
// empty insertion at start of document
|
// empty insertion at start of document
|
||||||
checkText("i" + escape, "$" + lines);
|
check("i" + escape, "@" + lines);
|
||||||
checkText("u", "$" + lines);
|
check("u", "@" + lines);
|
||||||
|
|
||||||
// small insertion at start of document
|
// small insertion at start of document
|
||||||
checkText("ix" + escape, "$x" + lines);
|
check("ix" + escape, "@x" + lines);
|
||||||
checkText("u", "$" + lines);
|
check("u", "@" + lines);
|
||||||
|
|
||||||
// small insertion at start of document
|
// small insertion at start of document
|
||||||
checkText("ixxx" + escape, "xx$x" + lines);
|
check("ixxx" + escape, "xx@x" + lines);
|
||||||
checkText("u", "$" + lines);
|
check("u", "@" + lines);
|
||||||
|
|
||||||
// combine insertions
|
// combine insertions
|
||||||
checkText("ia" + escape, "$a" + lines);
|
check("ia" + escape, "@a" + lines);
|
||||||
checkText("ibx" + escape, "b$xa" + lines);
|
check("ibx" + escape, "b@xa" + lines);
|
||||||
checkText("icyy" + escape, "bcy$yxa" + lines);
|
check("icyy" + escape, "bcy@yxa" + lines);
|
||||||
checkText("u", "b$xa" + lines);
|
check("u", "b@xa" + lines);
|
||||||
checkText("u", "$a" + lines); // undo broken
|
check("u", "@a" + lines); // undo broken
|
||||||
checkTextEx("redo", "b$xa" + lines);
|
checkEx("redo", "b@xa" + lines);
|
||||||
checkText("u", "$a" + lines);
|
check("u", "@a" + lines);
|
||||||
checkText("u", "$" + lines);
|
check("u", "@" + lines);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_FakeVim::commandDollar()
|
void tst_FakeVim::commandDollar()
|
||||||
{
|
{
|
||||||
setup();
|
setup();
|
||||||
checkPosition("$", 0);
|
check("j$", insertCursor("<QtCore>@"));
|
||||||
checkPosition("j", 2);
|
//check("j", insertCursor("<QtGui>@"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tst_FakeVim::commandDown()
|
||||||
|
{
|
||||||
|
setup();
|
||||||
|
check("j", insertCursor("@#include <QtCore"));
|
||||||
|
check("3j", insertCursor("@int main"));
|
||||||
|
check("4j", insertCursor("@ return app.exec()"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void tst_FakeVim::commandUp()
|
||||||
|
{
|
||||||
|
setup();
|
||||||
|
check("j", insertCursor("@#include <QtCore"));
|
||||||
|
check("3j", insertCursor("@int main"));
|
||||||
|
check("4j", insertCursor("@ return app.exec()"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QTEST_MAIN(tst_FakeVim)
|
QTEST_MAIN(tst_FakeVim)
|
||||||
|
|
||||||
|
|||||||
5
tests/manual/gdbdebugger/helper/helper.pro
Normal file
5
tests/manual/gdbdebugger/helper/helper.pro
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
TEMPLATE = app
|
||||||
|
|
||||||
|
SOURCES += ../../../../share/qtcreator/gdbmacros/gdbmacros.cpp
|
||||||
|
SOURCES += main.cpp
|
||||||
19
tests/manual/gdbdebugger/helper/main.cpp
Normal file
19
tests/manual/gdbdebugger/helper/main.cpp
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
#include <QApplication>
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
void qDumpObjectData440(
|
||||||
|
int protocolVersion,
|
||||||
|
int token,
|
||||||
|
void *data,
|
||||||
|
bool dumpChildren,
|
||||||
|
int extraInt0,
|
||||||
|
int extraInt1,
|
||||||
|
int extraInt2,
|
||||||
|
int extraInt3);
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
QApplication app(argc, argv);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -419,7 +419,7 @@ void testQObject(int &argc, char *argv[])
|
|||||||
t += "y";
|
t += "y";
|
||||||
t += "y";
|
t += "y";
|
||||||
|
|
||||||
/*
|
#if 1
|
||||||
QObject ob(&app);
|
QObject ob(&app);
|
||||||
ob.setObjectName("An Object");
|
ob.setObjectName("An Object");
|
||||||
QObject ob1;
|
QObject ob1;
|
||||||
@@ -434,7 +434,7 @@ void testQObject(int &argc, char *argv[])
|
|||||||
obs.append(0);
|
obs.append(0);
|
||||||
obs.append(&app);
|
obs.append(&app);
|
||||||
ob1.setObjectName("A Subobject");
|
ob1.setObjectName("A Subobject");
|
||||||
*/
|
#endif
|
||||||
QString str = QString::fromUtf8("XXXXXXXXXXXXXXyyXXX ö");
|
QString str = QString::fromUtf8("XXXXXXXXXXXXXXyyXXX ö");
|
||||||
QLabel l(str);
|
QLabel l(str);
|
||||||
l.show();
|
l.show();
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ DESTDIR = ..
|
|||||||
|
|
||||||
# Input
|
# Input
|
||||||
SOURCES += ../app.cpp
|
SOURCES += ../app.cpp
|
||||||
|
#SOURCES += ../../../../../share/qtcreator/gdbmacros/gdbmacros.cpp
|
||||||
QT += network
|
QT += network
|
||||||
|
|
||||||
message("this says <foo & bar>")
|
message("this says <foo & bar>")
|
||||||
|
|||||||
Reference in New Issue
Block a user