From 514b16c815c8600b18dd52fdd63e542548727609 Mon Sep 17 00:00:00 2001 From: con Date: Tue, 6 Jan 2009 13:59:17 +0100 Subject: [PATCH 1/6] Fixes: - Unhighlight search results when search filter changes Task: - 237668 --- src/plugins/find/currentdocumentfind.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/find/currentdocumentfind.cpp b/src/plugins/find/currentdocumentfind.cpp index 26ed8dd0492..ed0a61c8319 100644 --- a/src/plugins/find/currentdocumentfind.cpp +++ b/src/plugins/find/currentdocumentfind.cpp @@ -150,6 +150,8 @@ void CurrentDocumentFind::updateCurrentFindFilter(QWidget *old, QWidget *now) if (!impl) return; removeFindSupportConnections(); + if (m_currentFind) + m_currentFind->highlightAll(QString(), 0); m_currentWidget = candidate; m_currentFind = impl; if (m_currentFind) { From b0dd75b460e354f49c8c83b350d2b981f563e3e4 Mon Sep 17 00:00:00 2001 From: con Date: Tue, 6 Jan 2009 14:34:05 +0100 Subject: [PATCH 2/6] Fixes: - Fix the unhighlight fix. Details: - We shouldn't do anything if the find filter doesn't change. That probably also avoids multiple event filters on the same widget. --- src/plugins/find/currentdocumentfind.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/find/currentdocumentfind.cpp b/src/plugins/find/currentdocumentfind.cpp index ed0a61c8319..dd25564a437 100644 --- a/src/plugins/find/currentdocumentfind.cpp +++ b/src/plugins/find/currentdocumentfind.cpp @@ -147,7 +147,7 @@ void CurrentDocumentFind::updateCurrentFindFilter(QWidget *old, QWidget *now) if (!impl) candidate = candidate->parentWidget(); } - if (!impl) + if (!impl || impl == m_currentFind) return; removeFindSupportConnections(); if (m_currentFind) From 26c81c54e3820b42243165ca8bd5e4426c35dd6c Mon Sep 17 00:00:00 2001 From: con Date: Tue, 6 Jan 2009 14:51:45 +0100 Subject: [PATCH 3/6] Fixes: - Multiple pro/pri entries in locator project filters Task: - 238352 Details: - Since a while now, pro and pri files are directly part of a project's file list. --- src/plugins/qt4projectmanager/qt4project.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp index 2a7fd0c242c..dd61dbde099 100644 --- a/src/plugins/qt4projectmanager/qt4project.cpp +++ b/src/plugins/qt4projectmanager/qt4project.cpp @@ -566,7 +566,6 @@ QStringList Qt4Project::files(FilesMode fileMode) const if (fileMode == AllFiles) files += m_projectFiles->generatedFiles[i]; } - files += m_projectFiles->proFiles; return files; } From e43e09ee5ff43ef69c60b8a12f66c166c6f44272 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Tue, 6 Jan 2009 15:15:13 +0100 Subject: [PATCH 4/6] Test the pretty printer. --- tests/manual/cplusplus/main.cpp | 52 ++++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/tests/manual/cplusplus/main.cpp b/tests/manual/cplusplus/main.cpp index b4b9b8456d8..019683f0615 100644 --- a/tests/manual/cplusplus/main.cpp +++ b/tests/manual/cplusplus/main.cpp @@ -37,13 +37,18 @@ #include #include #include +#include -#include -#include +#include +#include +#include +#include +#include #include #include #include +#include class Rewrite { @@ -191,8 +196,35 @@ protected: } }; -int main(int, char *[]) +int main(int argc, char *argv[]) { + QCoreApplication app(argc, argv); + + QStringList args = app.arguments(); + const QString appName = args.first(); + args.removeFirst(); + + bool test_rewriter = false; + bool test_pretty_printer = false; + + foreach (QString arg, args) { + if (arg == QLatin1String("--test-rewriter")) + test_rewriter = true; + else if (arg == QLatin1String("--test-pretty-printer")) + test_pretty_printer = true; + else if (arg == QLatin1String("--help")) { + const QFileInfo appInfo(appName); + const QByteArray appFileName = QFile::encodeName(appInfo.fileName()); + + printf("Usage: %s [options]\n" + " --help Display ths information\n" + " --test-rewriter Test the tree rewriter\n" + " --test-pretty-printer Test the pretty printer\n", + appFileName.constData()); + return EXIT_SUCCESS; + } + } + QFile in; if (! in.open(stdin, QFile::ReadOnly)) return EXIT_FAILURE; @@ -217,10 +249,14 @@ int main(int, char *[]) } // test the rewriter - QByteArray out; - SimpleRefactor refactor(&control); - refactor(&unit, source, &out); - printf("%s\n", out.constData()); - + if (test_rewriter) { + QByteArray out; + SimpleRefactor refactor(&control); + refactor(&unit, source, &out); + printf("%s\n", out.constData()); + } else if (test_pretty_printer) { + PrettyPrinter pp(&control, std::cout); + pp(unit.ast()); + } return EXIT_SUCCESS; } From dce0855fc67ee1d2512f4994c818600908e23848 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Tue, 6 Jan 2009 15:23:59 +0100 Subject: [PATCH 5/6] Show how to replace AST nodes. --- tests/manual/cplusplus/main.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/manual/cplusplus/main.cpp b/tests/manual/cplusplus/main.cpp index 019683f0615..b8a8e328708 100644 --- a/tests/manual/cplusplus/main.cpp +++ b/tests/manual/cplusplus/main.cpp @@ -49,6 +49,7 @@ #include #include #include +#include class Rewrite { @@ -194,6 +195,19 @@ protected: return false; } + + virtual bool visit(CppCastExpressionAST *ast) { + // Replace the C++ cast expression (e.g. static_cast(a)) with + // the one generated by the pretty printer. + std::ostringstream o; + PrettyPrinter pp(control(), o); + pp(ast); + remove(ast->firstToken(), ast->lastToken()); + const std::string str = o.str(); + insertTextBefore(ast->firstToken(), str.c_str()); + insertTextBefore(ast->firstToken(), "/* #REF# beautiful cast */ "); + return false; + } }; int main(int argc, char *argv[]) From 2f2588bee79e410736de6897d9555c42b0cc58e1 Mon Sep 17 00:00:00 2001 From: con Date: Tue, 6 Jan 2009 15:56:47 +0100 Subject: [PATCH 6/6] Fixes: - API doc main page --- doc/api/qtcreator-api.qdoc | 55 ++++++++++++++++++---------- doc/api/qtcreator-api.qdocconf | 6 ++- src/libs/aggregation/aggregate.cpp | 6 +-- src/libs/extensionsystem/iplugin.cpp | 1 + 4 files changed, 44 insertions(+), 24 deletions(-) diff --git a/doc/api/qtcreator-api.qdoc b/doc/api/qtcreator-api.qdoc index 2c939b21bb4..5ac78d98069 100644 --- a/doc/api/qtcreator-api.qdoc +++ b/doc/api/qtcreator-api.qdoc @@ -3,7 +3,28 @@ \title Qt Creator Qt Creator is Qt Software's crossplatform IDE. The core of Qt Creator is - basically only a \l{Plugin Loader Framework}{plugin loader}. + basically only a \l{ExtensionSystem}{plugin loader}. + + \section1 Core Libraries + + There are a few core libraries used by many parts of Qt Creator. + + \table + \header + \o Library Name + \o Description + + \row + \o \l{Aggregation}{Aggregation} + \o Adds functionality for "glueing" QObjects of different + types together, so you can "cast" between them. + + \row + \o \l{ExtensionSystem}{ExtensionSystem} + \o Implements the plugin loader framework. Provides a base class for plugins and + basic mechanisms for plugin interaction like an object pool. + + \endtable \section1 Plugins @@ -18,46 +39,42 @@ \o Description \row - \o \l{Core Plugin} {Core} + \o \l{Core} {Core} \o The core plugin. Provides the main window and managers for editors, actions, mode windows and files, just to mention the most important ones. \endtable - */ /*! \page classes.html - \title Qt Creator Classes and Namespaces - - \section1 Classes + \title Qt Creator Classes \generatelist classes - - \section1 Namespaces - - \generatelist{namespaces} */ /*! - \page interfaces.html - \title Interfaces + \page namespaces.html + \title Qt Creator Namespaces + + \generatelist namespaces +*/ + +/*! + \page mainclasses.html + \title Qt Creator Main Classes + \generatelist mainclasses */ /*! \page functions.html - \title Member Function Index + \title Qt Creator Functions + \generatelist functionindex */ -/*! - \group pluginloader - - \title Plugin Loader Framework -*/ - /*! \group qtc diff --git a/doc/api/qtcreator-api.qdocconf b/doc/api/qtcreator-api.qdocconf index 336aa27edcf..92c40b8a388 100644 --- a/doc/api/qtcreator-api.qdocconf +++ b/doc/api/qtcreator-api.qdocconf @@ -4,11 +4,13 @@ description = Qt Creator API Documentation language = Cpp headerdirs = . \ + ../../src/libs/aggregation \ ../../src/libs/extensionsystem \ ../../src/plugins/core \ ../../src/plugins/core/actionmanager sourcedirs = . \ + ../../src/libs/aggregation \ ../../src/libs/extensionsystem \ ../../src/plugins/core \ ../../src/plugins/core/actionmanager @@ -20,8 +22,8 @@ imagedirs = . indexes = $QTDIR/doc/html/qt.index -outputdir = ./html-api -base = file:./html-api +outputdir = ./html +base = file:./html versionsym = 0.9.2 codeindent = 1 diff --git a/src/libs/aggregation/aggregate.cpp b/src/libs/aggregation/aggregate.cpp index 6fd7414dfc2..1dd6ce03392 100644 --- a/src/libs/aggregation/aggregate.cpp +++ b/src/libs/aggregation/aggregate.cpp @@ -37,12 +37,12 @@ /*! \namespace Aggregation - \brief Contains support for bundling related components, such that - each component exposes the properties and behavior of the + \brief The Aggregation namespace contains support for bundling related components, + such that each component exposes the properties and behavior of the other components to the outside. Components that are bundled to an Aggregate can be "cast" to each other - and have a coupled life cycle. See the documentation of Aggregate for + and have a coupled life cycle. See the documentation of Aggregation::Aggregate for details and examples. */ diff --git a/src/libs/extensionsystem/iplugin.cpp b/src/libs/extensionsystem/iplugin.cpp index 70d2366ea9a..0ce65bf5c0a 100644 --- a/src/libs/extensionsystem/iplugin.cpp +++ b/src/libs/extensionsystem/iplugin.cpp @@ -38,6 +38,7 @@ /*! \class ExtensionSystem::IPlugin + \mainclass \brief Base class for all plugins. The IPlugin class is an abstract class that must be implemented