From 02488eebe43a840b90b6ee7d950c15c8a79ec853 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Mon, 8 Dec 2008 14:48:51 +0100 Subject: [PATCH 1/4] More cleanup in the CppPreprocessor. --- src/plugins/cpptools/cppmodelmanager.cpp | 24 ++++++++++++------------ src/plugins/cpptools/cppmodelmanager.h | 8 ++++---- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index e8359da2b5b..a165614a594 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -115,7 +115,6 @@ public: void setWorkingCopy(const QMap &workingCopy); void setIncludePaths(const QStringList &includePaths); void setFrameworkPaths(const QStringList &frameworkPaths); - void addIncludePath(const QString &path); void setProjectFiles(const QStringList &files); void run(QString &fileName); void operator()(QString &fileName); @@ -170,9 +169,6 @@ void CppPreprocessor::setIncludePaths(const QStringList &includePaths) void CppPreprocessor::setFrameworkPaths(const QStringList &frameworkPaths) { m_frameworkPaths = frameworkPaths; } -void CppPreprocessor::addIncludePath(const QString &path) -{ m_includePaths.append(path); } - void CppPreprocessor::setProjectFiles(const QStringList &files) { m_projectFiles = files; } @@ -488,14 +484,14 @@ void CppModelManager::ensureUpdated() if (! m_dirty) return; - m_projectFiles = updateProjectFiles(); - m_includePaths = updateIncludePaths(); - m_frameworkPaths = updateFrameworkPaths(); - m_definedMacros = updateDefinedMacros(); + m_projectFiles = internalProjectFiles(); + m_includePaths = internalIncludePaths(); + m_frameworkPaths = internalFrameworkPaths(); + m_definedMacros = internalDefinedMacros(); m_dirty = false; } -QStringList CppModelManager::updateProjectFiles() const +QStringList CppModelManager::internalProjectFiles() const { QStringList files; QMapIterator it(m_projects); @@ -504,10 +500,11 @@ QStringList CppModelManager::updateProjectFiles() const ProjectInfo pinfo = it.value(); files += pinfo.sourceFiles; } + files.removeDuplicates(); return files; } -QStringList CppModelManager::updateIncludePaths() const +QStringList CppModelManager::internalIncludePaths() const { QStringList includePaths; QMapIterator it(m_projects); @@ -516,10 +513,11 @@ QStringList CppModelManager::updateIncludePaths() const ProjectInfo pinfo = it.value(); includePaths += pinfo.includePaths; } + includePaths.removeDuplicates(); return includePaths; } -QStringList CppModelManager::updateFrameworkPaths() const +QStringList CppModelManager::internalFrameworkPaths() const { QStringList frameworkPaths; QMapIterator it(m_projects); @@ -528,10 +526,11 @@ QStringList CppModelManager::updateFrameworkPaths() const ProjectInfo pinfo = it.value(); frameworkPaths += pinfo.frameworkPaths; } + frameworkPaths.removeDuplicates(); return frameworkPaths; } -QByteArray CppModelManager::updateDefinedMacros() const +QByteArray CppModelManager::internalDefinedMacros() const { QByteArray macros; QMapIterator it(m_projects); @@ -588,6 +587,7 @@ void CppModelManager::updateProjectInfo(const ProjectInfo &pinfo) return; m_projects.insert(pinfo.project, pinfo); + m_dirty = true; } QFuture CppModelManager::refreshSourceFiles(const QStringList &sourceFiles) diff --git a/src/plugins/cpptools/cppmodelmanager.h b/src/plugins/cpptools/cppmodelmanager.h index 6bc7d0c1c55..3b2f4e19993 100644 --- a/src/plugins/cpptools/cppmodelmanager.h +++ b/src/plugins/cpptools/cppmodelmanager.h @@ -133,10 +133,10 @@ private: } void ensureUpdated(); - QStringList updateProjectFiles() const; - QStringList updateIncludePaths() const; - QStringList updateFrameworkPaths() const; - QByteArray updateDefinedMacros() const; + QStringList internalProjectFiles() const; + QStringList internalIncludePaths() const; + QStringList internalFrameworkPaths() const; + QByteArray internalDefinedMacros() const; static void parse(QFutureInterface &future, CppPreprocessor *preproc, From 764f9b3ac9ecde434ef37a9704b054a0249d2391 Mon Sep 17 00:00:00 2001 From: Kavindra Palaraja Date: Mon, 8 Dec 2008 15:14:36 +0100 Subject: [PATCH 2/4] Fixes: Documentation fixes RevBy: hjk --- doc/qtcreator.qdoc | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index 4dd7a5fb53c..0db515fe434 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -69,7 +69,7 @@ \image qtcreator-breakdown.png - \seection1 The Mode Selectors + \section1 The Mode Selectors When working in Qt Creator, you can be in one of five modes: \bold Project, \bold Edit, \bold Debug, \bold Help, and \bold Output. @@ -613,7 +613,7 @@ \page creator-debugging.html \nextpage creator-tips.html - \title Debugging With Qt Creator + \title Debugging with Qt Creator \table \row @@ -677,9 +677,9 @@ \list \o At a particular line you want the program to stop -- click on the - left margin or press \key F9 (\key F8 for Mac Os X). - \o At the name of a function that you want the program to stop -- enter - the function's name in \gui{Set Breakpoint at Function...} under the + left margin or press \key F9 (\key F8 for Mac OS X). + \o At a function that you want the program to stop -- enter the + function's name in \gui{Set Breakpoint at Function...} under the \gui Debug menu. \endlist @@ -744,7 +744,7 @@ When the program being debugged is stopped, Qt Creator displays the nested function calls leading to the current position as a \e call stack trace. - This stack trace is built up from \e call stack frames, each representing a + This stack trace is built up from \e{call stack frames}, each representing a particular function. For each function, Qt Creator will try to retrieve the file name and line number of the corresponding source files. This data is shown in the \gui Stack view. @@ -765,11 +765,10 @@ \section2 Threads - The \gui Thread view displays the state of the program being debugged one - thread at a time. If a multi-threaded program is stopped, the \gui Thread - view or the combobox named \gui Thread in the debugger's status bar can - be used to switch from one thread to another. The \gui Stack view will - adjust itself accordingly. + If a multi-threaded program is stopped, the \gui Thread view or the + combobox named \gui Thread in the debugger's status bar can be used to + switch from one thread to another. The \gui Stack view will adjust itself + accordingly. \section2 Locals and Watchers @@ -851,8 +850,8 @@ function, the latter the current state of the CPU registers. Both views are mainly useful in connection with the low-level \gui{Step single instruction} and \gui{Step over single instruction} - commands - + commands. + \section1 A Walkthrough for the Debugger Frontend @@ -947,8 +946,9 @@ \bold{Running Qt Creator from the Command Line} - You can start Qt Creator from a command prompt with an existing session or - \c{.pro} file by giving the name as argument on the command line. + You can start Qt Creator from a command prompt with the name of an existing + session or \c{.pro} file by giving the name as argument on the command + line. \bold{Show and Hide the Sidebar} From b220999bdd55c1fb8a7888b9d319353df6451653 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Mon, 8 Dec 2008 17:06:45 +0100 Subject: [PATCH 3/4] Fixes: release build with compiling with CONFIG+=debug_and_release --- src/qworkbench.pri | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/qworkbench.pri b/src/qworkbench.pri index e869ce452a8..1f842960842 100644 --- a/src/qworkbench.pri +++ b/src/qworkbench.pri @@ -1,16 +1,14 @@ IDE_SOURCE_TREE = $$PWD/../ -isEmpty(TEST) { - CONFIG(debug, debug|release) { +isEmpty(TEST):CONFIG(debug, debug|release) { + !debug_and_release|build_pass { TEST = 1 } } -!isEmpty(TEST) { - equals(TEST, 1) { - QT +=testlib - DEFINES+=WITH_TESTS - } +equals(TEST, 1) { + QT +=testlib + DEFINES += WITH_TESTS } isEmpty(IDE_BUILD_TREE) { From be9dfc8c913525e5b636d1693e8a14a45d021f17 Mon Sep 17 00:00:00 2001 From: con Date: Mon, 8 Dec 2008 17:47:54 +0100 Subject: [PATCH 4/4] Fixes: - Show or "); + else + return tr(""); + default: + return QVariant(); + } //switch + } + switch (role) { case Qt::DisplayRole: { Symbol *symbol = static_cast(index.internalPointer()); diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 8567f81d751..ff68bd0bac2 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -203,9 +203,7 @@ void CPPEditor::createToolBar(CPPEditorEditable *editable) m_methodCombo->setMaxVisibleItems(20); m_overviewModel = new OverviewModel(this); - m_noSymbolsModel = new QStringListModel(this); - m_noSymbolsModel->setStringList(QStringList() << tr("")); - m_methodCombo->setModel(m_noSymbolsModel); + m_methodCombo->setModel(m_overviewModel); connect(m_methodCombo, SIGNAL(activated(int)), this, SLOT(jumpToMethod(int))); connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(updateMethodBoxIndex())); @@ -318,16 +316,9 @@ void CPPEditor::onDocumentUpdated(Document::Ptr doc) return; m_overviewModel->rebuild(doc); - if (m_overviewModel->rowCount() > 0) { - if (m_methodCombo->model() != m_overviewModel) - m_methodCombo->setModel(m_overviewModel); - OverviewTreeView *treeView = static_cast(m_methodCombo->view()); - treeView->sync(); - updateMethodBoxIndex(); - } else { - if (m_methodCombo->model() != m_noSymbolsModel) - m_methodCombo->setModel(m_noSymbolsModel); - } + OverviewTreeView *treeView = static_cast(m_methodCombo->view()); + treeView->sync(); + updateMethodBoxIndex(); } void CPPEditor::updateFileName() @@ -335,8 +326,6 @@ void CPPEditor::updateFileName() void CPPEditor::jumpToMethod(int) { - if (m_methodCombo->model() != m_overviewModel) - return; QModelIndex index = m_methodCombo->view()->currentIndex(); Symbol *symbol = m_overviewModel->symbolFromIndex(index); if (! symbol) @@ -351,8 +340,6 @@ void CPPEditor::jumpToMethod(int) void CPPEditor::updateMethodBoxIndex() { - if (m_methodCombo->model() != m_overviewModel) - return; int line = 0, column = 0; convertPosition(position(), &line, &column); @@ -362,7 +349,7 @@ void CPPEditor::updateMethodBoxIndex() for (int row = 0; row < rc; ++row) { const QModelIndex index = m_overviewModel->index(row, 0, QModelIndex()); Symbol *symbol = m_overviewModel->symbolFromIndex(index); - if (symbol->line() > unsigned(line)) + if (symbol && symbol->line() > unsigned(line)) break; lastIndex = index; } diff --git a/src/plugins/cppeditor/cppeditor.h b/src/plugins/cppeditor/cppeditor.h index 33745eddef2..05f2c5d9c74 100644 --- a/src/plugins/cppeditor/cppeditor.h +++ b/src/plugins/cppeditor/cppeditor.h @@ -139,7 +139,6 @@ private: QList m_contexts; QComboBox *m_methodCombo; CPlusPlus::OverviewModel *m_overviewModel; - QStringListModel *m_noSymbolsModel; }; } // namespace Internal