diff options
author | Eike Ziller <eike.ziller@digia.com> | 2013-10-14 15:31:54 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2013-10-14 15:31:54 +0200 |
commit | 8474a6f1280bf26b62b37e094ed2f4013696bdcb (patch) | |
tree | efac4b6d0e6147c8aab3887579271a41ba4d65ef | |
parent | f463c4dade38ab609af1b30c047ecae2bc97a010 (diff) | |
parent | f50ffd614c25f66a5e237f19ea6f0982f665bc27 (diff) | |
download | qt-creator-8474a6f1280bf26b62b37e094ed2f4013696bdcb.tar.gz |
Merge remote-tracking branch 'origin/3.0'
276 files changed, 2451 insertions, 2043 deletions
diff --git a/doc/addressbook-sdk.qdoc b/doc/addressbook-sdk.qdoc index e5e9ac6072..1f6ac54dc5 100644 --- a/doc/addressbook-sdk.qdoc +++ b/doc/addressbook-sdk.qdoc @@ -357,7 +357,7 @@ \image addressbook-tutorial-part2-signals-and-slots.png Finally, set the window title to "Simple Address Book" using the - \l{QWidget::}{setWindowTitle()} function. The tr() method allows us + \l{QWidget::}{setWindowTitle()} function. The tr() function allows us to translate user interface strings. \snippet examples/addressbook-sdk/part2/addressbook.cpp window title @@ -827,7 +827,7 @@ when you enter a contact name to look up. Once you click the dialog's \c findButton, the dialog is hidden and the result code is set to either QDialog::Accepted or QDialog::Rejected by the FindDialog's - \c findClicked() method. This ensures that you only search for a contact + \c findClicked() function. This ensures that you only search for a contact if you have typed something in the FindDialog's line edit. Then proceed to extract the search string, which in this case is diff --git a/doc/api/coding-style.qdoc b/doc/api/coding-style.qdoc index 6ed309f0a6..c01b131919 100644 --- a/doc/api/coding-style.qdoc +++ b/doc/api/coding-style.qdoc @@ -86,10 +86,10 @@ backward source code compatibility in patch releases, so: \list - \li Do not add or remove any public API (e.g. global functions,x - public/protected/private methods). - \li Do not reimplement methods (not even inlines, - nor protected or private methods). + \li Do not add or remove any public API (e.g. global functions, + public/protected/private member functions). + \li Do not reimplement functions (not even inlines, + nor protected or private functions). \li Check \l {http://wiki.qt-project.org/index.php/Binary_Compatibility_Workarounds}{Binary Compatibility Workarounds} for ways to preserve binary compatibility. @@ -687,7 +687,7 @@ will not remove the const modifier. \li Do not use \c dynamic_cast, use \c {qobject_cast} for QObjects, or refactor your design, for example by introducing a \c {type()} - method (see QListWidgetItem), unless you know what you do. + function (see QListWidgetItem), unless you know what you do. \endlist \section2 Compiler and Platform-specific Issues @@ -854,7 +854,7 @@ binary 0, instead of comparing it to 0.0, or, preferred, move such code into an implementation file. - \li Do not hide virtual methods in subclasses (\{-Woverloaded-virtual}). + \li Do not hide virtual functions in subclasses (\{-Woverloaded-virtual}). If the baseclass A has a virtual \c {int val()} and subclass B an overload with the same name, \c {int val(int x)}, the A \c val function is hidden. Use the \c using keyword to make it visible again, and diff --git a/doc/api/examples/exampleplugin/exampleplugin.cpp b/doc/api/examples/exampleplugin/exampleplugin.cpp index 67da9bda17..147a4274b9 100644 --- a/doc/api/examples/exampleplugin/exampleplugin.cpp +++ b/doc/api/examples/exampleplugin/exampleplugin.cpp @@ -34,7 +34,7 @@ bool ExamplePlugin::initialize(const QStringList &arguments, QString *errorStrin // Load settings // Add actions to menus // Connect to other plugins' signals - // In the initialize method, a plugin can be sure that the plugins it + // In the initialize function, a plugin can be sure that the plugins it // depends on have initialized their members. Q_UNUSED(arguments) @@ -62,7 +62,7 @@ bool ExamplePlugin::initialize(const QStringList &arguments, QString *errorStrin void ExamplePlugin::extensionsInitialized() { // Retrieve objects from the plugin manager's object pool - // In the extensionsInitialized method, a plugin can be sure that all + // In the extensionsInitialized function, a plugin can be sure that all // plugins that depend on it are completely initialized. } diff --git a/doc/api/examples/exampleplugin/exampleplugin.h b/doc/api/examples/exampleplugin/exampleplugin.h index c288abf085..4b7b4e893e 100644 --- a/doc/api/examples/exampleplugin/exampleplugin.h +++ b/doc/api/examples/exampleplugin/exampleplugin.h @@ -20,11 +20,11 @@ public: ExamplePlugin(); ~ExamplePlugin(); -//! [plugin methods] +//! [plugin functions] bool initialize(const QStringList &arguments, QString *errorString); void extensionsInitialized(); ShutdownFlag aboutToShutdown(); -//! [plugin methods] +//! [plugin functions] //! [slot] private slots: diff --git a/doc/api/first-plugin.qdoc b/doc/api/first-plugin.qdoc index 0f14611e58..67e5976caa 100644 --- a/doc/api/first-plugin.qdoc +++ b/doc/api/first-plugin.qdoc @@ -276,11 +276,11 @@ All \QC plugins must be derived from \l{ExtensionSystem::IPlugin} and are QObjects. - \snippet exampleplugin/exampleplugin.h plugin methods + \snippet exampleplugin/exampleplugin.h plugin functions - The base class defines basic methods that are called during the life cycle + The base class defines basic functions that are called during the life cycle of a plugin, which are here implemented for your new plugin. - These methods and their roles are described in detail in + These functions and their roles are described in detail in \l{The Plugin Life Cycle}. \snippet exampleplugin/exampleplugin.h slot @@ -296,8 +296,8 @@ All the necessary header files from the plugin code itself, from the Core plugin, and from Qt are included in the beginning of the file. The setup of the menu and menu item - is done in the plugin's \c{initialize} method, which is the first thing called - after the plugin constructor. In that method, the plugin can be sure that the basic + is done in the plugin's \c{initialize} function, which is the first thing called + after the plugin constructor. In that function, the plugin can be sure that the basic setup of plugin's that it depends on has been done, for example the Core plugin's \c{ActionManager} instance has been created. diff --git a/doc/api/plugin-lifecycle.qdoc b/doc/api/plugin-lifecycle.qdoc index 171ab55c35..50e533d833 100644 --- a/doc/api/plugin-lifecycle.qdoc +++ b/doc/api/plugin-lifecycle.qdoc @@ -37,8 +37,8 @@ tracks the state of the plugin. You can get the \l{ExtensionSystem::PluginSpec} instances via the plugin manager's \l{ExtensionSystem::PluginManager::plugins()}{plugins()} - method, or, after a plugin is loaded, through the plugin's - \l{ExtensionSystem::IPlugin::pluginSpec()}{pluginSpec()} method. + function, or, after a plugin is loaded, through the plugin's + \l{ExtensionSystem::IPlugin::pluginSpec()}{pluginSpec()} function. \li Sets the plugins to \c Read state. @@ -61,15 +61,15 @@ \li Sets the plugins to \c Loaded state. - \li Calls the \l{ExtensionSystem::IPlugin::initialize()}{initialize()} methods of - all plugins in the order of the load queue. In the \c initialize method, + \li Calls the \l{ExtensionSystem::IPlugin::initialize()}{initialize()} functions of + all plugins in the order of the load queue. In the \c initialize function, a plugin should make sure that all exported interfaces are set up and available to other plugins. A plugin can assume that plugins they depend on have set up their exported interfaces. For example, the \c Core plugin sets up the \l{Core::ActionManager}, \l{Core::EditorManager} and all other publicly available interfaces, so other plugins can request and use them. - The \l{ExtensionSystem::IPlugin::initialize()}{initialize()} method of a plugin + The \l{ExtensionSystem::IPlugin::initialize()}{initialize()} function of a plugin is a good place for \list \li registering objects in the plugin manager's object pool @@ -82,8 +82,8 @@ \li Sets the plugins to \c Initialized state. \li Calls the \l{ExtensionSystem::IPlugin::extensionsInitialized()}{extensionsInitialized()} - methods of all plugins in \e reverse order of the load queue. After - the \c extensionsInitialized method, a plugin should be fully initialized, set up + functions of all plugins in \e reverse order of the load queue. After + the \c extensionsInitialized function, a plugin should be fully initialized, set up and running. A plugin can assume that plugins that depend on it are fully set up, and can finish the initialization of parts that can be extended by other plugins. For example, the \c Core plugin assumes that all plugins have registered @@ -97,10 +97,10 @@ and afterwards \l{Core::ICore::coreOpened()}{coreOpened()}. After startup, when the event loop of \QC is running, the plugin manager calls - the \l{ExtensionSystem::IPlugin::delayedInitialize()}{delayedInitialize()} methods of all + the \l{ExtensionSystem::IPlugin::delayedInitialize()}{delayedInitialize()} functions of all plugins in \e reverse order of the load queue. The calls are done on the main thread, but separated by a delay of a few milliseconds to ensure responsiveness of \QC. - In the \c delayedInitialize method, a plugin can perform non-critical initialization + In the \c delayedInitialize function, a plugin can perform non-critical initialization that could unnecessarily delay showing the \QC UI if done during startup. After all delayed initializations are done the \l{ExtensionSystem::PluginManager}{PluginManager} @@ -111,14 +111,14 @@ plugin manager starts its shutdown sequence: \list 1 - \li Calls the \l{ExtensionSystem::IPlugin::aboutToShutdown()}{aboutToShutdown()} methods of + \li Calls the \l{ExtensionSystem::IPlugin::aboutToShutdown()}{aboutToShutdown()} functions of all plugins in the order of the load queue. Plugins should perform measures for speeding up the actual shutdown here, like disconnecting signals that would otherwise needlessly be called. If a plugin needs to delay the real shutdown for a while, for example if it needs to wait for external processes to finish for a clean shutdown, the plugin can return \l{ExtensionSystem::IPlugin::AsynchronousShutdown} from this - method. This will make the plugin manager wait with the next step, and keep the main + function. This will make the plugin manager wait with the next step, and keep the main event loop running, until all plugins requesting AsynchronousShutdown have sent the asynchronousShutdownFinished() signal. diff --git a/doc/api/plugin-specifications.qdoc b/doc/api/plugin-specifications.qdoc index acbeca5569..a56bf93b4c 100644 --- a/doc/api/plugin-specifications.qdoc +++ b/doc/api/plugin-specifications.qdoc @@ -199,7 +199,7 @@ \l{The Plugin Manager, the Object Pool, and Registered Objects}{global object pool} via ExtensionSystem::PluginManager::getObjectByName() or ExtensionSystem::PluginManager::getObjectByClassName(), and use QMetaObject functions to call - methods on it. + functions on it. \section2 Command Line Arguments @@ -210,7 +210,7 @@ line parsing and sanity checks based on that information. If the plugin manager finds matching command line arguments for a plugin, it passes them on to the plugin's - \l{ExtensionSystem::IPlugin::initialize()}{initialize()} method. + \l{ExtensionSystem::IPlugin::initialize()}{initialize()} function. All command line argument definitions are enclosed by a single \c argumentList tag. The individual command line arguments are defined by the \c argument tag, diff --git a/doc/api/pluginmanager.qdoc b/doc/api/pluginmanager.qdoc index b74d1210be..e221f90d64 100644 --- a/doc/api/pluginmanager.qdoc +++ b/doc/api/pluginmanager.qdoc @@ -38,13 +38,13 @@ and retrieved depending on different criteria. Most interaction of plugins with the plugin manager should be done through the - ExtensionSystem::IPlugin interface, but the following tables summarize some methods + ExtensionSystem::IPlugin interface, but the following tables summarize some functions and signals that can be useful for plugins. See the ExtensionSystem::PluginManager reference documentation for the complete list. \table \header - \li Method + \li Function \li Description \row \li instance() @@ -97,9 +97,9 @@ All objects of a specified type can be retrieved from the object pool via the \l{ExtensionSystem::PluginManager::getObjects()}{getObjects()} and - \l{ExtensionSystem::PluginManager::getObject()}{getObject()} methods. - They are aware of Aggregation::Aggregate, so these methods use the Aggregation::query() methods - instead of qobject_cast to determine the matching objects. + \l{ExtensionSystem::PluginManager::getObject()}{getObject()} functions. + They are aware of Aggregation::Aggregate, so these functions use the Aggregation::query() + functions instead of qobject_cast to determine the matching objects. It is also possible to retrieve an object with a specific object name with \l{ExtensionSystem::PluginManager::getObjectByName()}{getObjectByName()} diff --git a/doc/api/qtcreator-dev-wizards.qdoc b/doc/api/qtcreator-dev-wizards.qdoc index ca31a35104..08c33e6edd 100644 --- a/doc/api/qtcreator-dev-wizards.qdoc +++ b/doc/api/qtcreator-dev-wizards.qdoc @@ -240,7 +240,7 @@ The complete code of \c webpagewizard.cpp looks as follows: \snippet webpagewizard/webpagewizard.cpp 0 - The registration of the wizard in the \c initialize() method + The registration of the wizard in the \c initialize() function of a plugin looks like: \snippet webpagewizard/webpagewizardplugin.cpp 0 */ diff --git a/doc/src/debugger/creator-debugger.qdoc b/doc/src/debugger/creator-debugger.qdoc index a9636f6c5f..ee81898c39 100644 --- a/doc/src/debugger/creator-debugger.qdoc +++ b/doc/src/debugger/creator-debugger.qdoc @@ -1011,7 +1011,7 @@ easier to employ the Dumper Python class for that purpose. The Dumper Python class contains a complete framework to take care of the \c iname and \c addr fields, to handle children of simple types, references, pointers, - enums, known and unknown structs as well as some convenience methods to + enums, known and unknown structs as well as some convenience functions to handle common situations. The member functions of the \gui{Dumper} class are the following: @@ -1021,7 +1021,7 @@ \li \gui{__init__(self)} - Initializes the output to an empty string and empties the child stack. This should not be used in user code. - \li \gui{put(self, value)} - Low level method to directly append to the + \li \gui{put(self, value)} - Low level function to directly append to the output string. That is also the fastest way to append output. \li \gui{putField(self, name, value)} - Appends a name='value' field. diff --git a/doc/src/editors/creator-coding-edit-mode.qdoc b/doc/src/editors/creator-coding-edit-mode.qdoc index dac877fc12..6ba0eccb44 100644 --- a/doc/src/editors/creator-coding-edit-mode.qdoc +++ b/doc/src/editors/creator-coding-edit-mode.qdoc @@ -151,13 +151,13 @@ You can also select the symbol and press \key F2, or right-click the symbol and select \gui {Follow Symbol Under Cursor} to move to its definition or - declaration. This feature is supported for namespaces, classes, methods, + declaration. This feature is supported for namespaces, classes, functions, variables, include statements, and macros. - To switch between the definition and declaration of a method, place the + To switch between the definition and declaration of a function, place the cursor on either and press \key {Shift+F2} or right-click and select \gui - {Switch Between Method Declaration/Definition}. For example, this allows - you to navigate from anywhere within a method body directly to the method + {Switch Between Function Declaration/Definition}. For example, this allows + you to navigate from anywhere within a function body directly to the function declaration. Links are opened in the same split by default. To open links in the next diff --git a/doc/src/editors/creator-coding.qdoc b/doc/src/editors/creator-coding.qdoc index 60c4541b68..7a2e3aa697 100644 --- a/doc/src/editors/creator-coding.qdoc +++ b/doc/src/editors/creator-coding.qdoc @@ -45,7 +45,7 @@ Use the incremental and advanced search to search from currently open projects or files on the file system or use the locator to - browse through projects, files, classes, methods, documentation and + browse through projects, files, classes, functions, documentation and file systems. \li \l{Refactoring} diff --git a/doc/src/editors/creator-editors.qdoc b/doc/src/editors/creator-editors.qdoc index 01d4c821e4..46fc117eef 100644 --- a/doc/src/editors/creator-editors.qdoc +++ b/doc/src/editors/creator-editors.qdoc @@ -43,7 +43,7 @@ \li Class fields - \li Virtual methods + \li Virtual functions \endlist @@ -1062,9 +1062,9 @@ \li Interpret the \key Tab and \key Backspace key presses. - \li Indent the contents of classes, methods, blocks, and namespaces. + \li Indent the contents of classes, functions, blocks, and namespaces. - \li Indent braces in classes, namespaces, enums, methods, and blocks. + \li Indent braces in classes, namespaces, enums, functions, and blocks. \li Control switch statements and their contents. @@ -1178,14 +1178,14 @@ You can indent public, protected, and private statements and declarations related to them within classes. - You can also indent statements within methods and blocks and declarations + You can also indent statements within functions and blocks and declarations within namespaces. \image qtcreator-code-style-content.png "Content options" \section1 Specifying Settings for Braces - You can indent class, namespace, enum and method declarations and code + You can indent class, namespace, enum and function declarations and code blocks. \image qtcreator-code-style-braces.png "Braces options" @@ -1422,7 +1422,7 @@ \endlist \note You can also select \gui{Edit > Find/Replace > Advanced Find > - C++ Symbols} to search for classes, methods, enums, and declarations + C++ Symbols} to search for classes, functions, enums, and declarations either from files listed as part of the project or from all files that are used by the code, such as include files. @@ -1523,7 +1523,7 @@ \li Create variable declarations - \li Create method declarations and definitions + \li Create function declarations and definitions \endlist @@ -1817,21 +1817,21 @@ } \endcode - \li Method name + \li Function name \row \li Add 'Function' Declaration \li Inserts the member function declaration that matches the member function definition into the class declaration. The function can be public, protected, private, public slot, protected slot, or private slot. - \li Method name + \li Function name \row \li Switch with Next/Previous Parameter \li Moves a parameter down or up one position in a parameter list. - \li Parameter in the declaration or definition of a function or method + \li Parameter in the declaration or definition of a function \row - \li Extract Method - \li Moves the selected code to a new method and replaces the block of - code with a call to the new method. Enter a name for the method in + \li Extract Function + \li Moves the selected code to a new function and replaces the block of + code with a call to the new function. Enter a name for the function in the \gui {Extract Function Refactoring} dialog. \li Block of code selected \row @@ -1875,8 +1875,8 @@ \li Generate Missing Q_PROPERTY Members \li Adds missing members to a Q_PROPERTY: \list - \li \c read method - \li \c write method, if there is a WRITE + \li \c read function + \li \c write function, if there is a WRITE \li \c {onChanged} signal, if there is a NOTIFY \li data member with the name \c {m_<propertyName>} \endlist @@ -2187,7 +2187,7 @@ \endlist Filters locating files also accept paths, such as \c {tools/*main.cpp}. - Filters locating class and method definitions also accept namespaces, + Filters locating class and function definitions also accept namespaces, such as \c {Utils::*View}. By default, the following filters are enabled and you do not need to use diff --git a/doc/src/editors/creator-finding.qdoc b/doc/src/editors/creator-finding.qdoc index d2e0b27883..7c7297982a 100644 --- a/doc/src/editors/creator-finding.qdoc +++ b/doc/src/editors/creator-finding.qdoc @@ -45,7 +45,7 @@ \li \l{Searching with the Locator} The locator provides one of the easiest ways in \QC to browse - through projects, files, classes, methods, documentation and + through projects, files, classes, functions, documentation and file systems. \endlist diff --git a/doc/src/howto/creator-keyboard-shortcuts.qdoc b/doc/src/howto/creator-keyboard-shortcuts.qdoc index a428373e85..b01fa6bbe8 100644 --- a/doc/src/howto/creator-keyboard-shortcuts.qdoc +++ b/doc/src/howto/creator-keyboard-shortcuts.qdoc @@ -391,14 +391,14 @@ \row \li Follow symbol under cursor - Works with namespaces, classes, methods, variables, include + Works with namespaces, classes, functions, variables, include statements and macros \li F2 \row \li Rename symbol under cursor \li Ctrl+Shift+R \row - \li Switch between method declaration and definition + \li Switch between function declaration and definition \li Shift+F2 \row \li Open type hierarchy diff --git a/doc/src/howto/creator-tips.qdoc b/doc/src/howto/creator-tips.qdoc index 781cf1a2a8..421b9414e6 100644 --- a/doc/src/howto/creator-tips.qdoc +++ b/doc/src/howto/creator-tips.qdoc @@ -212,7 +212,7 @@ \section1 Locating Files The \gui Locator provides one of the easiest ways in \QC to browse - through projects, files, classes, methods, documentation and file systems. + through projects, files, classes, functions, documentation and file systems. To quickly access files not directly mentioned in your project, you can create your own locator filters. That way you can locate files in a directory structure you have defined. diff --git a/doc/src/howto/creator-ui.qdoc b/doc/src/howto/creator-ui.qdoc index 880de704db..07bbce7ab2 100644 --- a/doc/src/howto/creator-ui.qdoc +++ b/doc/src/howto/creator-ui.qdoc @@ -56,7 +56,7 @@ output panes (7). You can use the locator (6) to to browse through projects, files, classes, - methods, documentation, and file systems. + functions, documentation, and file systems. \section1 Modes diff --git a/doc/src/howto/qtcreator-faq.qdoc b/doc/src/howto/qtcreator-faq.qdoc index 77b500343e..965650ad66 100644 --- a/doc/src/howto/qtcreator-faq.qdoc +++ b/doc/src/howto/qtcreator-faq.qdoc @@ -281,17 +281,17 @@ The locator can be used to open files, but opening files is also just a step on the way to accomplish a task. For example, consider the following - use case: \e {Fix AMethod in SomeClass which comes from + use case: \e {Fix AFunction in SomeClass which comes from someclass.cpp/someclass.h}. With a tabbed user interface, developers would search for someclass.cpp in - the tab bar, and then search for \c {::AMethod}, only to find out that the - method is not located in that file. They would then search for someclass.h + the tab bar, and then search for \c {::AFunction}, only to find out that the + function is not located in that file. They would then search for someclass.h in the tab bar, find our that the function is inline, fix the problem, and forget where they came from. - With \QC, developers can type \c {Ctrl+K m AMet} to find the method. - Typically, they only need to type 3 to 4 characters of the method name. + With \QC, developers can type \c {Ctrl+K m AFun} to find the function. + Typically, they only need to type 3 to 4 characters of the function name. They can then fix the problem and press \key Alt+Back to go back to where they were. diff --git a/doc/src/qtcreator.qdoc b/doc/src/qtcreator.qdoc index 86815fdf85..b313baf325 100644 --- a/doc/src/qtcreator.qdoc +++ b/doc/src/qtcreator.qdoc @@ -41,8 +41,7 @@ \li \inlineimage creator_managingprojects.png \li \inlineimage creator_designinguserinterface.png \row - \li \list - \li \b {\l{Getting Started}} + \li \b {\l{Getting Started}} \list \li \l{IDE Overview} \li \l{User Interface} @@ -50,68 +49,54 @@ \li \l{Building and Running an Example} \li \l{Tutorials} \endlist - \endlist - \li \list - \li \b {\l{Managing Projects}} + \li \b {\l{Managing Projects}} \list \li \l{Creating Projects} \li \l{Using Version Control Systems} \li \l{Configuring Projects} \li \l{Managing Sessions} \endlist - \endlist - \li \list \li \b {\l{Designing User Interfaces}} \list \li \l{Developing Qt Quick Applications} \li \l{Developing Widget Based Applications} \li \l{Optimizing Applications for Mobile Devices} \endlist - \endlist \row \li \inlineimage creator_coding.png \li \inlineimage creator_buildingrunning.png \li \inlineimage creator_testing.png \row - \li \list \li \b {\l{Coding}} \list \li \l{Writing Code} \li \l{Finding} \li \l{Refactoring} \li \l{Configuring the Editor} - \endlist \endlist - \li \list \li \b {\l{Building and Running}} \list \li \l{Building for Multiple Platforms} \li \l{Running on Multiple Platforms} \li \l{Deploying to Mobile Devices} \li \l{Connecting Mobile Devices} - \endlist \endlist - \li \list \li \b {\l{Debugging and Analyzing}} \list \li \l{Debugging} \li \l{Analyzing Code} \endlist - \endlist \row \li \inlineimage creator_publishing.png \li \inlineimage creator_advanceduse.png \li \inlineimage creator_gettinghelp.png \row - \li \list \li \b {\l{Publishing}} \list \li \l{Publishing Qt Content for MeeGo Harmattan Devices} \li \l{Publishing Qt Content for Maemo Devices} \li \l{Publishing Maemo Applications to Extras-devel} \endlist - \endlist - \li \list \li \b {\l{Advanced Use}} \list \li \l{Supported Platforms} @@ -120,8 +105,6 @@ \li \l{Keyboard Shortcuts} \li \l{Using External Tools} \endlist - \endlist - \li \list \li \b {\l{Getting Help}} \list \li \l{Using the Help Mode} @@ -130,7 +113,6 @@ \li \l{Known Issues} \li \l{Glossary} \endlist - \endlist \row \li {3,1} \note To report bugs and suggestions to the Qt Bug Tracker, select \gui {Help > Report Bug}. diff --git a/qbs/imports/QtcTool.qbs b/qbs/imports/QtcTool.qbs index 5494d0dc5d..f24edbc815 100644 --- a/qbs/imports/QtcTool.qbs +++ b/qbs/imports/QtcTool.qbs @@ -11,6 +11,10 @@ Application { property string toolInstallDir: project.ide_libexec_path + cpp.rpaths: qbs.targetOS.contains("osx") + ? ["@executable_path/../" + project.ide_library_path] + : ["$ORIGIN/../" + project.ide_library_path] + Group { fileTagsFilter: product.type qbs.install: true diff --git a/share/qtcreator/debugger/boosttypes.py b/share/qtcreator/debugger/boosttypes.py new file mode 100644 index 0000000000..7720f8401d --- /dev/null +++ b/share/qtcreator/debugger/boosttypes.py @@ -0,0 +1,109 @@ +############################################################################ +# +# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +# Contact: http://www.qt-project.org/legal +# +# This file is part of Qt Creator. +# +# Commercial License Usage +# Licensees holding valid commercial Qt licenses may use this file in +# accordance with the commercial license agreement provided with the +# Software or, alternatively, in accordance with the terms contained in +# a written agreement between you and Digia. For licensing terms and +# conditions see http://qt.digia.com/licensing. For further information +# use the contact form at http://qt.digia.com/contact-us. +# +# GNU Lesser General Public License Usage +# Alternatively, this file may be used under the terms of the GNU Lesser +# General Public License version 2.1 as published by the Free Software +# Foundation and appearing in the file LICENSE.LGPL included in the +# packaging of this file. Please review the following information to +# ensure the GNU Lesser General Public License version 2.1 requirements +# will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +# +# In addition, as a special exception, Digia gives you certain additional +# rights. These rights are described in the Digia Qt LGPL Exception +# version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +# +############################################################################# + +from dumper import * + +def qdump__boost__bimaps__bimap(d, value): + #leftType = d.templateArgument(value.type, 0) + #rightType = d.templateArgument(value.type, 1) + size = int(value["core"]["node_count"]) + d.putItemCount(size) + d.putNumChild(size) + if d.isExpanded(): + d.putPlainChildren(value) + + +def qdump__boost__optional(d, value): + if int(value["m_initialized"]) == 0: + d.putValue("<uninitialized>") + d.putNumChild(0) + else: + type = d.templateArgument(value.type, 0) + storage = value["m_storage"] + if d.isReferenceType(type): + d.putItem(storage.cast(type.target().pointer()).dereference()) + else: + d.putItem(storage.cast(type)) + d.putBetterType(value.type) + + +def qdump__boost__shared_ptr(d, value): + # s boost::shared_ptr<int> + # pn boost::detail::shared_count + # pi_ 0x0 boost::detail::sp_counted_base * + # px 0x0 int * + if d.isNull(value["pn"]["pi_"]): + d.putValue("(null)") + d.putNumChild(0) + return + + if d.isNull(value["px"]): + d.putValue("(null)") + d.putNumChild(0) + return + + countedbase = value["pn"]["pi_"].dereference() + weakcount = int(countedbase["weak_count_"]) + usecount = int(countedbase["use_count_"]) + d.check(weakcount >= 0) + d.check(weakcount <= int(usecount)) + d.check(usecount <= 10*1000*1000) + + val = value["px"].dereference() + if d.isSimpleType(val.type): + d.putNumChild(3) + d.putItem(val) + d.putBetterType(value.type) + else: + d.putEmptyValue() + + d.putNumChild(3) + if d.isExpanded(): + with Children(d, 3): + d.putSubItem("data", val) + d.putIntItem("weakcount", weakcount) + d.putIntItem("usecount", usecount) + + +def qdump__boost__gregorian__date(d, value): + d.putValue(int(value["days_"]), JulianDate) + d.putNumChild(0) + + +def qdump__boost__posix_time__ptime(d, item): + ms = int(item["time_"]["time_count_"]["value_"]) / 1000 + d.putValue("%s/%s" % divmod(ms, 86400000), JulianDateAndMillisecondsSinceMidnight) + d.putNumChild(0) + + +def qdump__boost__posix_time__time_duration(d, item): + d.putValue(int(item["ticks_"]["value_"]) / 1000, MillisecondsSinceMidnight) + d.putNumChild(0) + + diff --git a/share/qtcreator/debugger/creatortypes.py b/share/qtcreator/debugger/creatortypes.py new file mode 100644 index 0000000000..2b25e2240f --- /dev/null +++ b/share/qtcreator/debugger/creatortypes.py @@ -0,0 +1,127 @@ +############################################################################ +# +# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +# Contact: http://www.qt-project.org/legal +# +# This file is part of Qt Creator. +# +# Commercial License Usage +# Licensees holding valid commercial Qt licenses may use this file in +# accordance with the commercial license agreement provided with the +# Software or, alternatively, in accordance with the terms contained in +# a written agreement between you and Digia. For licensing terms and +# conditions see http://qt.digia.com/licensing. For further information +# use the contact form at http://qt.digia.com/contact-us. +# +# GNU Lesser General Public License Usage +# Alternatively, this file may be used under the terms of the GNU Lesser +# General Public License version 2.1 as published by the Free Software +# Foundation and appearing in the file LICENSE.LGPL included in the +# packaging of this file. Please review the following information to +# ensure the GNU Lesser General Public License version 2.1 requirements +# will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +# +# In addition, as a special exception, Digia gives you certain additional +# rights. These rights are described in the Digia Qt LGPL Exception +# version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +# +############################################################################# + +from dumper import * + +def qdump__Core__Id(d, value): + try: + name = parseAndEvaluate("Core::nameForId(%d)" % value["m_id"]) + d.putValue(encodeCharArray(name), Hex2EncodedLatin1) + d.putPlainChildren(value) + except: + d.putValue(value["m_id"]) + d.putNumChild(0) + +def qdump__Debugger__Internal__GdbMi(d, value): + str = d.encodeByteArray(value["m_name"]) + "3a20" \ + + d.encodeByteArray(value["m_data"]) + d.putValue(str, Hex2EncodedLatin1) + d.putPlainChildren(value) + +def qdump__Debugger__Internal__WatchData(d, value): + d.putByteArrayValue(value["iname"]) + d.putPlainChildren(value) + +def qdump__Debugger__Internal__WatchItem(d, value): + d.putByteArrayValue(value["iname"]) + d.putPlainChildren(value) + +def qdump__Debugger__Internal__BreakpointModelId(d, value): + d.putValue("%s.%s" % (value["m_majorPart"], value["m_minorPart"])) + d.putPlainChildren(value) + +def qdump__CPlusPlus__ByteArrayRef(d, value): + d.putValue(encodeCharArray(value["m_start"], 100, value["m_length"]), + Hex2EncodedLatin1) + d.putPlainChildren(value) + +def qdump__CPlusPlus__Identifier(d, value): + d.putValue(encodeCharArray(value["_chars"]), Hex2EncodedLatin1) + d.putPlainChildren(value) + +def qdump__CPlusPlus__IntegerType(d, value): + d.putValue(value["_kind"]) + d.putPlainChildren(value) + +def qdump__CPlusPlus__NamedType(d, value): + literal = downcast(value["_name"]) + d.putValue(encodeCharArray(literal["_chars"]), Hex2EncodedLatin1) + d.putPlainChildren(value) + +def qdump__CPlusPlus__TemplateNameId(d, value): + s = encodeCharArray(value["_identifier"]["_chars"]) + d.putValue(s + "3c2e2e2e3e", Hex2EncodedLatin1) + d.putPlainChildren(value) + +def qdump__CPlusPlus__Literal(d, value): + d.putValue(encodeCharArray(value["_chars"]), Hex2EncodedLatin1) + d.putPlainChildren(value) + +def qdump__CPlusPlus__StringLiteral(d, value): + d.putValue(encodeCharArray(value["_chars"]), Hex2EncodedLatin1) + d.putPlainChildren(value) + +def qdump__CPlusPlus__Internal__Value(d, value): + d.putValue(value["l"]) + d.putPlainChildren(value) + +def qdump__Utils__FileName(d, value): + d.putStringValue(value) + d.putPlainChildren(value) + +def qdump__Utils__ElfSection(d, value): + d.putByteArrayValue(value["name"]) + d.putPlainChildren(value) + +def qdump__CPlusPlus__Token(d, value): + k = int(value["f"]["kind"]) + if int(k) == 6: + d.putValue("T_IDENTIFIER. offset: %d, len: %d" + % (value["offset"], value["f"]["length"])) + elif int(k) == 7: + d.putValue("T_NUMERIC_LITERAL. offset: %d, value: %d" + % (value["offset"], value["f"]["length"])) + elif int(k) == 60: + d.putValue("T_RPAREN") + else: + d.putValue("Type: %s" % k) + d.putPlainChildren(value) + +def qdump__CPlusPlus__Internal__PPToken(d, value): + k = value["f"]["kind"]; + data, size, alloc = d.byteArrayData(value["m_src"]) + length = int(value["f"]["length"]) + offset = int(value["offset"]) + #warn("size: %s, alloc: %s, offset: %s, length: %s, data: %s" + # % (size, alloc, offset, length, data)) + d.putValue(d.readMemory(data + offset, min(100, length)), + Hex2EncodedLatin1) + d.putPlainChildren(value) + + diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 09f22cd0bb..91d565b28b 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -294,6 +294,10 @@ class DumperBase: size = self.extractInt(addr + 4) alloc = self.extractInt(addr + 8) & 0x7ffffff data = addr + self.dereference(addr + 8 + self.ptrSize()) + if self.ptrSize() == 4: + data = data & 0xffffffff + else: + data = data & 0xffffffffffffffff else: # Data: # - QBasicAtomicInt ref; diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index f8b0eb3ab9..837a276e9c 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -23,6 +23,10 @@ def warn(message): from dumper import * from qttypes import * +from stdtypes import * +from misctypes import * +from boosttypes import * + ####################################################################### # @@ -229,7 +233,6 @@ NamespaceCode = gdb.TYPE_CODE_NAMESPACE #Code = gdb.TYPE_CODE_DECFLOAT # Decimal floating point. #Code = gdb.TYPE_CODE_MODULE # Fortran #Code = gdb.TYPE_CODE_INTERNAL_FUNCTION -SimpleValueCode = -1 ####################################################################### @@ -1436,8 +1439,7 @@ class Dumper(DumperBase): or code == CharCode \ or code == IntCode \ or code == FloatCode \ - or code == EnumCode \ - or code == SimpleValueCode + or code == EnumCode def simpleEncoding(self, typeobj): code = typeobj.code @@ -1470,13 +1472,14 @@ class Dumper(DumperBase): return None def tryPutArrayContents(self, typeobj, base, n): - if not self.isSimpleType(typeobj): + enc = self.simpleEncoding(typeobj) + if not enc: return False size = n * typeobj.sizeof; self.put('childtype="%s",' % typeobj) self.put('addrbase="0x%x",' % toInteger(base)) self.put('addrstep="0x%x",' % toInteger(typeobj.sizeof)) - self.put('arrayencoding="%s",' % self.simpleEncoding(typeobj)) + self.put('arrayencoding="%s",' % enc) self.put('arraydata="') self.put(self.readMemory(base, size)) self.put('",') @@ -1631,7 +1634,7 @@ class Dumper(DumperBase): self.putNumChild(0) return - if type.code == IntCode or type.code == CharCode or type.code == SimpleValueCode: + if type.code == IntCode or type.code == CharCode: self.putType(typeName) if value.is_optimized_out: self.putValue("<optimized out>") @@ -1737,7 +1740,7 @@ class Dumper(DumperBase): if format == None and innerTypeName == "char": # Use Latin1 as default for char *. self.putType(typeName) - self.putValue(encodeCharArray(value), Hex2EncodedLatin1) + self.putValue(self.encodeCharArray(value), Hex2EncodedLatin1) self.putNumChild(0) return @@ -1755,35 +1758,35 @@ class Dumper(DumperBase): if format == 1: # Explicitly requested Latin1 formatting. self.putType(typeName) - self.putValue(encodeCharArray(value), Hex2EncodedLatin1) + self.putValue(self.encodeCharArray(value), Hex2EncodedLatin1) self.putNumChild(0) return if format == 2: # Explicitly requested UTF-8 formatting. self.putType(typeName) - self.putValue(encodeCharArray(value), Hex2EncodedUtf8) + self.putValue(self.encodeCharArray(value), Hex2EncodedUtf8) self.putNumChild(0) return if format == 3: # Explicitly requested local 8 bit formatting. self.putType(typeName) - self.putValue(encodeCharArray(value), Hex2EncodedLocal8Bit) + self.putValue(self.encodeCharArray(value), Hex2EncodedLocal8Bit) self.putNumChild(0) return if format == 4: # Explicitly requested UTF-16 formatting. self.putType(typeName) - self.putValue(encodeChar2Array(value), Hex4EncodedLittleEndian) + self.putValue(self.encodeChar2Array(value), Hex4EncodedLittleEndian) self.putNumChild(0) return if format == 5: # Explicitly requested UCS-4 formatting. self.putType(typeName) - self.putValue(encodeChar4Array(value), Hex8EncodedLittleEndian) + self.putValue(self.encodeChar4Array(value), Hex8EncodedLittleEndian) self.putNumChild(0) return diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index 0b1e5ec512..5c52241bdc 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -41,6 +41,9 @@ sys.path.insert(1, currentDir) from dumper import * from qttypes import * +from stdtypes import * +from misctypes import * +from boosttypes import * diff --git a/share/qtcreator/debugger/misctypes.py b/share/qtcreator/debugger/misctypes.py new file mode 100644 index 0000000000..11515d9dd8 --- /dev/null +++ b/share/qtcreator/debugger/misctypes.py @@ -0,0 +1,316 @@ +############################################################################ +# +# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +# Contact: http://www.qt-project.org/legal +# +# This file is part of Qt Creator. +# +# Commercial License Usage +# Licensees holding valid commercial Qt licenses may use this file in +# accordance with the commercial license agreement provided with the +# Software or, alternatively, in accordance with the terms contained in +# a written agreement between you and Digia. For licensing terms and +# conditions see http://qt.digia.com/licensing. For further information +# use the contact form at http://qt.digia.com/contact-us. +# +# GNU Lesser General Public License Usage +# Alternatively, this file may be used under the terms of the GNU Lesser +# General Public License version 2.1 as published by the Free Software +# Foundation and appearing in the file LICENSE.LGPL included in the +# packaging of this file. Please review the following information to +# ensure the GNU Lesser General Public License version 2.1 requirements +# will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +# +# In addition, as a special exception, Digia gives you certain additional +# rights. These rights are described in the Digia Qt LGPL Exception +# version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +# +############################################################################# + +from dumper import * + +####################################################################### +# +# SSE +# +####################################################################### + +def qform____m128(): + return "As Floats,As Doubles" + +def qdump____m128(d, value): + d.putEmptyValue() + d.putNumChild(1) + if d.isExpanded(): + format = d.currentItemFormat() + if format == 2: # As Double + d.putArrayData(d.lookupType("double"), value.address, 2) + else: # Default, As float + d.putArrayData(d.lookupType("float"), value.address, 4) + + +####################################################################### +# +# Eigen +# +####################################################################### + +#def qform__Eigen__Matrix(): +# return "Transposed" + +def qdump__Eigen__Matrix(d, value): + innerType = d.templateArgument(value.type, 0) + storage = value["m_storage"] + options = d.numericTemplateArgument(value.type, 3) + rowMajor = (int(options) & 0x1) + argRow = d.numericTemplateArgument(value.type, 1) + argCol = d.numericTemplateArgument(value.type, 2) + nrows = value["m_storage"]["m_rows"] if argRow == -1 else int(argRow) + ncols = value["m_storage"]["m_cols"] if argCol == -1 else int(argCol) + p = storage["m_data"] + if d.isStructType(p.type): # Static + p = p["array"].cast(innerType.pointer()) + d.putValue("(%s x %s), %s" % (nrows, ncols, ["ColumnMajor", "RowMajor"][rowMajor])) + d.putField("keeporder", "1") + d.putNumChild(nrows * ncols) + + limit = 10000 + nncols = min(ncols, limit) + nnrows = min(nrows, limit * limit / nncols) + if d.isExpanded(): + #format = d.currentItemFormat() # format == 1 is "Transposed" + with Children(d, nrows * ncols, childType=innerType): + if ncols == 1 or nrows == 1: + for i in range(0, min(nrows * ncols, 10000)): + d.putSubItem(i, (p + i).dereference()) + elif rowMajor == 1: + s = 0 + for i in range(0, nnrows): + for j in range(0, nncols): + v = (p + i * ncols + j).dereference() + d.putNamedSubItem(s, v, "[%d,%d]" % (i, j)) + s = s + 1 + else: + s = 0 + for j in range(0, nncols): + for i in range(0, nnrows): + v = (p + i + j * nrows).dereference() + d.putNamedSubItem(s, v, "[%d,%d]" % (i, j)) + s = s + 1 + + +####################################################################### +# +# D +# +####################################################################### + +def cleanDType(type): + return d.stripClassTag(str(type)).replace("uns long long", "string") + +def qdump_Array(d, value): + n = value["length"] + p = value["ptr"] + t = cleanDType(value.type)[7:] + d.putType("%s[%d]" % (t, n)) + if t == "char": + d.putValue(encodeCharArray(p, 100), Hex2EncodedLocal8Bit) + d.putNumChild(0) + else: + d.putEmptyValue() + d.putNumChild(n) + innerType = p.type + if d.isExpanded(): + with Children(d, n, childType=innerType): + for i in range(0, n): + d.putSubItem(i, p.dereference()) + p = p + 1 + + +def qdump_AArray(d, value): + #n = value["length"] + # This ends up as _AArray_<key>_<value> with a single .ptr + # member of type void *. Not much that can be done here. + p = value["ptr"] + t = cleanDType(value.type)[8:] + d.putType("%s]" % t.replace("_", "[")) + d.putEmptyValue() + d.putNumChild(1) + if d.isExpanded(): + with Children(d, 1): + d.putSubItem("ptr", p) + + +####################################################################### +# +# Display Test +# +####################################################################### + +if False: + + # FIXME: Make that work + def qdump__Color(d, value): + v = value + d.putValue("(%s, %s, %s; %s)" % (v["r"], v["g"], v["b"], v["a"])) + d.putPlainChildren(value) + + def qdump__Color_(d, value): + v = value + d.putValue("(%s, %s, %s; %s)" % (v["r"], v["g"], v["b"], v["a"])) + if d.isExpanded(): + with Children(d): + with SubItem(d, "0"): + d.putItem(v["r"]) + with SubItem(d, "1"): + d.putItem(v["g"]) + with SubItem(d, "2"): + d.putItem(v["b"]) + with SubItem(d, "3"): + d.putItem(v["a"]) + + +if False: + + def qform__basic__Function(): + return "Normal,Displayed" + + def qdump__basic__Function(d, value): + min = value["min"] + max = value["max"] + data, size, alloc = d.byteArrayData(value["var"]) + var = extractCString(data, 0) + data, size, alloc = d.byteArrayData(value["f"]) + f = extractCString(data, 0) + d.putValue("%s, %s=%f..%f" % (f, var, min, max)) + d.putNumChild(0) + format = d.currentItemFormat() + if format == 1: + d.putDisplay(StopDisplay) + elif format == 2: + input = "plot [%s=%f:%f] %s" % (var, min, max, f) + d.putDisplay(DisplayProcess, input, "gnuplot") + + +if False: + + def qdump__tree_entry(d, value): + d.putValue("len: %s, offset: %s, type: %s" % + (value["blocklength"], value["offset"], value["type"])) + d.putNumChild(0) + + def qdump__tree(d, value): + count = value["count"] + entries = value["entries"] + base = value["base"].cast(d.charPtrType()) + d.putItemCount(count) + d.putNumChild(count) + if d.isExpanded(): + with Children(d): + with SubItem(d, "tree"): + d.putEmptyValue() + d.putNoType() + d.putNumChild(1) + if d.isExpanded(): + with Children(d): + for i in xrange(count): + d.putSubItem(Item(entries[i], iname)) + with SubItem(d, "data"): + d.putEmptyValue() + d.putNoType() + d.putNumChild(1) + if d.isExpanded(): + with Children(d): + for i in xrange(count): + with SubItem(d, i): + entry = entries[i] + mpitype = str(entry["type"]) + d.putType(mpitype) + length = int(entry["blocklength"]) + offset = int(entry["offset"]) + d.putValue("%s items at %s" % (length, offset)) + if mpitype == "MPI_INT": + innerType = "int" + elif mpitype == "MPI_CHAR": + innerType = "char" + elif mpitype == "MPI_DOUBLE": + innerType = "double" + else: + length = 0 + d.putNumChild(length) + if d.isExpanded(): + with Children(d): + t = d.lookupType(innerType).pointer() + p = (base + offset).cast(t) + for j in range(length): + d.putSubItem(j, p.dereference()) + + #struct KRBase + #{ + # enum Type { TYPE_A, TYPE_B } type; + # KRBase(Type _type) : type(_type) {} + #}; + # + #struct KRA : KRBase { int x; int y; KRA():KRBase(TYPE_A),x(1),y(32) {} }; + #struct KRB : KRBase { KRB():KRBase(TYPE_B) {} }; + # + #void testKR() + #{ + # KRBase *ptr1 = new KRA; + # KRBase *ptr2 = new KRB; + # ptr2 = new KRB; + #} + + def qdump__KRBase(d, value): + if getattr(value, "__nested__", None) is None: + base = ["KRA", "KRB"][int(value["type"])] + nest = value.cast(d.lookupType(base)) + nest.__nested__ = True + warn("NEST %s " % dir(nest)) + d.putItem(nest) + else: + d.putName("type") + d.putValue(value["type"]) + d.putNoType() + + + +if False: + def qdump__bug5106__A5106(d, value): + d.putName("a") + d.putValue("This is the value: %s" % value["m_a"]) + d.putNoType() + d.putNumChild(0) + + +if False: + def qdump__bug6933__Base(d, value): + d.putValue("foo") + d.putPlainChildren(value) + +if False: + def qdump__gdb13393__Base(d, value): + d.putValue("Base (%s)" % value["a"]) + d.putType(value.type) + d.putPlainChildren(value) + + def qdump__gdb13393__Derived(d, value): + d.putValue("Derived (%s, %s)" % (value["a"], value["b"])) + d.putType(value.type) + d.putPlainChildren(value) + + +def qdump__KDSoapValue1(d, value): + inner = value["d"]["d"].dereference() + d.putStringValue(inner["m_name"]) + if d.isExpanded(): + with Children(d): + d.putFields(inner) + +def qdump__KDSoapValue(d, value): + p = (value.cast(lookupType("char*")) + 4).dereference().cast(lookupType("QString")) + d.putStringValue(p) + if d.isExpanded(): + with Children(d): + data = value["d"]["d"].dereference() + d.putFields(data) diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index b4661a90ce..11ec7104ae 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -1,11 +1,32 @@ - -####################################################################### +############################################################################ # -# Dumper Implementations +# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +# Contact: http://www.qt-project.org/legal # -####################################################################### +# This file is part of Qt Creator. +# +# Commercial License Usage +# Licensees holding valid commercial Qt licenses may use this file in +# accordance with the commercial license agreement provided with the +# Software or, alternatively, in accordance with the terms contained in +# a written agreement between you and Digia. For licensing terms and +# conditions see http://qt.digia.com/licensing. For further information +# use the contact form at http://qt.digia.com/contact-us. +# +# GNU Lesser General Public License Usage +# Alternatively, this file may be used under the terms of the GNU Lesser +# General Public License version 2.1 as published by the Free Software +# Foundation and appearing in the file LICENSE.LGPL included in the +# packaging of this file. Please review the following information to +# ensure the GNU Lesser General Public License version 2.1 requirements +# will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +# +# In addition, as a special exception, Digia gives you certain additional +# rights. These rights are described in the Digia Qt LGPL Exception +# version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +# +############################################################################# -from __future__ import with_statement from dumper import * @@ -604,6 +625,9 @@ def qdump__QIPv6Address(d, value): qdump__Q_IPV6ADDR(d, value) +def qform__QList(): + return "Assume Direct Storage,Assume Indirect Storage" + def qdump__QList(d, value): dptr = d.childAt(value, 0)["d"] private = dptr.dereference() @@ -621,14 +645,20 @@ def qdump__QList(d, value): d.putNumChild(size) if d.isExpanded(): innerSize = innerType.sizeof + stepSize = dptr.type.sizeof + addr = d.addressOf(array) + begin * stepSize # The exact condition here is: # QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic # but this data is available neither in the compiled binary nor # in the frontend. # So as first approximation only do the 'isLarge' check: - stepSize = dptr.type.sizeof - isInternal = innerSize <= stepSize and d.isMovableType(innerType) - addr = d.addressOf(array) + begin * stepSize + format = d.currentItemFormat() + if format == 1: + isInternal = True + elif format == 2: + isInternal = False + else: + isInternal = innerSize <= stepSize and d.isMovableType(innerType) if isInternal: if innerSize == stepSize: p = d.createPointerValue(addr, innerType) @@ -1941,702 +1971,6 @@ def qdump__QxXmlAttributes(d, value): ####################################################################### # -# Standard Library dumper -# -####################################################################### - -def qdump____c_style_array__(d, value): - type = value.type.unqualified() - targetType = value[0].type - #d.putAddress(value.address) - d.putType(type) - d.putNumChild(1) - format = d.currentItemFormat() - isDefault = format == None and str(targetType.unqualified()) == "char" - if isDefault or format == 0 or format == 1 or format == 2: - blob = d.readMemory(value.address, type.sizeof) - - if isDefault: - # Use Latin1 as default for char []. - d.putValue(blob, Hex2EncodedLatin1) - elif format == 0: - # Explicitly requested Latin1 formatting. - d.putValue(blob, Hex2EncodedLatin1) - elif format == 1: - # Explicitly requested UTF-8 formatting. - d.putValue(blob, Hex2EncodedUtf8) - elif format == 2: - # Explicitly requested Local 8-bit formatting. - d.putValue(blob, Hex2EncodedLocal8Bit) - else: - d.putValue("@0x%x" % d.pointerValue(value.cast(targetType.pointer()))) - - if d.currentIName in d.expandedINames: - p = value.address - ts = targetType.sizeof - if not d.tryPutArrayContents(targetType, p, int(type.sizeof / ts)): - with Children(d, childType=targetType, - addrBase=p, addrStep=ts): - d.putFields(value) - - -def qdump__std__array(d, value): - size = d.numericTemplateArgument(value.type, 1) - d.putItemCount(size) - d.putNumChild(size) - if d.isExpanded(): - innerType = d.templateArgument(value.type, 0) - d.putArrayData(innerType, d.addressOf(value), size) - - -def qdump__std____1__array(d, value): - qdump__std__array(d, value) - - -def qdump__std__complex(d, value): - innerType = d.templateArgument(value.type, 0) - base = value.address.cast(innerType.pointer()) - real = base.dereference() - imag = (base + 1).dereference() - d.putValue("(%f, %f)" % (real, imag)); - d.putNumChild(2) - if d.isExpanded(): - with Children(d, 2, childType=innerType): - d.putSubItem("real", real) - d.putSubItem("imag", imag) - - -def qdump__std__deque(d, value): - innerType = d.templateArgument(value.type, 0) - innerSize = innerType.sizeof - bufsize = 1 - if innerSize < 512: - bufsize = int(512 / innerSize) - - impl = value["_M_impl"] - start = impl["_M_start"] - finish = impl["_M_finish"] - size = bufsize * toInteger(finish["_M_node"] - start["_M_node"] - 1) - size += toInteger(finish["_M_cur"] - finish["_M_first"]) - size += toInteger(start["_M_last"] - start["_M_cur"]) - - d.check(0 <= size and size <= 1000 * 1000 * 1000) - d.putItemCount(size) - d.putNumChild(size) - if d.isExpanded(): - with Children(d, size, maxNumChild=2000, childType=innerType): - pcur = start["_M_cur"] - pfirst = start["_M_first"] - plast = start["_M_last"] - pnode = start["_M_node"] - for i in d.childRange(): - d.putSubItem(i, pcur.dereference()) - pcur += 1 - if pcur == plast: - newnode = pnode + 1 - pnode = newnode - pfirst = newnode.dereference() - plast = pfirst + bufsize - pcur = pfirst - -def qdump__std____debug__deque(d, value): - qdump__std__deque(d, value) - - -def qdump__std__list(d, value): - head = d.dereferenceValue(value) - impl = value["_M_impl"] - node = impl["_M_node"] - size = 0 - pp = d.dereference(head) - while head != pp and size <= 1001: - size += 1 - pp = d.dereference(pp) - - d.putItemCount(size, 1000) - d.putNumChild(size) - - if d.isExpanded(): - p = node["_M_next"] - innerType = d.templateArgument(value.type, 0) - with Children(d, size, maxNumChild=1000, childType=innerType): - for i in d.childRange(): - innerPointer = innerType.pointer() - d.putSubItem(i, (p + 1).cast(innerPointer).dereference()) - p = p["_M_next"] - -def qdump__std____debug__list(d, value): - qdump__std__list(d, value) - -def qform__std__map(): - return mapForms() - -def qdump__std__map(d, value): - impl = value["_M_t"]["_M_impl"] - size = int(impl["_M_node_count"]) - d.check(0 <= size and size <= 100*1000*1000) - d.putItemCount(size) - d.putNumChild(size) - - if d.isExpanded(): - keyType = d.templateArgument(value.type, 0) - valueType = d.templateArgument(value.type, 1) - try: - # Does not work on gcc 4.4, the allocator type (fourth template - # argument) seems not to be available. - pairType = d.templateArgument(d.templateArgument(value.type, 3), 0) - pairPointer = pairType.pointer() - except: - # So use this as workaround: - pairType = d.templateArgument(impl.type, 1) - pairPointer = pairType.pointer() - isCompact = d.isMapCompact(keyType, valueType) - innerType = pairType - if isCompact: - innerType = valueType - node = impl["_M_header"]["_M_left"] - childType = innerType - if size == 0: - childType = pairType - childNumChild = 2 - if isCompact: - childNumChild = None - with Children(d, size, maxNumChild=1000, - childType=childType, childNumChild=childNumChild): - for i in d.childRange(): - with SubItem(d, i): - pair = (node + 1).cast(pairPointer).dereference() - if isCompact: - d.putMapName(pair["first"]) - d.putItem(pair["second"]) - else: - d.putEmptyValue() - if d.isExpanded(): - with Children(d, 2): - d.putSubItem("first", pair["first"]) - d.putSubItem("second", pair["second"]) - if d.isNull(node["_M_right"]): - parent = node["_M_parent"] - while node == parent["_M_right"]: - node = parent - parent = parent["_M_parent"] - if node["_M_right"] != parent: - node = parent - else: - node = node["_M_right"] - while not d.isNull(node["_M_left"]): - node = node["_M_left"] - -def qdump__std____debug__map(d, value): - qdump__std__map(d, value) - -def qdump__std____debug__set(d, value): - qdump__std__set(d, value) - -def qdump__std____cxx1998__map(d, value): - qdump__std__map(d, value) - -def stdTreeIteratorHelper(d, value): - pnode = value["_M_node"] - node = pnode.dereference() - d.putNumChild(1) - d.putEmptyValue() - if d.isExpanded(): - dataType = d.templateArgument(value.type, 0) - nodeType = d.lookupType("std::_Rb_tree_node<%s>" % dataType) - data = pnode.cast(nodeType.pointer()).dereference()["_M_value_field"] - with Children(d): - try: - d.putSubItem("first", data["first"]) - d.putSubItem("second", data["second"]) - except: - d.putSubItem("value", data) - with SubItem(d, "node"): - d.putNumChild(1) - d.putEmptyValue() - d.putType(" ") - if d.isExpanded(): - with Children(d): - d.putSubItem("color", node["_M_color"]) - d.putSubItem("left", node["_M_left"]) - d.putSubItem("right", node["_M_right"]) - d.putSubItem("parent", node["_M_parent"]) - - -def qdump__std___Rb_tree_iterator(d, value): - stdTreeIteratorHelper(d, value) - -def qdump__std___Rb_tree_const_iterator(d, value): - stdTreeIteratorHelper(d, value) - -def qdump__std__map__iterator(d, value): - stdTreeIteratorHelper(d, value) - -def qdump____gnu_debug___Safe_iterator(d, value): - d.putItem(value["_M_current"]) - -def qdump__std__map__const_iterator(d, value): - stdTreeIteratorHelper(d, value) - -def qdump__std__set__iterator(d, value): - stdTreeIteratorHelper(d, value) - -def qdump__std__set__const_iterator(d, value): - stdTreeIteratorHelper(d, value) - -def qdump__std____cxx1998__set(d, value): - qdump__std__set(d, value) - -def qdump__std__set(d, value): - impl = value["_M_t"]["_M_impl"] - size = int(impl["_M_node_count"]) - d.check(0 <= size and size <= 100*1000*1000) - d.putItemCount(size) - d.putNumChild(size) - if d.isExpanded(): - valueType = d.templateArgument(value.type, 0) - node = impl["_M_header"]["_M_left"] - with Children(d, size, maxNumChild=1000, childType=valueType): - for i in d.childRange(): - d.putSubItem(i, (node + 1).cast(valueType.pointer()).dereference()) - if d.isNull(node["_M_right"]): - parent = node["_M_parent"] - while node == parent["_M_right"]: - node = parent - parent = parent["_M_parent"] - if node["_M_right"] != parent: - node = parent - else: - node = node["_M_right"] - while not d.isNull(node["_M_left"]): - node = node["_M_left"] - - -def qdump__std__stack(d, value): - qdump__std__deque(d, value["c"]) - -def qdump__std____debug__stack(d, value): - qdump__std__stack(d, value) - -def qform__std__string(): - return "Inline,In Separate Window" - -def qdump__std__string(d, value): - qdump__std__stringHelper1(d, value, 1) - -def qdump__std__stringHelper1(d, value, charSize): - data = value["_M_dataplus"]["_M_p"] - # We can't lookup the std::string::_Rep type without crashing LLDB, - # so hard-code assumption on member position - # struct { size_type _M_length, size_type _M_capacity, int _M_refcount; } - sizePtr = data.cast(d.sizetType().pointer()) - size = int(sizePtr[-3]) - alloc = int(sizePtr[-2]) - refcount = int(sizePtr[-1]) - d.check(refcount >= -1) # Can be -1 accoring to docs. - d.check(0 <= size and size <= alloc and alloc <= 100*1000*1000) - qdump_stringHelper(d, sizePtr, size * charSize, charSize) - -def qdump_stringHelper(d, data, size, charSize): - cutoff = min(size, qqStringCutOff) - mem = d.readMemory(data, cutoff) - if charSize == 1: - encodingType = Hex2EncodedLatin1 - displayType = DisplayLatin1String - elif charSize == 2: - encodingType = Hex4EncodedLittleEndian - displayType = DisplayUtf16String - else: - encodingType = Hex8EncodedLittleEndian - displayType = DisplayUtf16String - - d.putNumChild(0) - d.putValue(mem, encodingType) - - format = d.currentItemFormat() - if format == 1: - d.putDisplay(StopDisplay) - elif format == 2: - d.putField("editformat", displayType) - d.putField("editvalue", d.readMemory(data, size)) - - -def qdump__std____1__string(d, value): - inner = d.childAt(d.childAt(value["__r_"]["__first_"], 0), 0) - size = int(inner["__size_"]) - alloc = int(inner["__cap_"]) - data = d.pointerValue(inner["__data_"]) - qdump_stringHelper(d, data, size, 1) - d.putType("std::string") - - -def qdump__std____1__wstring(d, value): - inner = d.childAt(d.childAt(value["__r_"]["__first_"], 0), 0) - size = int(inner["__size_"]) * 4 - alloc = int(inner["__cap_"]) - data = d.pointerValue(inner["__data_"]) - qdump_stringHelper(d, data, size, 4) - d.putType("std::wstring") - - -def qdump__std__shared_ptr(d, value): - i = value["_M_ptr"] - if d.isNull(i): - d.putValue("(null)") - d.putNumChild(0) - return - - if d.isSimpleType(d.templateArgument(value.type, 0)): - d.putValue("%s @0x%x" % (i.dereference(), d.pointerValue(i))) - else: - i = expensiveDowncast(i) - d.putValue("@0x%x" % d.pointerValue(i)) - - d.putNumChild(3) - with Children(d, 3): - d.putSubItem("data", i) - refcount = value["_M_refcount"]["_M_pi"] - d.putIntItem("usecount", refcount["_M_use_count"]) - d.putIntItem("weakcount", refcount["_M_weak_count"]) - -def qdump__std____1__shared_ptr(d, value): - i = value["__ptr_"] - if d.isNull(i): - d.putValue("(null)") - d.putNumChild(0) - return - - if d.isSimpleType(d.templateArgument(value.type, 0)): - d.putValue("%s @0x%x" % (i.dereference().value, d.pointerValue(i))) - else: - d.putValue("@0x%x" % d.pointerValue(i)) - - d.putNumChild(3) - with Children(d, 3): - d.putSubItem("data", i.dereference()) - d.putFields(value["__cntrl_"].dereference()) - #d.putIntItem("usecount", refcount["_M_use_count"]) - #d.putIntItem("weakcount", refcount["_M_weak_count"]) - -def qdump__std__unique_ptr(d, value): - i = value["_M_t"]["_M_head_impl"] - if d.isNull(i): - d.putValue("(null)") - d.putNumChild(0) - return - - if d.isSimpleType(d.templateArgument(value.type, 0)): - d.putValue("%s @0x%x" % (i.dereference(), d.pointerValue(i))) - else: - i = expensiveDowncast(i) - d.putValue("@0x%x" % d.pointerValue(i)) - - d.putNumChild(1) - with Children(d, 1): - d.putSubItem("data", i) - -def qdump__std____1__unique_ptr(d, value): - i = d.childAt(d.childAt(value["__ptr_"], 0), 0) - if d.isNull(i): - d.putValue("(null)") - d.putNumChild(0) - return - - if d.isSimpleType(d.templateArgument(value.type, 0)): - d.putValue("%s @0x%x" % (i.dereference().value, d.pointerValue(i))) - else: - d.putValue("@0x%x" % d.pointerValue(i)) - - d.putNumChild(1) - with Children(d, 1): - d.putSubItem("data", i.dereference()) - - -def qform__std__unordered_map(): - return mapForms() - -def qform__std____debug__unordered_map(): - return mapForms() - -def qdump__std__unordered_map(d, value): - try: - size = value["_M_element_count"] - start = value["_M_before_begin"]["_M_nxt"] - except: - size = value["_M_h"]["_M_element_count"] - start = value["_M_h"]["_M_bbegin"]["_M_node"]["_M_nxt"] - d.putItemCount(size) - d.putNumChild(size) - if d.isExpanded(): - p = d.pointerValue(start) - keyType = d.templateArgument(value.type, 0) - valueType = d.templateArgument(value.type, 1) - allocatorType = d.templateArgument(value.type, 4) - pairType = d.templateArgument(allocatorType, 0) - ptrSize = d.ptrSize() - if d.isMapCompact(keyType, valueType): - with Children(d, size, childType=valueType): - for i in d.childRange(): - pair = d.createValue(p + ptrSize, pairType) - with SubItem(d, i): - d.putField("iname", d.currentIName) - d.putName("[%s] %s" % (i, pair["first"])) - d.putValue(pair["second"]) - p = d.dereference(p) - else: - with Children(d, size, childType=pairType): - for i in d.childRange(): - d.putSubItem(i, d.createValue(p + ptrSize, pairType)) - p = d.dereference(p) - -def qdump__std____debug__unordered_map(d, value): - qdump__std__unordered_map(d, value) - -def qdump__std__unordered_set(d, value): - try: - size = value["_M_element_count"] - start = value["_M_before_begin"]["_M_nxt"] - except: - size = value["_M_h"]["_M_element_count"] - start = value["_M_h"]["_M_bbegin"]["_M_node"]["_M_nxt"] - d.putItemCount(size) - d.putNumChild(size) - if d.isExpanded(): - p = d.pointerValue(start) - valueType = d.templateArgument(value.type, 0) - with Children(d, size, childType=valueType): - ptrSize = d.ptrSize() - for i in d.childRange(): - d.putSubItem(i, d.createValue(p + ptrSize, valueType)) - p = d.dereference(p) - -def qdump__std____debug__unordered_set(d, value): - qdump__std__unordered_set(d, value) - - -def qedit__std__vector(expr, value): - values = value.split(',') - n = len(values) - ob = gdb.parse_and_eval(expr) - innerType = d.templateArgument(ob.type, 0) - cmd = "set $d = (%s*)calloc(sizeof(%s)*%s,1)" % (innerType, innerType, n) - gdb.execute(cmd) - cmd = "set {void*[3]}%s = {$d, $d+%s, $d+%s}" % (ob.address, n, n) - gdb.execute(cmd) - cmd = "set (%s[%d])*$d={%s}" % (innerType, n, value) - gdb.execute(cmd) - -def qdump__std__vector(d, value): - impl = value["_M_impl"] - type = d.templateArgument(value.type, 0) - alloc = impl["_M_end_of_storage"] - isBool = str(type) == 'bool' - if isBool: - start = impl["_M_start"]["_M_p"] - finish = impl["_M_finish"]["_M_p"] - # FIXME: 8 is CHAR_BIT - storage = d.lookupType("unsigned long") - storagesize = storage.sizeof * 8 - size = (finish - start) * storagesize - size += impl["_M_finish"]["_M_offset"] - size -= impl["_M_start"]["_M_offset"] - else: - start = impl["_M_start"] - finish = impl["_M_finish"] - size = finish - start - - d.check(0 <= size and size <= 1000 * 1000 * 1000) - d.check(finish <= alloc) - d.checkPointer(start) - d.checkPointer(finish) - d.checkPointer(alloc) - - d.putItemCount(size) - d.putNumChild(size) - if d.isExpanded(): - if isBool: - with Children(d, size, maxNumChild=10000, childType=type): - for i in d.childRange(): - q = start + int(i / storagesize) - d.putBoolItem(str(i), (q.dereference() >> (i % storagesize)) & 1) - else: - d.putArrayData(type, start, size) - -def qdump__std____1__vector(d, value): - innerType = d.templateArgument(value.type, 0) - if d.isLldb and d.childAt(value, 0).type == innerType: - # That's old lldb automatically formatting - begin = d.dereferenceValue(value) - size = value.GetNumChildren() - else: - # Normal case - begin = d.pointerValue(value['__begin_']) - end = d.pointerValue(value['__end_']) - size = (end - begin) / innerType.sizeof - - d.putItemCount(size) - d.putNumChild(size) - if d.isExpanded(): - d.putArrayData(innerType, begin, size) - - -def qdump__std____debug__vector(d, value): - qdump__std__vector(d, value) - -def qedit__std__string(expr, value): - cmd = "print (%s).assign(\"%s\")" % (expr, value) - gdb.execute(cmd) - -def qedit__string(expr, value): - qedit__std__string(expr, value) - -def qdump__string(d, value): - qdump__std__string(d, value) - -def qdump__std__wstring(d, value): - charSize = d.lookupType('wchar_t').sizeof - qdump__std__stringHelper1(d, value, charSize) - -def qdump__std__basic_string(d, value): - innerType = d.templateArgument(value.type, 0) - qdump__std__stringHelper1(d, value, innerType.sizeof) - -def qdump__wstring(d, value): - qdump__std__wstring(d, value) - - -def qdump____gnu_cxx__hash_set(d, value): - ht = value["_M_ht"] - size = int(ht["_M_num_elements"]) - d.check(0 <= size and size <= 1000 * 1000 * 1000) - d.putItemCount(size) - d.putNumChild(size) - type = d.templateArgument(value.type, 0) - d.putType("__gnu__cxx::hash_set<%s>" % type) - if d.isExpanded(): - with Children(d, size, maxNumChild=1000, childType=type): - buckets = ht["_M_buckets"]["_M_impl"] - bucketStart = buckets["_M_start"] - bucketFinish = buckets["_M_finish"] - p = bucketStart - itemCount = 0 - for i in xrange(toInteger(bucketFinish - bucketStart)): - if not d.isNull(p.dereference()): - cur = p.dereference() - while not d.isNull(cur): - with SubItem(d, itemCount): - d.putValue(cur["_M_val"]) - cur = cur["_M_next"] - itemCount += 1 - p = p + 1 - - -####################################################################### -# -# Boost dumper -# -####################################################################### - -def qdump__boost__bimaps__bimap(d, value): - #leftType = d.templateArgument(value.type, 0) - #rightType = d.templateArgument(value.type, 1) - size = int(value["core"]["node_count"]) - d.putItemCount(size) - d.putNumChild(size) - if d.isExpanded(): - d.putPlainChildren(value) - - -def qdump__boost__optional(d, value): - if int(value["m_initialized"]) == 0: - d.putValue("<uninitialized>") - d.putNumChild(0) - else: - type = d.templateArgument(value.type, 0) - storage = value["m_storage"] - if d.isReferenceType(type): - d.putItem(storage.cast(type.target().pointer()).dereference()) - else: - d.putItem(storage.cast(type)) - d.putBetterType(value.type) - - -def qdump__boost__shared_ptr(d, value): - # s boost::shared_ptr<int> - # pn boost::detail::shared_count - # pi_ 0x0 boost::detail::sp_counted_base * - # px 0x0 int * - if d.isNull(value["pn"]["pi_"]): - d.putValue("(null)") - d.putNumChild(0) - return - - if d.isNull(value["px"]): - d.putValue("(null)") - d.putNumChild(0) - return - - countedbase = value["pn"]["pi_"].dereference() - weakcount = int(countedbase["weak_count_"]) - usecount = int(countedbase["use_count_"]) - d.check(weakcount >= 0) - d.check(weakcount <= int(usecount)) - d.check(usecount <= 10*1000*1000) - - val = value["px"].dereference() - if d.isSimpleType(val.type): - d.putNumChild(3) - d.putItem(val) - d.putBetterType(value.type) - else: - d.putEmptyValue() - - d.putNumChild(3) - if d.isExpanded(): - with Children(d, 3): - d.putSubItem("data", val) - d.putIntItem("weakcount", weakcount) - d.putIntItem("usecount", usecount) - - -def qdump__boost__gregorian__date(d, value): - d.putValue(int(value["days_"]), JulianDate) - d.putNumChild(0) - - -def qdump__boost__posix_time__ptime(d, item): - ms = int(item["time_"]["time_count_"]["value_"]) / 1000 - d.putValue("%s/%s" % divmod(ms, 86400000), JulianDateAndMillisecondsSinceMidnight) - d.putNumChild(0) - - -def qdump__boost__posix_time__time_duration(d, item): - d.putValue(int(item["ticks_"]["value_"]) / 1000, MillisecondsSinceMidnight) - d.putNumChild(0) - - -####################################################################### -# -# SSE -# -####################################################################### - -def qform____m128(): - return "As Floats,As Doubles" - -def qdump____m128(d, value): - d.putEmptyValue() - d.putNumChild(1) - if d.isExpanded(): - format = d.currentItemFormat() - if format == 2: # As Double - d.putArrayData(d.lookupType("double"), value.address, 2) - else: # Default, As float - d.putArrayData(d.lookupType("float"), value.address, 4) - - -####################################################################### -# # Webkit # ####################################################################### @@ -2785,374 +2119,3 @@ def qdump__QScriptValue(d, value): with Children(d): d.putSubItem("jscValue", dd["jscValue"]) - -####################################################################### -# -# Qt Creator -# -####################################################################### - -def qdump__Core__Id(d, value): - try: - name = parseAndEvaluate("Core::nameForId(%d)" % value["m_id"]) - d.putValue(encodeCharArray(name), Hex2EncodedLatin1) - d.putPlainChildren(value) - except: - d.putValue(value["m_id"]) - d.putNumChild(0) - -def qdump__Debugger__Internal__GdbMi(d, value): - str = d.encodeByteArray(value["m_name"]) + "3a20" \ - + d.encodeByteArray(value["m_data"]) - d.putValue(str, Hex2EncodedLatin1) - d.putPlainChildren(value) - -def qdump__Debugger__Internal__WatchData(d, value): - d.putByteArrayValue(value["iname"]) - d.putPlainChildren(value) - -def qdump__Debugger__Internal__WatchItem(d, value): - d.putByteArrayValue(value["iname"]) - d.putPlainChildren(value) - -def qdump__Debugger__Internal__BreakpointModelId(d, value): - d.putValue("%s.%s" % (value["m_majorPart"], value["m_minorPart"])) - d.putPlainChildren(value) - -def qdump__CPlusPlus__ByteArrayRef(d, value): - d.putValue(encodeCharArray(value["m_start"], 100, value["m_length"]), - Hex2EncodedLatin1) - d.putPlainChildren(value) - -def qdump__CPlusPlus__Identifier(d, value): - d.putValue(encodeCharArray(value["_chars"]), Hex2EncodedLatin1) - d.putPlainChildren(value) - -def qdump__CPlusPlus__IntegerType(d, value): - d.putValue(value["_kind"]) - d.putPlainChildren(value) - -def qdump__CPlusPlus__NamedType(d, value): - literal = downcast(value["_name"]) - d.putValue(encodeCharArray(literal["_chars"]), Hex2EncodedLatin1) - d.putPlainChildren(value) - -def qdump__CPlusPlus__TemplateNameId(d, value): - s = encodeCharArray(value["_identifier"]["_chars"]) - d.putValue(s + "3c2e2e2e3e", Hex2EncodedLatin1) - d.putPlainChildren(value) - -def qdump__CPlusPlus__Literal(d, value): - d.putValue(encodeCharArray(value["_chars"]), Hex2EncodedLatin1) - d.putPlainChildren(value) - -def qdump__CPlusPlus__StringLiteral(d, value): - d.putValue(encodeCharArray(value["_chars"]), Hex2EncodedLatin1) - d.putPlainChildren(value) - -def qdump__CPlusPlus__Internal__Value(d, value): - d.putValue(value["l"]) - d.putPlainChildren(value) - -def qdump__Utils__FileName(d, value): - d.putStringValue(value) - d.putPlainChildren(value) - -def qdump__Utils__ElfSection(d, value): - d.putByteArrayValue(value["name"]) - d.putPlainChildren(value) - -def qdump__CPlusPlus__Token(d, value): - k = int(value["f"]["kind"]) - if int(k) == 6: - d.putValue("T_IDENTIFIER. offset: %d, len: %d" - % (value["offset"], value["f"]["length"])) - elif int(k) == 7: - d.putValue("T_NUMERIC_LITERAL. offset: %d, value: %d" - % (value["offset"], value["f"]["length"])) - elif int(k) == 60: - d.putValue("T_RPAREN") - else: - d.putValue("Type: %s" % k) - d.putPlainChildren(value) - -def qdump__CPlusPlus__Internal__PPToken(d, value): - k = value["f"]["kind"]; - data, size, alloc = d.byteArrayData(value["m_src"]) - length = int(value["f"]["length"]) - offset = int(value["offset"]) - #warn("size: %s, alloc: %s, offset: %s, length: %s, data: %s" - # % (size, alloc, offset, length, data)) - d.putValue(d.readMemory(data + offset, min(100, length)), - Hex2EncodedLatin1) - d.putPlainChildren(value) - - -####################################################################### -# -# Eigen -# -####################################################################### - -#def qform__Eigen__Matrix(): -# return "Transposed" - -def qdump__Eigen__Matrix(d, value): - innerType = d.templateArgument(value.type, 0) - storage = value["m_storage"] - options = d.numericTemplateArgument(value.type, 3) - rowMajor = (int(options) & 0x1) - argRow = d.numericTemplateArgument(value.type, 1) - argCol = d.numericTemplateArgument(value.type, 2) - nrows = value["m_storage"]["m_rows"] if argRow == -1 else int(argRow) - ncols = value["m_storage"]["m_cols"] if argCol == -1 else int(argCol) - p = storage["m_data"] - if d.isStructType(p.type): # Static - p = p["array"].cast(innerType.pointer()) - d.putValue("(%s x %s), %s" % (nrows, ncols, ["ColumnMajor", "RowMajor"][rowMajor])) - d.putField("keeporder", "1") - d.putNumChild(nrows * ncols) - - limit = 10000 - nncols = min(ncols, limit) - nnrows = min(nrows, limit * limit / nncols) - if d.isExpanded(): - #format = d.currentItemFormat() # format == 1 is "Transposed" - with Children(d, nrows * ncols, childType=innerType): - if ncols == 1 or nrows == 1: - for i in range(0, min(nrows * ncols, 10000)): - d.putSubItem(i, (p + i).dereference()) - elif rowMajor == 1: - s = 0 - for i in range(0, nnrows): - for j in range(0, nncols): - v = (p + i * ncols + j).dereference() - d.putNamedSubItem(s, v, "[%d,%d]" % (i, j)) - s = s + 1 - else: - s = 0 - for j in range(0, nncols): - for i in range(0, nnrows): - v = (p + i + j * nrows).dereference() - d.putNamedSubItem(s, v, "[%d,%d]" % (i, j)) - s = s + 1 - - -####################################################################### -# -# D -# -####################################################################### - -def cleanDType(type): - return d.stripClassTag(str(type)).replace("uns long long", "string") - -def qdump_Array(d, value): - n = value["length"] - p = value["ptr"] - t = cleanDType(value.type)[7:] - d.putType("%s[%d]" % (t, n)) - if t == "char": - d.putValue(encodeCharArray(p, 100), Hex2EncodedLocal8Bit) - d.putNumChild(0) - else: - d.putEmptyValue() - d.putNumChild(n) - innerType = p.type - if d.isExpanded(): - with Children(d, n, childType=innerType): - for i in range(0, n): - d.putSubItem(i, p.dereference()) - p = p + 1 - - -def qdump_AArray(d, value): - #n = value["length"] - # This ends up as _AArray_<key>_<value> with a single .ptr - # member of type void *. Not much that can be done here. - p = value["ptr"] - t = cleanDType(value.type)[8:] - d.putType("%s]" % t.replace("_", "[")) - d.putEmptyValue() - d.putNumChild(1) - if d.isExpanded(): - with Children(d, 1): - d.putSubItem("ptr", p) - - -####################################################################### -# -# Display Test -# -####################################################################### - -if False: - - # FIXME: Make that work - def qdump__Color(d, value): - v = value - d.putValue("(%s, %s, %s; %s)" % (v["r"], v["g"], v["b"], v["a"])) - d.putPlainChildren(value) - - def qdump__Color_(d, value): - v = value - d.putValue("(%s, %s, %s; %s)" % (v["r"], v["g"], v["b"], v["a"])) - if d.isExpanded(): - with Children(d): - with SubItem(d, "0"): - d.putItem(v["r"]) - with SubItem(d, "1"): - d.putItem(v["g"]) - with SubItem(d, "2"): - d.putItem(v["b"]) - with SubItem(d, "3"): - d.putItem(v["a"]) - - -if False: - - def qform__basic__Function(): - return "Normal,Displayed" - - def qdump__basic__Function(d, value): - min = value["min"] - max = value["max"] - data, size, alloc = d.byteArrayData(value["var"]) - var = extractCString(data, 0) - data, size, alloc = d.byteArrayData(value["f"]) - f = extractCString(data, 0) - d.putValue("%s, %s=%f..%f" % (f, var, min, max)) - d.putNumChild(0) - format = d.currentItemFormat() - if format == 1: - d.putDisplay(StopDisplay) - elif format == 2: - input = "plot [%s=%f:%f] %s" % (var, min, max, f) - d.putDisplay(DisplayProcess, input, "gnuplot") - - -if False: - - def qdump__tree_entry(d, value): - d.putValue("len: %s, offset: %s, type: %s" % - (value["blocklength"], value["offset"], value["type"])) - d.putNumChild(0) - - def qdump__tree(d, value): - count = value["count"] - entries = value["entries"] - base = value["base"].cast(d.charPtrType()) - d.putItemCount(count) - d.putNumChild(count) - if d.isExpanded(): - with Children(d): - with SubItem(d, "tree"): - d.putEmptyValue() - d.putNoType() - d.putNumChild(1) - if d.isExpanded(): - with Children(d): - for i in xrange(count): - d.putSubItem(Item(entries[i], iname)) - with SubItem(d, "data"): - d.putEmptyValue() - d.putNoType() - d.putNumChild(1) - if d.isExpanded(): - with Children(d): - for i in xrange(count): - with SubItem(d, i): - entry = entries[i] - mpitype = str(entry["type"]) - d.putType(mpitype) - length = int(entry["blocklength"]) - offset = int(entry["offset"]) - d.putValue("%s items at %s" % (length, offset)) - if mpitype == "MPI_INT": - innerType = "int" - elif mpitype == "MPI_CHAR": - innerType = "char" - elif mpitype == "MPI_DOUBLE": - innerType = "double" - else: - length = 0 - d.putNumChild(length) - if d.isExpanded(): - with Children(d): - t = d.lookupType(innerType).pointer() - p = (base + offset).cast(t) - for j in range(length): - d.putSubItem(j, p.dereference()) - - #struct KRBase - #{ - # enum Type { TYPE_A, TYPE_B } type; - # KRBase(Type _type) : type(_type) {} - #}; - # - #struct KRA : KRBase { int x; int y; KRA():KRBase(TYPE_A),x(1),y(32) {} }; - #struct KRB : KRBase { KRB():KRBase(TYPE_B) {} }; - # - #void testKR() - #{ - # KRBase *ptr1 = new KRA; - # KRBase *ptr2 = new KRB; - # ptr2 = new KRB; - #} - - def qdump__KRBase(d, value): - if getattr(value, "__nested__", None) is None: - base = ["KRA", "KRB"][int(value["type"])] - nest = value.cast(d.lookupType(base)) - nest.__nested__ = True - warn("NEST %s " % dir(nest)) - d.putItem(nest) - else: - d.putName("type") - d.putValue(value["type"]) - d.putNoType() - - - -if False: - def qdump__bug5106__A5106(d, value): - d.putName("a") - d.putValue("This is the value: %s" % value["m_a"]) - d.putNoType() - d.putNumChild(0) - - -if False: - def qdump__bug6933__Base(d, value): - d.putValue("foo") - d.putPlainChildren(value) - -if False: - def qdump__gdb13393__Base(d, value): - d.putValue("Base (%s)" % value["a"]) - d.putType(value.type) - d.putPlainChildren(value) - - def qdump__gdb13393__Derived(d, value): - d.putValue("Derived (%s, %s)" % (value["a"], value["b"])) - d.putType(value.type) - d.putPlainChildren(value) - - -def qdump__KDSoapValue1(d, value): - inner = value["d"]["d"].dereference() - d.putStringValue(inner["m_name"]) - if d.isExpanded(): - with Children(d): - d.putFields(inner) - -def indirect(value): - return value.cast(lookupType("char*")) - -def qdump__KDSoapValue(d, value): - p = (value.cast(lookupType("char*")) + 4).dereference().cast(lookupType("QString")) - d.putStringValue(p) - if d.isExpanded(): - with Children(d): - data = value["d"]["d"].dereference() - d.putFields(data) diff --git a/share/qtcreator/debugger/stdtypes.py b/share/qtcreator/debugger/stdtypes.py new file mode 100644 index 0000000000..4d6ac1bd1a --- /dev/null +++ b/share/qtcreator/debugger/stdtypes.py @@ -0,0 +1,625 @@ +############################################################################ +# +# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +# Contact: http://www.qt-project.org/legal +# +# This file is part of Qt Creator. +# +# Commercial License Usage +# Licensees holding valid commercial Qt licenses may use this file in +# accordance with the commercial license agreement provided with the +# Software or, alternatively, in accordance with the terms contained in +# a written agreement between you and Digia. For licensing terms and +# conditions see http://qt.digia.com/licensing. For further information +# use the contact form at http://qt.digia.com/contact-us. +# +# GNU Lesser General Public License Usage +# Alternatively, this file may be used under the terms of the GNU Lesser +# General Public License version 2.1 as published by the Free Software +# Foundation and appearing in the file LICENSE.LGPL included in the +# packaging of this file. Please review the following information to +# ensure the GNU Lesser General Public License version 2.1 requirements +# will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +# +# In addition, as a special exception, Digia gives you certain additional +# rights. These rights are described in the Digia Qt LGPL Exception +# version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +# +############################################################################# + +from dumper import * + +def qdump____c_style_array__(d, value): + type = value.type.unqualified() + targetType = value[0].type + #d.putAddress(value.address) + d.putType(type) + d.putNumChild(1) + format = d.currentItemFormat() + isDefault = format == None and str(targetType.unqualified()) == "char" + if isDefault or format == 0 or format == 1 or format == 2: + blob = d.readMemory(value.address, type.sizeof) + + if isDefault: + # Use Latin1 as default for char []. + d.putValue(blob, Hex2EncodedLatin1) + elif format == 0: + # Explicitly requested Latin1 formatting. + d.putValue(blob, Hex2EncodedLatin1) + elif format == 1: + # Explicitly requested UTF-8 formatting. + d.putValue(blob, Hex2EncodedUtf8) + elif format == 2: + # Explicitly requested Local 8-bit formatting. + d.putValue(blob, Hex2EncodedLocal8Bit) + else: + d.putValue("@0x%x" % d.pointerValue(value.cast(targetType.pointer()))) + + if d.currentIName in d.expandedINames: + p = value.address + ts = targetType.sizeof + if not d.tryPutArrayContents(targetType, p, int(type.sizeof / ts)): + with Children(d, childType=targetType, + addrBase=p, addrStep=ts): + d.putFields(value) + + +def qdump__std__array(d, value): + size = d.numericTemplateArgument(value.type, 1) + d.putItemCount(size) + d.putNumChild(size) + if d.isExpanded(): + innerType = d.templateArgument(value.type, 0) + d.putArrayData(innerType, d.addressOf(value), size) + + +def qdump__std____1__array(d, value): + qdump__std__array(d, value) + + +def qdump__std__complex(d, value): + innerType = d.templateArgument(value.type, 0) + base = value.address.cast(innerType.pointer()) + real = base.dereference() + imag = (base + 1).dereference() + d.putValue("(%f, %f)" % (real, imag)); + d.putNumChild(2) + if d.isExpanded(): + with Children(d, 2, childType=innerType): + d.putSubItem("real", real) + d.putSubItem("imag", imag) + + +def qdump__std__deque(d, value): + innerType = d.templateArgument(value.type, 0) + innerSize = innerType.sizeof + bufsize = 1 + if innerSize < 512: + bufsize = int(512 / innerSize) + + impl = value["_M_impl"] + start = impl["_M_start"] + finish = impl["_M_finish"] + size = bufsize * toInteger(finish["_M_node"] - start["_M_node"] - 1) + size += toInteger(finish["_M_cur"] - finish["_M_first"]) + size += toInteger(start["_M_last"] - start["_M_cur"]) + + d.check(0 <= size and size <= 1000 * 1000 * 1000) + d.putItemCount(size) + d.putNumChild(size) + if d.isExpanded(): + with Children(d, size, maxNumChild=2000, childType=innerType): + pcur = start["_M_cur"] + pfirst = start["_M_first"] + plast = start["_M_last"] + pnode = start["_M_node"] + for i in d.childRange(): + d.putSubItem(i, pcur.dereference()) + pcur += 1 + if pcur == plast: + newnode = pnode + 1 + pnode = newnode + pfirst = newnode.dereference() + plast = pfirst + bufsize + pcur = pfirst + +def qdump__std____debug__deque(d, value): + qdump__std__deque(d, value) + + +def qdump__std__list(d, value): + head = d.dereferenceValue(value) + impl = value["_M_impl"] + node = impl["_M_node"] + size = 0 + pp = d.dereference(head) + while head != pp and size <= 1001: + size += 1 + pp = d.dereference(pp) + + d.putItemCount(size, 1000) + d.putNumChild(size) + + if d.isExpanded(): + p = node["_M_next"] + innerType = d.templateArgument(value.type, 0) + with Children(d, size, maxNumChild=1000, childType=innerType): + for i in d.childRange(): + innerPointer = innerType.pointer() + d.putSubItem(i, (p + 1).cast(innerPointer).dereference()) + p = p["_M_next"] + +def qdump__std____debug__list(d, value): + qdump__std__list(d, value) + +def qform__std__map(): + return mapForms() + +def qdump__std__map(d, value): + impl = value["_M_t"]["_M_impl"] + size = int(impl["_M_node_count"]) + d.check(0 <= size and size <= 100*1000*1000) + d.putItemCount(size) + d.putNumChild(size) + + if d.isExpanded(): + keyType = d.templateArgument(value.type, 0) + valueType = d.templateArgument(value.type, 1) + try: + # Does not work on gcc 4.4, the allocator type (fourth template + # argument) seems not to be available. + pairType = d.templateArgument(d.templateArgument(value.type, 3), 0) + pairPointer = pairType.pointer() + except: + # So use this as workaround: + pairType = d.templateArgument(impl.type, 1) + pairPointer = pairType.pointer() + isCompact = d.isMapCompact(keyType, valueType) + innerType = pairType + if isCompact: + innerType = valueType + node = impl["_M_header"]["_M_left"] + childType = innerType + if size == 0: + childType = pairType + childNumChild = 2 + if isCompact: + childNumChild = None + with Children(d, size, maxNumChild=1000, + childType=childType, childNumChild=childNumChild): + for i in d.childRange(): + with SubItem(d, i): + pair = (node + 1).cast(pairPointer).dereference() + if isCompact: + d.putMapName(pair["first"]) + d.putItem(pair["second"]) + else: + d.putEmptyValue() + if d.isExpanded(): + with Children(d, 2): + d.putSubItem("first", pair["first"]) + d.putSubItem("second", pair["second"]) + if d.isNull(node["_M_right"]): + parent = node["_M_parent"] + while node == parent["_M_right"]: + node = parent + parent = parent["_M_parent"] + if node["_M_right"] != parent: + node = parent + else: + node = node["_M_right"] + while not d.isNull(node["_M_left"]): + node = node["_M_left"] + +def qdump__std____debug__map(d, value): + qdump__std__map(d, value) + +def qdump__std____debug__set(d, value): + qdump__std__set(d, value) + +def qdump__std____cxx1998__map(d, value): + qdump__std__map(d, value) + +def stdTreeIteratorHelper(d, value): + pnode = value["_M_node"] + node = pnode.dereference() + d.putNumChild(1) + d.putEmptyValue() + if d.isExpanded(): + dataType = d.templateArgument(value.type, 0) + nodeType = d.lookupType("std::_Rb_tree_node<%s>" % dataType) + data = pnode.cast(nodeType.pointer()).dereference()["_M_value_field"] + with Children(d): + try: + d.putSubItem("first", data["first"]) + d.putSubItem("second", data["second"]) + except: + d.putSubItem("value", data) + with SubItem(d, "node"): + d.putNumChild(1) + d.putEmptyValue() + d.putType(" ") + if d.isExpanded(): + with Children(d): + d.putSubItem("color", node["_M_color"]) + d.putSubItem("left", node["_M_left"]) + d.putSubItem("right", node["_M_right"]) + d.putSubItem("parent", node["_M_parent"]) + + +def qdump__std___Rb_tree_iterator(d, value): + stdTreeIteratorHelper(d, value) + +def qdump__std___Rb_tree_const_iterator(d, value): + stdTreeIteratorHelper(d, value) + +def qdump__std__map__iterator(d, value): + stdTreeIteratorHelper(d, value) + +def qdump____gnu_debug___Safe_iterator(d, value): + d.putItem(value["_M_current"]) + +def qdump__std__map__const_iterator(d, value): + stdTreeIteratorHelper(d, value) + +def qdump__std__set__iterator(d, value): + stdTreeIteratorHelper(d, value) + +def qdump__std__set__const_iterator(d, value): + stdTreeIteratorHelper(d, value) + +def qdump__std____cxx1998__set(d, value): + qdump__std__set(d, value) + +def qdump__std__set(d, value): + impl = value["_M_t"]["_M_impl"] + size = int(impl["_M_node_count"]) + d.check(0 <= size and size <= 100*1000*1000) + d.putItemCount(size) + d.putNumChild(size) + if d.isExpanded(): + valueType = d.templateArgument(value.type, 0) + node = impl["_M_header"]["_M_left"] + with Children(d, size, maxNumChild=1000, childType=valueType): + for i in d.childRange(): + d.putSubItem(i, (node + 1).cast(valueType.pointer()).dereference()) + if d.isNull(node["_M_right"]): + parent = node["_M_parent"] + while node == parent["_M_right"]: + node = parent + parent = parent["_M_parent"] + if node["_M_right"] != parent: + node = parent + else: + node = node["_M_right"] + while not d.isNull(node["_M_left"]): + node = node["_M_left"] + + +def qdump__std__stack(d, value): + qdump__std__deque(d, value["c"]) + +def qdump__std____debug__stack(d, value): + qdump__std__stack(d, value) + +def qform__std__string(): + return "Inline,In Separate Window" + +def qdump__std__string(d, value): + qdump__std__stringHelper1(d, value, 1) + +def qdump__std__stringHelper1(d, value, charSize): + data = value["_M_dataplus"]["_M_p"] + # We can't lookup the std::string::_Rep type without crashing LLDB, + # so hard-code assumption on member position + # struct { size_type _M_length, size_type _M_capacity, int _M_refcount; } + sizePtr = data.cast(d.sizetType().pointer()) + size = int(sizePtr[-3]) + alloc = int(sizePtr[-2]) + refcount = int(sizePtr[-1]) + d.check(refcount >= -1) # Can be -1 accoring to docs. + d.check(0 <= size and size <= alloc and alloc <= 100*1000*1000) + qdump_stringHelper(d, sizePtr, size * charSize, charSize) + +def qdump_stringHelper(d, data, size, charSize): + cutoff = min(size, qqStringCutOff) + mem = d.readMemory(data, cutoff) + if charSize == 1: + encodingType = Hex2EncodedLatin1 + displayType = DisplayLatin1String + elif charSize == 2: + encodingType = Hex4EncodedLittleEndian + displayType = DisplayUtf16String + else: + encodingType = Hex8EncodedLittleEndian + displayType = DisplayUtf16String + + d.putNumChild(0) + d.putValue(mem, encodingType) + + format = d.currentItemFormat() + if format == 1: + d.putDisplay(StopDisplay) + elif format == 2: + d.putField("editformat", displayType) + d.putField("editvalue", d.readMemory(data, size)) + + +def qdump__std____1__string(d, value): + inner = d.childAt(d.childAt(value["__r_"]["__first_"], 0), 0) + size = int(inner["__size_"]) + alloc = int(inner["__cap_"]) + data = d.pointerValue(inner["__data_"]) + qdump_stringHelper(d, data, size, 1) + d.putType("std::string") + + +def qdump__std____1__wstring(d, value): + inner = d.childAt(d.childAt(value["__r_"]["__first_"], 0), 0) + size = int(inner["__size_"]) * 4 + alloc = int(inner["__cap_"]) + data = d.pointerValue(inner["__data_"]) + qdump_stringHelper(d, data, size, 4) + d.putType("std::wstring") + + +def qdump__std__shared_ptr(d, value): + i = value["_M_ptr"] + if d.isNull(i): + d.putValue("(null)") + d.putNumChild(0) + return + + if d.isSimpleType(d.templateArgument(value.type, 0)): + d.putValue("%s @0x%x" % (i.dereference(), d.pointerValue(i))) + else: + i = expensiveDowncast(i) + d.putValue("@0x%x" % d.pointerValue(i)) + + d.putNumChild(3) + with Children(d, 3): + d.putSubItem("data", i) + refcount = value["_M_refcount"]["_M_pi"] + d.putIntItem("usecount", refcount["_M_use_count"]) + d.putIntItem("weakcount", refcount["_M_weak_count"]) + +def qdump__std____1__shared_ptr(d, value): + i = value["__ptr_"] + if d.isNull(i): + d.putValue("(null)") + d.putNumChild(0) + return + + if d.isSimpleType(d.templateArgument(value.type, 0)): + d.putValue("%s @0x%x" % (i.dereference().value, d.pointerValue(i))) + else: + d.putValue("@0x%x" % d.pointerValue(i)) + + d.putNumChild(3) + with Children(d, 3): + d.putSubItem("data", i.dereference()) + d.putFields(value["__cntrl_"].dereference()) + #d.putIntItem("usecount", refcount["_M_use_count"]) + #d.putIntItem("weakcount", refcount["_M_weak_count"]) + +def qdump__std__unique_ptr(d, value): + i = value["_M_t"]["_M_head_impl"] + if d.isNull(i): + d.putValue("(null)") + d.putNumChild(0) + return + + if d.isSimpleType(d.templateArgument(value.type, 0)): + d.putValue("%s @0x%x" % (i.dereference(), d.pointerValue(i))) + else: + i = expensiveDowncast(i) + d.putValue("@0x%x" % d.pointerValue(i)) + + d.putNumChild(1) + with Children(d, 1): + d.putSubItem("data", i) + +def qdump__std____1__unique_ptr(d, value): + i = d.childAt(d.childAt(value["__ptr_"], 0), 0) + if d.isNull(i): + d.putValue("(null)") + d.putNumChild(0) + return + + if d.isSimpleType(d.templateArgument(value.type, 0)): + d.putValue("%s @0x%x" % (i.dereference().value, d.pointerValue(i))) + else: + d.putValue("@0x%x" % d.pointerValue(i)) + + d.putNumChild(1) + with Children(d, 1): + d.putSubItem("data", i.dereference()) + + +def qform__std__unordered_map(): + return mapForms() + +def qform__std____debug__unordered_map(): + return mapForms() + +def qdump__std__unordered_map(d, value): + try: + size = value["_M_element_count"] + start = value["_M_before_begin"]["_M_nxt"] + except: + size = value["_M_h"]["_M_element_count"] + start = value["_M_h"]["_M_bbegin"]["_M_node"]["_M_nxt"] + d.putItemCount(size) + d.putNumChild(size) + if d.isExpanded(): + p = d.pointerValue(start) + keyType = d.templateArgument(value.type, 0) + valueType = d.templateArgument(value.type, 1) + allocatorType = d.templateArgument(value.type, 4) + pairType = d.templateArgument(allocatorType, 0) + ptrSize = d.ptrSize() + if d.isMapCompact(keyType, valueType): + with Children(d, size, childType=valueType): + for i in d.childRange(): + pair = d.createValue(p + ptrSize, pairType) + with SubItem(d, i): + d.putField("iname", d.currentIName) + d.putName("[%s] %s" % (i, pair["first"])) + d.putValue(pair["second"]) + p = d.dereference(p) + else: + with Children(d, size, childType=pairType): + for i in d.childRange(): + d.putSubItem(i, d.createValue(p + ptrSize, pairType)) + p = d.dereference(p) + +def qdump__std____debug__unordered_map(d, value): + qdump__std__unordered_map(d, value) + +def qdump__std__unordered_set(d, value): + try: + size = value["_M_element_count"] + start = value["_M_before_begin"]["_M_nxt"] + except: + size = value["_M_h"]["_M_element_count"] + start = value["_M_h"]["_M_bbegin"]["_M_node"]["_M_nxt"] + d.putItemCount(size) + d.putNumChild(size) + if d.isExpanded(): + p = d.pointerValue(start) + valueType = d.templateArgument(value.type, 0) + with Children(d, size, childType=valueType): + ptrSize = d.ptrSize() + for i in d.childRange(): + d.putSubItem(i, d.createValue(p + ptrSize, valueType)) + p = d.dereference(p) + +def qdump__std____debug__unordered_set(d, value): + qdump__std__unordered_set(d, value) + + +def qedit__std__vector(expr, value): + values = value.split(',') + n = len(values) + ob = gdb.parse_and_eval(expr) + innerType = d.templateArgument(ob.type, 0) + cmd = "set $d = (%s*)calloc(sizeof(%s)*%s,1)" % (innerType, innerType, n) + gdb.execute(cmd) + cmd = "set {void*[3]}%s = {$d, $d+%s, $d+%s}" % (ob.address, n, n) + gdb.execute(cmd) + cmd = "set (%s[%d])*$d={%s}" % (innerType, n, value) + gdb.execute(cmd) + +def qdump__std__vector(d, value): + impl = value["_M_impl"] + type = d.templateArgument(value.type, 0) + alloc = impl["_M_end_of_storage"] + isBool = str(type) == 'bool' + if isBool: + start = impl["_M_start"]["_M_p"] + finish = impl["_M_finish"]["_M_p"] + # FIXME: 8 is CHAR_BIT + storage = d.lookupType("unsigned long") + storagesize = storage.sizeof * 8 + size = (finish - start) * storagesize + size += impl["_M_finish"]["_M_offset"] + size -= impl["_M_start"]["_M_offset"] + else: + start = impl["_M_start"] + finish = impl["_M_finish"] + size = finish - start + + d.check(0 <= size and size <= 1000 * 1000 * 1000) + d.check(finish <= alloc) + d.checkPointer(start) + d.checkPointer(finish) + d.checkPointer(alloc) + + d.putItemCount(size) + d.putNumChild(size) + if d.isExpanded(): + if isBool: + with Children(d, size, maxNumChild=10000, childType=type): + for i in d.childRange(): + q = start + int(i / storagesize) + d.putBoolItem(str(i), (q.dereference() >> (i % storagesize)) & 1) + else: + d.putArrayData(type, start, size) + +def qdump__std____1__vector(d, value): + innerType = d.templateArgument(value.type, 0) + if d.isLldb and d.childAt(value, 0).type == innerType: + # That's old lldb automatically formatting + begin = d.dereferenceValue(value) + size = value.GetNumChildren() + else: + # Normal case + begin = d.pointerValue(value['__begin_']) + end = d.pointerValue(value['__end_']) + size = (end - begin) / innerType.sizeof + + d.putItemCount(size) + d.putNumChild(size) + if d.isExpanded(): + d.putArrayData(innerType, begin, size) + + +def qdump__std____debug__vector(d, value): + qdump__std__vector(d, value) + +def qedit__std__string(expr, value): + cmd = "print (%s).assign(\"%s\")" % (expr, value) + gdb.execute(cmd) + +def qedit__string(expr, value): + qedit__std__string(expr, value) + +def qdump__string(d, value): + qdump__std__string(d, value) + +def qdump__std__wstring(d, value): + charSize = d.lookupType('wchar_t').sizeof + qdump__std__stringHelper1(d, value, charSize) + +def qdump__std__basic_string(d, value): + innerType = d.templateArgument(value.type, 0) + qdump__std__stringHelper1(d, value, innerType.sizeof) + +def qdump__wstring(d, value): + qdump__std__wstring(d, value) + + +def qdump____gnu_cxx__hash_set(d, value): + ht = value["_M_ht"] + size = int(ht["_M_num_elements"]) + d.check(0 <= size and size <= 1000 * 1000 * 1000) + d.putItemCount(size) + d.putNumChild(size) + type = d.templateArgument(value.type, 0) + d.putType("__gnu__cxx::hash_set<%s>" % type) + if d.isExpanded(): + with Children(d, size, maxNumChild=1000, childType=type): + buckets = ht["_M_buckets"]["_M_impl"] + bucketStart = buckets["_M_start"] + bucketFinish = buckets["_M_finish"] + p = bucketStart + itemCount = 0 + for i in xrange(toInteger(bucketFinish - bucketStart)): + if not d.isNull(p.dereference()): + cur = p.dereference() + while not d.isNull(cur): + with SubItem(d, itemCount): + d.putValue(cur["_M_val"]) + cur = cur["_M_next"] + itemCount += 1 + p = p + 1 + + +def qdump__uint8_t(d, value): + d.putNumChild(0) + d.putValue(int(value)) + +def qdump__int8_t(d, value): + d.putNumChild(0) + d.putValue(int(value)) + diff --git a/share/qtcreator/qml/qmljsdebugger/include/qt_private/qdeclarativedebughelper_p.h b/share/qtcreator/qml/qmljsdebugger/include/qt_private/qdeclarativedebughelper_p.h index 0c6d0084df..a1872a1ef1 100644 --- a/share/qtcreator/qml/qmljsdebugger/include/qt_private/qdeclarativedebughelper_p.h +++ b/share/qtcreator/qml/qmljsdebugger/include/qt_private/qdeclarativedebughelper_p.h @@ -38,7 +38,7 @@ QT_BEGIN_NAMESPACE class QScriptEngine; class QDeclarativeEngine; -// Helper methods to access private API through a stable interface +// Helper functions to access private API through a stable interface // This is used in the qmljsdebugger library of QtCreator. class QMLJSDEBUGGER_EXTERN QDeclarativeDebugHelper { diff --git a/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.cpp b/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.cpp index e12c43ac86..f06752cef8 100644 --- a/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.cpp +++ b/share/qtcreator/templates/wizards/qtcreatorplugin/myplugin.cpp @@ -34,7 +34,7 @@ bool %PluginName%Plugin::initialize(const QStringList &arguments, QString *error // Load settings // Add actions to menus // Connect to other plugins' signals - // In the initialize method, a plugin can be sure that the plugins it + // In the initialize function, a plugin can be sure that the plugins it // depends on have initialized their members. Q_UNUSED(arguments) @@ -57,7 +57,7 @@ bool %PluginName%Plugin::initialize(const QStringList &arguments, QString *error void %PluginName%Plugin::extensionsInitialized() { // Retrieve objects from the plugin manager's object pool - // In the extensionsInitialized method, a plugin can be sure that all + // In the extensionsInitialized function, a plugin can be sure that all // plugins that depend on it are completely initialized. } diff --git a/share/qtcreator/welcomescreen/widgets/Button.qml b/share/qtcreator/welcomescreen/widgets/Button.qml index c62ebe0c6e..c4f329c285 100644 --- a/share/qtcreator/welcomescreen/widgets/Button.qml +++ b/share/qtcreator/welcomescreen/widgets/Button.qml @@ -123,7 +123,7 @@ Button { text: control.text color: control.pressed || control.checked ? "lightGray" : "black" font.pixelSize: 15 - font.bold: true + font.bold: false smooth: true } } diff --git a/share/qtcreator/welcomescreen/widgets/SessionItem.qml b/share/qtcreator/welcomescreen/widgets/SessionItem.qml index 750c230560..4c9d219d62 100644 --- a/share/qtcreator/welcomescreen/widgets/SessionItem.qml +++ b/share/qtcreator/welcomescreen/widgets/SessionItem.qml @@ -46,11 +46,13 @@ Item { spacing: 7 - Rectangle { + Image { + source: "images/sessions.png" + anchors.verticalCenter: projectNameText.verticalCenter width: 16 height: 16 - color: "#7e7e7e" } + LinkedText { id: text diff --git a/share/qtcreator/welcomescreen/widgets/SideBar.qml b/share/qtcreator/welcomescreen/widgets/SideBar.qml index acf6501e64..5183c4b906 100644 --- a/share/qtcreator/welcomescreen/widgets/SideBar.qml +++ b/share/qtcreator/welcomescreen/widgets/SideBar.qml @@ -104,13 +104,7 @@ ColumnLayout { Text { text: qsTr("New to Qt?") font.pixelSize: 18 - font.bold: true - } - - Text { - text: qsTr("Get Started Now!") - font.pixelSize: 14 - font.bold: true + font.bold: false } Text { @@ -126,23 +120,24 @@ ColumnLayout { } Button { - text: qsTr("Get Started") + text: qsTr("Get Started Now") onClicked: gettingStarted.openSplitHelp("qthelp://org.qt-project.qtcreator/doc/creator-getting-started.html") } Item { - height: 8 + height: 18 width: parent.width } Column { x: 14 - RowLayout { + spacing: 16 + Row { spacing: 7 - Rectangle { + Image { width: 16 - height: 16 - color: "#4e4e4e" + height: 15 + source: "images/icons/onlineCommunity.png" } LinkedText { text: qsTr("Online Community") @@ -151,12 +146,12 @@ ColumnLayout { onClicked: gettingStarted.openUrl("http://qt-project.org/forums") } } - RowLayout { + Row { spacing: 7 - Rectangle { - width: 16 - height: 16 - color: "#4e4e4e" + Image { + height: 15 + width: 15 + source: "images/icons/blogs.png" } LinkedText { text: qsTr("Blogs") @@ -165,12 +160,12 @@ ColumnLayout { onClicked: gettingStarted.openUrl("http://planet.qt-project.org") } } - RowLayout { + Row { spacing: 7 - Rectangle { + Image { width: 16 - height: 16 - color: "#4e4e4e" + height: 15 + source: "images/icons/userGuide.png" } LinkedText { text: qsTr("User Guide") diff --git a/share/qtcreator/welcomescreen/widgets/images/icons/blogs.png b/share/qtcreator/welcomescreen/widgets/images/icons/blogs.png Binary files differnew file mode 100644 index 0000000000..c10b4a6f40 --- /dev/null +++ b/share/qtcreator/welcomescreen/widgets/images/icons/blogs.png diff --git a/share/qtcreator/welcomescreen/widgets/images/icons/communityIcon.png b/share/qtcreator/welcomescreen/widgets/images/icons/communityIcon.png Binary files differdeleted file mode 100644 index 96537e2851..0000000000 --- a/share/qtcreator/welcomescreen/widgets/images/icons/communityIcon.png +++ /dev/null diff --git a/share/qtcreator/welcomescreen/widgets/images/icons/createIcon.png b/share/qtcreator/welcomescreen/widgets/images/icons/createIcon.png Binary files differdeleted file mode 100644 index 0e0a23c7ad..0000000000 --- a/share/qtcreator/welcomescreen/widgets/images/icons/createIcon.png +++ /dev/null diff --git a/share/qtcreator/welcomescreen/widgets/images/icons/ico_community.png b/share/qtcreator/welcomescreen/widgets/images/icons/ico_community.png Binary files differdeleted file mode 100644 index 96537e2851..0000000000 --- a/share/qtcreator/welcomescreen/widgets/images/icons/ico_community.png +++ /dev/null diff --git a/share/qtcreator/welcomescreen/widgets/images/icons/onlineCommunity.png b/share/qtcreator/welcomescreen/widgets/images/icons/onlineCommunity.png Binary files differnew file mode 100644 index 0000000000..37101a045a --- /dev/null +++ b/share/qtcreator/welcomescreen/widgets/images/icons/onlineCommunity.png diff --git a/share/qtcreator/welcomescreen/widgets/images/icons/openIcon.png b/share/qtcreator/welcomescreen/widgets/images/icons/openIcon.png Binary files differdeleted file mode 100644 index 0871175628..0000000000 --- a/share/qtcreator/welcomescreen/widgets/images/icons/openIcon.png +++ /dev/null diff --git a/share/qtcreator/welcomescreen/widgets/images/icons/userGuide.png b/share/qtcreator/welcomescreen/widgets/images/icons/userGuide.png Binary files differnew file mode 100644 index 0000000000..c00db7ad65 --- /dev/null +++ b/share/qtcreator/welcomescreen/widgets/images/icons/userGuide.png diff --git a/share/qtcreator/welcomescreen/widgets/images/sessions.png b/share/qtcreator/welcomescreen/widgets/images/sessions.png Binary files differnew file mode 100644 index 0000000000..31c5de120a --- /dev/null +++ b/share/qtcreator/welcomescreen/widgets/images/sessions.png diff --git a/src/libs/3rdparty/cplusplus/AST.cpp b/src/libs/3rdparty/cplusplus/AST.cpp index 03dc59e889..5e166b83b2 100644 --- a/src/libs/3rdparty/cplusplus/AST.cpp +++ b/src/libs/3rdparty/cplusplus/AST.cpp @@ -29,10 +29,10 @@ /* - All firstToken/lastToken methods below which have a doxygen comment with + All firstToken/lastToken functions below which have a doxygen comment with \generated in it, will be re-generated when the tool "cplusplus-update-frontend" is run. - For methods which are hand-coded, or which should not be changed, make sure that + For functions which are hand-coded, or which should not be changed, make sure that the comment is gone. */ diff --git a/src/libs/aggregation/aggregate.cpp b/src/libs/aggregation/aggregate.cpp index 9a4f61c2a3..c6bd27dc53 100644 --- a/src/libs/aggregation/aggregate.cpp +++ b/src/libs/aggregation/aggregate.cpp @@ -56,7 +56,7 @@ other components in the Aggregate to the outside. Specifically that means: \list - \li They can be "cast" to each other (using query and query_all methods). + \li They can be "cast" to each other (using query and query_all functions). \li Their life cycle is coupled, i.e. whenever one is deleted all of them are. \endlist Components can be of any QObject derived type. @@ -69,7 +69,7 @@ [...] MyInterface *object = new MyInterface; // this is single inheritance \endcode - The query method works like a qobject_cast with normal objects: + The query function works like a qobject_cast with normal objects: \code Q_ASSERT(query<MyInterface>(object) == object); Q_ASSERT(query<MyInterfaceEx>(object) == 0); @@ -105,7 +105,7 @@ /*! \fn T *Aggregate::component() - Template method that returns the component with the given type, if there is one. + Template function that returns the component with the given type, if there is one. If there are multiple components with that type a random one is returned. \sa Aggregate::components() @@ -115,7 +115,7 @@ /*! \fn QList<T *> Aggregate::components() - Template method that returns all components with the given type, if there are any. + Template function that returns all components with the given type, if there are any. \sa Aggregate::component() \sa Aggregate::add() diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index 6ba998a6e4..0d8bbd2f31 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -474,7 +474,7 @@ void Document::setGlobalNamespace(Namespace *globalNamespace) * Extract the function name including scope at the given position. * * Note that a function (scope) starts at the name of that function, not at the return type. The - * implication is that this method will return an empty string when the line/column is on the + * implication is that this function will return an empty string when the line/column is on the * return type. * * \param line the line number, starting with line 1 diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp index 15beba1771..05a7a083d3 100644 --- a/src/libs/cplusplus/pp-engine.cpp +++ b/src/libs/cplusplus/pp-engine.cpp @@ -687,7 +687,7 @@ QString Preprocessor::State::guardStateToString(int guardState) * occurs inside the #ifndef block, but not nested inside other * #if/#ifdef/#ifndef blocks. * - * This method tracks the state, and is called from \c updateIncludeGuardState + * This function tracks the state, and is called from \c updateIncludeGuardState * which handles the most common no-op cases. * * @param hint indicates what kind of token is encountered in the input @@ -857,7 +857,7 @@ _Lagain: // to the macro that generated this token. In either case, the macro // that generated the token still needs to be blocked (!), which is // recorded in the token buffer. Removing the blocked macro and the - // empty token buffer happens the next time that this method is called. + // empty token buffer happens the next time that this function is called. } else { // No token buffer, so have the lexer scan the next token. tk->setSource(m_state.m_source); diff --git a/src/libs/extensionsystem/iplugin.cpp b/src/libs/extensionsystem/iplugin.cpp index 132e5078f3..e867062068 100644 --- a/src/libs/extensionsystem/iplugin.cpp +++ b/src/libs/extensionsystem/iplugin.cpp @@ -64,10 +64,10 @@ \list 1 \li All plugin libraries are loaded in \e{root-to-leaf} order of the dependency tree. - \li All plugins' initialize methods are called in \e{root-to-leaf} order + \li All plugins' initialize functions are called in \e{root-to-leaf} order of the dependency tree. This is a good place to put objects in the plugin manager's object pool. - \li All plugins' extensionsInitialized methods are called in \e{leaf-to-root} + \li All plugins' extensionsInitialized functions are called in \e{leaf-to-root} order of the dependency tree. At this point, plugins can be sure that all plugins that depend on this plugin have been initialized completely (implying that they have put @@ -79,7 +79,7 @@ Plugins have access to the plugin manager (and its object pool) via the PluginManager::instance() - method. + function. */ /*! @@ -87,10 +87,10 @@ \brief Called after the plugin has been loaded and the IPlugin instance has been created. - The initialize methods of plugins that depend - on this plugin are called after the initialize method of this plugin + The initialize functions of plugins that depend + on this plugin are called after the initialize function of this plugin has been called. Plugins should initialize their internal state in this - method. Returns if initialization of successful. If it wasn't successful, + function. Returns if initialization of successful. If it wasn't successful, the \a errorString should be set to a user-readable message describing the reason. @@ -100,11 +100,11 @@ /*! \fn void IPlugin::extensionsInitialized() - \brief Called after the IPlugin::initialize() method has been called, + \brief Called after the IPlugin::initialize() function has been called, and after both the IPlugin::initialize() and IPlugin::extensionsInitialized() - methods of plugins that depend on this plugin have been called. + functions of plugins that depend on this plugin have been called. - In this method, the plugin can assume that plugins that depend on + In this function, the plugin can assume that plugins that depend on this plugin are fully 'up and running'. It is a good place to look in the plugin manager's object pool for objects that have been provided by dependent plugins. @@ -115,17 +115,17 @@ /*! \fn bool IPlugin::delayedInitialize() - \brief Called after all plugins' IPlugin::extensionsInitialized() method has been called, - and after the IPlugin::delayedInitialize() method of plugins that depend on this plugin + \brief Called after all plugins' IPlugin::extensionsInitialized() function has been called, + and after the IPlugin::delayedInitialize() function of plugins that depend on this plugin have been called. - The plugins' delayedInitialize() methods are called after the application is already running, + The plugins' delayedInitialize() functions are called after the application is already running, with a few milliseconds delay to application startup, and between individual delayedInitialize - method calls. To avoid unnecessary delays, a plugin should return true from the method if it + function calls. To avoid unnecessary delays, a plugin should return true from the function if it actually implements it, to indicate that the next plugins' delayedInitialize() call should be delayed a few milliseconds to give input and paint events a chance to be processed. - This method can be used if a plugin needs to do non-trivial setup that doesn't + This function can be used if a plugin needs to do non-trivial setup that doesn't necessarily needs to be done directly at startup, but still should be done within a short time afterwards. This can increase the felt plugin/application startup time a lot, with very little effort. @@ -139,16 +139,16 @@ \brief Called during a shutdown sequence in the same order as initialization before the plugins get deleted in reverse order. - This method should be used to disconnect from other plugins, + This function should be used to disconnect from other plugins, hide all UI, and optimize shutdown in general. If a plugin needs to delay the real shutdown for a while, for example if it needs to wait for external processes to finish for a clean shutdown, - the plugin can return IPlugin::AsynchronousShutdown from this method. This + the plugin can return IPlugin::AsynchronousShutdown from this function. This will keep the main event loop running after the aboutToShutdown() sequence has finished, until all plugins requesting AsynchronousShutdown have sent the asynchronousShutdownFinished() signal. - The default implementation of this method does nothing and returns + The default implementation of this function does nothing and returns IPlugin::SynchronousShutdown. Returns IPlugin::AsynchronousShutdown if the plugin needs to perform @@ -160,7 +160,7 @@ /*! \fn QObject *IPlugin::remoteCommand(const QStringList &options, const QStringList &arguments) \brief When \QC is executed with the -client argument while already another instance of \QC - is running, this method of plugins is called in the running instance. + is running, this function of plugins is called in the running instance. Plugin-specific arguments are passed in \a options, while the rest of the arguments are passed in \a arguments. @@ -215,7 +215,7 @@ PluginSpec *IPlugin::pluginSpec() const /*! \fn void IPlugin::addObject(QObject *obj) - Convenience method that registers \a obj in the plugin manager's + Convenience function that registers \a obj in the plugin manager's plugin pool by just calling PluginManager::addObject(). */ void IPlugin::addObject(QObject *obj) @@ -225,7 +225,7 @@ void IPlugin::addObject(QObject *obj) /*! \fn void IPlugin::addAutoReleasedObject(QObject *obj) - Convenience method for registering \a obj in the plugin manager's + Convenience function for registering \a obj in the plugin manager's plugin pool. Usually, registered objects must be removed from the object pool and deleted by hand. Objects added to the pool via addAutoReleasedObject are automatically @@ -241,7 +241,7 @@ void IPlugin::addAutoReleasedObject(QObject *obj) /*! \fn void IPlugin::removeObject(QObject *obj) - Convenience method that unregisters \a obj from the plugin manager's + Convenience function that unregisters \a obj from the plugin manager's plugin pool by just calling PluginManager::removeObject(). */ void IPlugin::removeObject(QObject *obj) diff --git a/src/libs/extensionsystem/pluginerrorview.cpp b/src/libs/extensionsystem/pluginerrorview.cpp index d5c4fe7f56..e90cf11d83 100644 --- a/src/libs/extensionsystem/pluginerrorview.cpp +++ b/src/libs/extensionsystem/pluginerrorview.cpp @@ -91,7 +91,7 @@ void PluginErrorView::update(PluginSpec *spec) break; case PluginSpec::Initialized: text = tr("Initialized"); - tooltip = tr("Plugin's initialization method succeeded"); + tooltip = tr("Plugin's initialization function succeeded"); break; case PluginSpec::Running: text = tr("Running"); diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index c7ce379b16..2de78a7f13 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -108,8 +108,8 @@ enum { debugLeaks = 0 }; Plugins (and everybody else) can add objects to a common 'pool' that is located in the plugin manager. Objects in the pool must derive from QObject, there are no other prerequisites. All objects of a specified type can be retrieved from the object pool - via the getObjects() and getObject() methods. They are aware of Aggregation::Aggregate, i.e. - these methods use the Aggregation::query methods instead of a qobject_cast to determine + via the getObjects() and getObject() functions. They are aware of Aggregation::Aggregate, i.e. + these functions use the Aggregation::query functions instead of a qobject_cast to determine the matching objects. Whenever the state of the object pool changes a corresponding signal is emitted by the plugin manager. @@ -134,7 +134,7 @@ enum { debugLeaks = 0 }; object in the pool. This approach does neither require the "user" plugin being linked against the "provider" plugin nor a common shared header file. The exposed interface is implicitly given by the - invokable methods of the "provider" object in the object pool. + invokable functions of the "provider" object in the object pool. The \c{ExtensionSystem::invoke} function template encapsulates {ExtensionSystem::Invoker} construction for the common case where @@ -220,11 +220,11 @@ enum { debugLeaks = 0 }; Retrieves the object of a given type from the object pool. - This method is aware of Aggregation::Aggregate. That is, it uses - the \c Aggregation::query methods instead of \c qobject_cast to + This function is aware of Aggregation::Aggregate. That is, it uses + the \c Aggregation::query functions instead of \c qobject_cast to determine the type of an object. If there are more than one object of the given type in - the object pool, this method will choose an arbitrary one of them. + the object pool, this function will choose an arbitrary one of them. \sa addObject() */ @@ -234,8 +234,8 @@ enum { debugLeaks = 0 }; Retrieves all objects of a given type from the object pool. - This method is aware of Aggregation::Aggregate. That is, it uses - the \c Aggregation::query methods instead of \c qobject_cast to + This function is aware of Aggregation::Aggregate. That is, it uses + the \c Aggregation::query functions instead of \c qobject_cast to determine the type of an object. \sa addObject() @@ -570,7 +570,7 @@ void PluginManager::remoteArguments(const QString &serializedArgument, QObject * Application options always override any plugin's options. \a foundAppOptions is set to pairs of ("option string", "argument") for any application options that were found. - The command line options that were not processed can be retrieved via the arguments() method. + The command line options that were not processed can be retrieved via the arguments() function. If an error occurred (like missing argument for an option that requires one), \a errorString contains a descriptive message of the error. @@ -675,7 +675,7 @@ void PluginManager::startTests() if (!pluginSpec->plugin()) continue; - // Collect all test functions/methods of the plugin. + // Collect all test functions of the plugin. QStringList allTestFunctions; const QMetaObject *metaObject = pluginSpec->plugin()->metaObject(); diff --git a/src/libs/extensionsystem/pluginspec.cpp b/src/libs/extensionsystem/pluginspec.cpp index 1f6c8f8acd..dff461984e 100644 --- a/src/libs/extensionsystem/pluginspec.cpp +++ b/src/libs/extensionsystem/pluginspec.cpp @@ -128,19 +128,19 @@ information is available via the PluginSpec. \value Resolved The dependencies given in the description file have been - successfully found, and are available via the dependencySpecs() method. + successfully found, and are available via the dependencySpecs() function. \value Loaded The plugin's library is loaded and the plugin instance created (available through plugin()). \value Initialized - The plugin instance's IPlugin::initialize() method has been called + The plugin instance's IPlugin::initialize() function has been called and returned a success value. \value Running The plugin's dependencies are successfully initialized and extensionsInitialized has been called. The loading process is complete. \value Stopped - The plugin has been shut down, i.e. the plugin's IPlugin::aboutToShutdown() method has been called. + The plugin has been shut down, i.e. the plugin's IPlugin::aboutToShutdown() function has been called. \value Deleted The plugin instance has been deleted. */ diff --git a/src/libs/glsl/glslast.h b/src/libs/glsl/glslast.h index e203e16877..479a9514d1 100644 --- a/src/libs/glsl/glslast.h +++ b/src/libs/glsl/glslast.h @@ -751,7 +751,7 @@ public: : AST(Kind_StructField), name(_name), type(0) {} // Takes the outer shell of an array type with the innermost - // element type set to null. The fixInnerTypes() method will + // element type set to null. The fixInnerTypes() function will // set the innermost element type to a meaningful value. Field(const QString *_name, TypeAST *_type) : AST(Kind_StructField), name(_name), type(_type) {} diff --git a/src/libs/qmldebug/qpacketprotocol.cpp b/src/libs/qmldebug/qpacketprotocol.cpp index 6205ceec71..97792c2491 100644 --- a/src/libs/qmldebug/qpacketprotocol.cpp +++ b/src/libs/qmldebug/qpacketprotocol.cpp @@ -301,7 +301,7 @@ void QPacketProtocol::clear() /*! Returns the next unread packet, or an invalid QPacket instance if no packets - are available. This method does NOT block. + are available. This function does NOT block. */ QPacket QPacketProtocol::read() { diff --git a/src/libs/qmljs/parser/qmlerror.cpp b/src/libs/qmljs/parser/qmlerror.cpp index 09e90df4ef..1ea06d329f 100644 --- a/src/libs/qmljs/parser/qmlerror.cpp +++ b/src/libs/qmljs/parser/qmlerror.cpp @@ -44,13 +44,13 @@ QT_BEGIN_NAMESPACE QmlError includes a textual description of the error, as well as location information (the file, line, and column). The toString() - method creates a single-line, human-readable string containing all of + function creates a single-line, human-readable string containing all of this information, for example: \code file:///home/user/test.qml:7:8: Invalid property assignment: double expected \endcode - You can use qDebug() or qWarning() to output errors to the console. This method + You can use qDebug() or qWarning() to output errors to the console. This function will attempt to open the file indicated by the error and include additional contextual information. \code diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp index 1122e53ca4..09cd99cab5 100644 --- a/src/libs/qmljs/qmljscheck.cpp +++ b/src/libs/qmljs/qmljscheck.cpp @@ -1464,7 +1464,7 @@ bool Check::visit(TypeOfExpression *ast) /// When something is changed here, also change ReadingContext::lookupProperty in /// texttomodelmerger.cpp -/// ### Maybe put this into the context as a helper method. +/// ### Maybe put this into the context as a helper function. const Value *Check::checkScopeObjectMember(const UiQualifiedId *id) { if (!_importsOk) diff --git a/src/libs/qmljs/qmljsevaluate.cpp b/src/libs/qmljs/qmljsevaluate.cpp index 9f0db46a7a..443d0dd63b 100644 --- a/src/libs/qmljs/qmljsevaluate.cpp +++ b/src/libs/qmljs/qmljsevaluate.cpp @@ -46,10 +46,10 @@ using namespace QmlJS; Example: Pass in the AST for "1 + 2" and NumberValue will be returned. - In normal cases only the call operator (or the equivalent value() method) + In normal cases only the call operator (or the equivalent value() function) will be used. - The reference() method has the special behavior of not resolving \l{Reference}s + The reference() function has the special behavior of not resolving \l{Reference}s which can be useful when interested in the identity of a variable instead of its value. diff --git a/src/libs/qmljs/qmljsqrcparser.cpp b/src/libs/qmljs/qmljsqrcparser.cpp index b6f0bedbbe..1011443331 100644 --- a/src/libs/qmljs/qmljsqrcparser.cpp +++ b/src/libs/qmljs/qmljsqrcparser.cpp @@ -64,7 +64,7 @@ namespace Internal { * For a single qrc a given path maps to a single file, but when one has multiple * (platform specific exclusive) qrc files, then multiple files match, so QStringList are used. * - * Especially the collect* methods are thought as low level interface. + * Especially the collect* functions are thought as low level interface. */ class QrcParserPrivate { diff --git a/src/libs/qmljs/qmljsscopechain.cpp b/src/libs/qmljs/qmljsscopechain.cpp index a25c094db4..9ec4d0cf37 100644 --- a/src/libs/qmljs/qmljsscopechain.cpp +++ b/src/libs/qmljs/qmljsscopechain.cpp @@ -40,7 +40,7 @@ using namespace QmlJS; a specific location. \sa Document Context ScopeBuilder - A ScopeChain is used to perform global lookup with the lookup() method and + A ScopeChain is used to perform global lookup with the lookup() function and to access information about the enclosing scopes. Once constructed for a Document in a Context it represents the root scope of diff --git a/src/libs/qtcreatorcdbext/symbolgroup.cpp b/src/libs/qtcreatorcdbext/symbolgroup.cpp index 5edd3575f9..7d284841af 100644 --- a/src/libs/qtcreatorcdbext/symbolgroup.cpp +++ b/src/libs/qtcreatorcdbext/symbolgroup.cpp @@ -50,8 +50,8 @@ enum { debug = 0 }; \brief The SymbolGroup class creates a symbol group storing a tree of expanded symbols rooted on a fake "locals" root element. - Provides a find() method based on inames ("locals.this.i1.data") and - dump() methods used for GDBMI-format dumping and debug helpers. + Provides a find() function based on inames ("locals.this.i1.data") and + dump() functions used for GDBMI-format dumping and debug helpers. Qt Creator's WatchModel is fed from this class. It basically represents the symbol group tree with some additional node types (Reference and Map Node types. diff --git a/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp b/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp index 47168746fd..baddcc9789 100644 --- a/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp +++ b/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp @@ -2603,7 +2603,8 @@ static inline bool dumpQSharedPointer(const SymbolGroupValue &v, std::wostream & if (strongRef < 0 || weakRef < 0) return false; str << L"References: " << strongRef << '/' << weakRef; - *specialInfoIn = valueV.node(); + if (specialInfoIn) + *specialInfoIn = valueV.node(); return true; } diff --git a/src/libs/utils/ansiescapecodehandler.cpp b/src/libs/utils/ansiescapecodehandler.cpp index ecb2285dc5..0086255ff0 100644 --- a/src/libs/utils/ansiescapecodehandler.cpp +++ b/src/libs/utils/ansiescapecodehandler.cpp @@ -42,15 +42,15 @@ namespace Utils { Also, one instance of this class should not handle multiple streams (at least not at the same time). - Its main method is parseText(), which accepts text and default QTextCharFormat. - This method is designed to parse text and split colored text to smaller strings, + Its main function is parseText(), which accepts text and default QTextCharFormat. + This function is designed to parse text and split colored text to smaller strings, with their appropriate formatting information set inside QTextCharFormat. Usage: \list \li Create new instance of AnsiEscapeCodeHandler for a stream. \li To add new text, call parseText() with the text and a default QTextCharFormat. - The result of this method is a list of strings with formats set in appropriate + The result of this function is a list of strings with formats set in appropriate QTextCharFormat. \endlist */ diff --git a/src/libs/utils/fileinprojectfinder.cpp b/src/libs/utils/fileinprojectfinder.cpp index eb6b679c54..6fdfb81df4 100644 --- a/src/libs/utils/fileinprojectfinder.cpp +++ b/src/libs/utils/fileinprojectfinder.cpp @@ -112,7 +112,7 @@ void FileInProjectFinder::setSysroot(const QString &sysroot) /*! Returns the best match for the given file URL in the project directory. - The method first checks whether the file inside the project directory exists. + The function first checks whether the file inside the project directory exists. If not, the leading directory in the path is stripped, and the - now shorter - path is checked for existence, and so on. Second, it tries to locate the file in the sysroot folder specified. Third, we walk the list of project files, and search for a file name match diff --git a/src/libs/utils/json.cpp b/src/libs/utils/json.cpp index 8a56f9c4a9..b4d691566a 100644 --- a/src/libs/utils/json.cpp +++ b/src/libs/utils/json.cpp @@ -319,7 +319,7 @@ void JsonSchema::enterNestedPropertySchema(const QString &property) /*! * An array schema is allowed to have its \e items specification in the form of * another schema - * or in the form of an array of schemas [Sec. 5.5]. This methods checks whether this is case + * or in the form of an array of schemas [Sec. 5.5]. This functions checks whether this is case * in which the items are a schema. * * Returns whether or not the items from the array are a schema. @@ -340,7 +340,7 @@ void JsonSchema::enterNestedItemSchema() /*! * An array schema is allowed to have its \e items specification in the form of another schema - * or in the form of an array of schemas [Sec. 5.5]. This methods checks whether this is case + * or in the form of an array of schemas [Sec. 5.5]. This functions checks whether this is case * in which the items are an array of schemas. * * Returns whether or not the items from the array are a an array of schemas. @@ -366,7 +366,7 @@ int JsonSchema::itemArraySchemaSize() const * interested on). This shall only happen if the item at the supplied array index is of type * object, which is then assumed to be a schema. * - * The method also marks the context as being inside an array evaluation. + * The function also marks the context as being inside an array evaluation. * * Returns whether it was necessary to enter a schema for the supplied * array \a index, false if index is out of bounds. @@ -383,7 +383,7 @@ bool JsonSchema::maybeEnterNestedArraySchema(int index) /*! * The type of a schema can be specified in the form of a union type, which is basically an - * array of allowed types for the particular instance [Sec. 5.1]. This method checks whether + * array of allowed types for the particular instance [Sec. 5.1]. This function checks whether * the current schema is one of such. * * Returns whether or not the current schema specifies a union type. @@ -405,7 +405,7 @@ int JsonSchema::unionSchemaSize() const * This shall only happen if the item at the supplied union \a index, which is then assumed to be * a schema. * - * The method also marks the context as being inside an union evaluation. + * The function also marks the context as being inside an union evaluation. * * Returns whether or not it was necessary to enter a schema for the * supplied union index. diff --git a/src/libs/utils/json.h b/src/libs/utils/json.h index 853b4366e5..5efa8ab45e 100644 --- a/src/libs/utils/json.h +++ b/src/libs/utils/json.h @@ -263,7 +263,7 @@ class JsonSchemaManager; * corresponding nested schema. Afterwards, it's expected that one would "leave" such nested * schema. * - * All methods assume that the current "context" is a valid schema. Once an instance of this + * All functions assume that the current "context" is a valid schema. Once an instance of this * class is created the root schema is put on top of the stack. * */ @@ -350,7 +350,7 @@ private: QStringList properties(JsonObjectValue *v) const; JsonObjectValue *propertySchema(const QString &property, JsonObjectValue *v) const; - // TODO: Similar methods for other attributes which require looking into base schemas. + // TODO: Similar functions for other attributes which require looking into base schemas. static bool maybeSchemaName(const QString &s); diff --git a/src/libs/utils/tooltip/tooltip.cpp b/src/libs/utils/tooltip/tooltip.cpp index 4b46ab59fe..469fd5e33e 100644 --- a/src/libs/utils/tooltip/tooltip.cpp +++ b/src/libs/utils/tooltip/tooltip.cpp @@ -97,7 +97,7 @@ bool ToolTip::acceptShow(const TipContent &content, } #if !defined(QT_NO_EFFECTS) && !defined(Q_OS_MAC) // While the effect takes places it might be that although the widget is actually on - // screen the isVisible method doesn't return true. + // screen the isVisible function doesn't return true. else if (m_tip && (QApplication::isEffectEnabled(Qt::UI_FadeTooltip) || QApplication::isEffectEnabled(Qt::UI_AnimateTooltip))) { diff --git a/src/plugins/android/addnewavddialog.ui b/src/plugins/android/addnewavddialog.ui index 598a754c10..c73cc37ca8 100644 --- a/src/plugins/android/addnewavddialog.ui +++ b/src/plugins/android/addnewavddialog.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>250</width> - <height>149</height> + <height>161</height> </rect> </property> <property name="windowTitle"> @@ -63,6 +63,9 @@ <property name="maximum"> <number>9999999</number> </property> + <property name="value"> + <number>200</number> + </property> </widget> </item> <item row="1" column="1"> diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index a0db9a061a..ad76118014 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -502,17 +502,37 @@ QString AndroidConfigurations::createAVD(const QString &target, const QString &n QProcess proc; proc.start(androidToolPath().toString(), QStringList() << QLatin1String("create") << QLatin1String("avd") - << QLatin1String("-a") << QLatin1String("-t") << target + << QLatin1String("-t") << target << QLatin1String("-n") << name << QLatin1String("-b") << abi << QLatin1String("-c") << QString::fromLatin1("%1M").arg(sdcardSize)); if (!proc.waitForStarted()) return QString(); - proc.write(QByteArray("no\n")); - if (!proc.waitForFinished(-1)) { - proc.terminate(); - return QString(); + + proc.write(QByteArray("yes\n")); // yes to "Do you wish to create a custom hardware profile" + + QByteArray question; + while (true) { + proc.waitForReadyRead(500); + question += proc.readAllStandardOutput(); + if (question.endsWith(QByteArray("]:"))) { + // truncate to last line + int index = question.lastIndexOf(QByteArray("\n")); + if (index != -1) + question = question.mid(index); + if (question.contains("hw.gpu.enabled")) + proc.write(QByteArray("yes\n")); + else + proc.write(QByteArray("\n")); + question.clear(); + } + + if (proc.state() != QProcess::Running) + break; } + + proc.waitForFinished(); + if (proc.exitCode()) // error! return QString(); return name; @@ -787,10 +807,10 @@ void AndroidConfigurations::updateAutomaticKitList() // register new kits QList<Kit *> newKits; foreach (AndroidToolChain *tc, toolchains) { + if (tc->isSecondaryToolChain()) + continue; QList<QtSupport::BaseQtVersion *> qtVersions = qtVersionsForArch.value(tc->targetAbi().architecture()); foreach (QtSupport::BaseQtVersion *qt, qtVersions) { - if (tc->secondaryToolChain()) - continue; Kit *newKit = new Kit; newKit->setAutoDetected(true); newKit->setIconPath(Utils::FileName::fromString(QLatin1String(Constants::ANDROID_SETTINGS_CATEGORY_ICON))); @@ -798,7 +818,15 @@ void AndroidConfigurations::updateAutomaticKitList() ToolChainKitInformation::setToolChain(newKit, tc); QtSupport::QtKitInformation::setQtVersion(newKit, qt); DeviceKitInformation::setDevice(newKit, device); - Debugger::DebuggerKitInformation::setDebugger(newKit, tc->suggestedDebugger()); + + Debugger::DebuggerItem debugger; + debugger.setCommand(tc->suggestedDebugger()); + debugger.setEngineType(Debugger::GdbEngineType); + debugger.setDisplayName(tr("Android Debugger for %1").arg(tc->displayName())); + debugger.setAutoDetected(true); + debugger.setAbi(tc->targetAbi()); + Debugger::DebuggerKitInformation::setDebugger(newKit, debugger); + AndroidGdbServerKitInformation::setGdbSever(newKit, tc->suggestedGdbServer()); newKit->makeSticky(); newKits << newKit; @@ -879,6 +907,24 @@ AndroidConfigurations::AndroidConfigurations(QObject *parent) this, SLOT(clearDefaultDevices(ProjectExplorer::Project*))); } +Utils::FileName javaHomeForJavac(const QString &location) +{ + QFileInfo fileInfo(location); + int tries = 5; + while (tries > 0) { + QDir dir = fileInfo.dir(); + dir.cdUp(); + if (QFileInfo(dir.filePath(QLatin1String("lib/tools.jar"))).exists()) + return Utils::FileName::fromString(dir.path()); + if (fileInfo.isSymLink()) + fileInfo.setFile(fileInfo.symLinkTarget()); + else + break; + --tries; + } + return Utils::FileName(); +} + void AndroidConfigurations::load() { bool saveSettings = false; @@ -897,14 +943,18 @@ void AndroidConfigurations::load() } if (m_config.openJDKLocation.isEmpty()) { - Environment env = Environment::systemEnvironment(); - QString location = env.searchInPath(QLatin1String("javac")); - QFileInfo fi(location); - if (fi.exists() && fi.isExecutable() && !fi.isDir()) { - QDir parentDirectory = fi.canonicalPath(); - parentDirectory.cdUp(); // one up from bin - m_config.openJDKLocation = FileName::fromString(parentDirectory.absolutePath()); - saveSettings = true; + if (HostOsInfo::isLinuxHost()) { + Environment env = Environment::systemEnvironment(); + QString location = env.searchInPath(QLatin1String("javac")); + QFileInfo fi(location); + if (fi.exists() && fi.isExecutable() && !fi.isDir()) { + m_config.openJDKLocation = javaHomeForJavac(location); + saveSettings = true; + } + } else if (HostOsInfo::isMacHost()) { + QString javaHome = QLatin1String("/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home"); + if (QFileInfo(javaHome).exists()) + m_config.openJDKLocation = Utils::FileName::fromString(javaHome); } else if (HostOsInfo::isWindowsHost()) { QSettings settings(QLatin1String("HKEY_LOCAL_MACHINE\\SOFTWARE\\Javasoft\\Java Development Kit"), QSettings::NativeFormat); QStringList allVersions = settings.childGroups(); diff --git a/src/plugins/android/androiddeploystep.cpp b/src/plugins/android/androiddeploystep.cpp index 2af881aff6..b26860d393 100644 --- a/src/plugins/android/androiddeploystep.cpp +++ b/src/plugins/android/androiddeploystep.cpp @@ -94,7 +94,7 @@ void AndroidDeployStep::ctor() connect(ProjectExplorer::KitManager::instance(), SIGNAL(kitUpdated(ProjectExplorer::Kit*)), - this, SLOT(kitUpdated(ProjectExplorer::Kit *))); + this, SLOT(kitUpdated(ProjectExplorer::Kit*))); } bool AndroidDeployStep::init() diff --git a/src/plugins/android/androiddevice.cpp b/src/plugins/android/androiddevice.cpp index 8fd3d94e2d..a1b7521897 100644 --- a/src/plugins/android/androiddevice.cpp +++ b/src/plugins/android/androiddevice.cpp @@ -99,5 +99,10 @@ IDevice::Ptr AndroidDevice::clone() const return IDevice::Ptr(new AndroidDevice(*this)); } +QString AndroidDevice::qmlProfilerHost() const +{ + return QLatin1String("localhost"); +} + } // namespace Internal } // namespace Android diff --git a/src/plugins/android/androiddevice.h b/src/plugins/android/androiddevice.h index 1c08bca869..e371c87eba 100644 --- a/src/plugins/android/androiddevice.h +++ b/src/plugins/android/androiddevice.h @@ -50,6 +50,7 @@ public: ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const; ProjectExplorer::IDevice::Ptr clone() const; + QString qmlProfilerHost() const; protected: friend class AndroidDeviceFactory; diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp index 66b3f9c6da..db4af083ee 100644 --- a/src/plugins/android/androidmanifesteditorwidget.cpp +++ b/src/plugins/android/androidmanifesteditorwidget.cpp @@ -99,8 +99,7 @@ AndroidManifestEditorWidget::AndroidManifestEditorWidget(QWidget *parent, TextEd : TextEditor::PlainTextEditorWidget(parent), m_dirty(false), m_stayClean(false), - m_setAppName(false), - m_ah(ah) + m_setAppName(false) { QSharedPointer<AndroidManifestDocument> doc(new AndroidManifestDocument(this)); doc->setMimeType(QLatin1String(Constants::ANDROID_MANIFEST_MIME_TYPE)); @@ -875,7 +874,11 @@ int extractVersion(const QString &string) int index = string.indexOf(QLatin1Char(':')); if (index == -1) return 0; +#if QT_VERSION < 0x050000 + return string.mid(4, index - 4).toInt(); +#else return string.midRef(4, index - 4).toInt(); +#endif } void AndroidManifestEditorWidget::syncToEditor() diff --git a/src/plugins/android/androidmanifesteditorwidget.h b/src/plugins/android/androidmanifesteditorwidget.h index 72c3d3a4ee..6227258ce4 100644 --- a/src/plugins/android/androidmanifesteditorwidget.h +++ b/src/plugins/android/androidmanifesteditorwidget.h @@ -166,7 +166,6 @@ private: QPushButton *m_removePermissionButton; QComboBox *m_permissionsComboBox; - TextEditor::TextEditorActionHandler *m_ah; QWidget *m_overlayWidget; QTimer m_timerParseCheck; }; diff --git a/src/plugins/android/androidtoolchain.cpp b/src/plugins/android/androidtoolchain.cpp index d65c36a48e..a1148870d1 100644 --- a/src/plugins/android/androidtoolchain.cpp +++ b/src/plugins/android/androidtoolchain.cpp @@ -229,12 +229,12 @@ QString AndroidToolChain::makeCommand(const Utils::Environment &env) const return tmp.isEmpty() ? make : tmp; } -QString AndroidToolChain::ndkToolChainVersion() +QString AndroidToolChain::ndkToolChainVersion() const { return m_ndkToolChainVersion; } -bool AndroidToolChain::secondaryToolChain() const +bool AndroidToolChain::isSecondaryToolChain() const { return m_secondaryToolChain; } diff --git a/src/plugins/android/androidtoolchain.h b/src/plugins/android/androidtoolchain.h index 0f60da4372..0ce13be219 100644 --- a/src/plugins/android/androidtoolchain.h +++ b/src/plugins/android/androidtoolchain.h @@ -59,9 +59,9 @@ public: QList<Utils::FileName> suggestedMkspecList() const; QString makeCommand(const Utils::Environment &environment) const; - QString ndkToolChainVersion(); + QString ndkToolChainVersion() const; - bool secondaryToolChain() const; + bool isSecondaryToolChain() const; void setSecondaryToolChain(bool b); protected: diff --git a/src/plugins/autotoolsprojectmanager/autotoolsproject.h b/src/plugins/autotoolsprojectmanager/autotoolsproject.h index e9bc643c6b..739c2535f5 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsproject.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsproject.h @@ -119,7 +119,7 @@ private: const QStringList &files); /** - * Helper method for buildFileNodeTree(): Inserts a new folder-node for + * Helper function for buildFileNodeTree(): Inserts a new folder-node for * the directory \p nodeDir and inserts it into \p nodes. If no parent * folder exists, it will be created recursively. */ diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h b/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h index 4257e2ad7f..4dd627be0b 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h @@ -75,7 +75,7 @@ private: AutotoolsProject *m_project; Core::IDocument *m_projectFile; - // TODO: AutotoolsProject calls the protected method addFileNodes() from AutotoolsProjectNode. + // TODO: AutotoolsProject calls the protected function addFileNodes() from AutotoolsProjectNode. // Instead of this friend declaration, a public interface might be preferable. friend class AutotoolsProject; }; diff --git a/src/plugins/autotoolsprojectmanager/makefileparser.h b/src/plugins/autotoolsprojectmanager/makefileparser.h index 9638cebba7..894201bef5 100644 --- a/src/plugins/autotoolsprojectmanager/makefileparser.h +++ b/src/plugins/autotoolsprojectmanager/makefileparser.h @@ -65,7 +65,7 @@ public: /** * Parses the makefile. Must be invoked at least once, otherwise - * the getter methods of MakefileParser will return empty values. + * the getter functions of MakefileParser will return empty values. * @return True, if the parsing was successful. If false is returned, * the makefile could not be opened. */ @@ -116,15 +116,15 @@ public: QStringList cxxflags() const; /** - * Cancels the parsing. Calling this method only makes sense, if the - * parser runs in a different thread than the caller of this method. - * The method is thread-safe. + * Cancels the parsing. Calling this function only makes sense, if the + * parser runs in a different thread than the caller of this function. + * The function is thread-safe. */ void cancel(); /** * @return True, if the parser has been cancelled by MakefileParser::cancel(). - * The method is thread-safe. + * The function is thread-safe. */ bool isCanceled() const; @@ -176,14 +176,14 @@ private: void parseSubDirs(); /** - * Helper method for parseDefaultExtensions(). Returns recursively all sources + * Helper function for parseDefaultExtensions(). Returns recursively all sources * inside the directory \p directory that match with the extension \p extension. */ QStringList directorySources(const QString &directory, const QStringList &extensions); /** - * Helper method for all parse-methods. Returns each value of a target as string in + * Helper function for all parse-functions. Returns each value of a target as string in * the stringlist. The current line m_line is used as starting point and increased * if the current line ends with a \. * @@ -205,7 +205,7 @@ private: /** * Adds recursively all sources of the current folder to m_sources and removes * all duplicates. The Makefile.am is not parsed, only the folders and files are - * handled. This method should only be called, if the sources parsing in the Makefile.am + * handled. This function should only be called, if the sources parsing in the Makefile.am * failed because variables (e.g. $(test)) have been used. */ void addAllSources(); @@ -218,7 +218,7 @@ private: void parseIncludePaths(); /** - * Helper method for MakefileParser::directorySources(). Appends the name of the headerfile + * Helper function for MakefileParser::directorySources(). Appends the name of the headerfile * to \p list, if the header could be found in the directory specified by \p dir. * The headerfile base name is defined by \p fileName. */ diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationwidget.ui b/src/plugins/baremetal/baremetaldeviceconfigurationwidget.ui index 6abfdb57d8..17236089be 100644 --- a/src/plugins/baremetal/baremetaldeviceconfigurationwidget.ui +++ b/src/plugins/baremetal/baremetaldeviceconfigurationwidget.ui @@ -32,7 +32,7 @@ <locale language="English" country="UnitedStates"/> </property> <property name="text"> - <string>GDB Host:</string> + <string>GDB host:</string> </property> </widget> </item> @@ -45,7 +45,7 @@ <locale language="English" country="UnitedStates"/> </property> <property name="text"> - <string>GDB Port:</string> + <string>GDB port:</string> </property> </widget> </item> diff --git a/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp b/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp index 84f039c85b..08d6254aef 100644 --- a/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp +++ b/src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp @@ -41,7 +41,7 @@ BareMetalDeviceConfigurationWizardSetupPage::BareMetalDeviceConfigurationWizardS QWizardPage(parent), d(new Internal::BareMetalDeviceConfigurationWizardSetupPagePrivate) { d->ui.setupUi(this); - setTitle(tr("Gdbserver/hardware debugger setup")); + setTitle(tr("Set up GDB Server or Hardware Debugger")); setSubTitle(QLatin1String(" ")); // For Qt bug (background color) connect(d->ui.hostNameLineEdit,SIGNAL(textChanged(QString)),SIGNAL(completeChanged())); connect(d->ui.nameLineEdit,SIGNAL(textChanged(QString)),SIGNAL(completeChanged())); diff --git a/src/plugins/baremetal/baremetalrunconfiguration.cpp b/src/plugins/baremetal/baremetalrunconfiguration.cpp index 14e0c6abf6..ca11d9ae45 100644 --- a/src/plugins/baremetal/baremetalrunconfiguration.cpp +++ b/src/plugins/baremetal/baremetalrunconfiguration.cpp @@ -157,9 +157,9 @@ QString BareMetalRunConfiguration::defaultDisplayName() { if (!d->projectFilePath.isEmpty()) //: %1 is the name of the project run via hardware debugger - return tr("%1 (via gdbserver/hardware debugger)").arg(QFileInfo(d->projectFilePath).completeBaseName()); + return tr("%1 (via GDB server or hardware debugger)").arg(QFileInfo(d->projectFilePath).completeBaseName()); //: Bare Metal run configuration default run name - return tr("Run on gdbserver/hardware debugger"); + return tr("Run on GDB server or hardware debugger"); } QString BareMetalRunConfiguration::localExecutableFilePath() const diff --git a/src/plugins/baremetal/baremetalrunconfigurationfactory.cpp b/src/plugins/baremetal/baremetalrunconfigurationfactory.cpp index 96700490d6..5f611b1da9 100644 --- a/src/plugins/baremetal/baremetalrunconfigurationfactory.cpp +++ b/src/plugins/baremetal/baremetalrunconfigurationfactory.cpp @@ -98,7 +98,7 @@ QList<Core::Id> BareMetalRunConfigurationFactory::availableCreationIds(Target *p QString BareMetalRunConfigurationFactory::displayNameForId(const Core::Id id) const { - return tr("%1 (on gdbserver/Hardware Debugger)") + return tr("%1 (on GDB server or hardware debugger)") .arg(QFileInfo(pathFromId(id)).completeBaseName()); } diff --git a/src/plugins/bazaar/bazaarclient.cpp b/src/plugins/bazaar/bazaarclient.cpp index 431ff8c6a5..5df1804457 100644 --- a/src/plugins/bazaar/bazaarclient.cpp +++ b/src/plugins/bazaar/bazaarclient.cpp @@ -128,6 +128,16 @@ QString BazaarClient::findTopLevelForFile(const QFileInfo &file) const repositoryCheckFile); } +bool BazaarClient::managesFile(const QString &workingDirectory, const QString &fileName) const +{ + QStringList args(QLatin1String("status")); + args << fileName; + QByteArray stdOut; + if (!vcsFullySynchronousExec(workingDirectory, args, &stdOut)) + return false; + return !stdOut.startsWith("unknown"); +} + void BazaarClient::view(const QString &source, const QString &id, const QStringList &extraOptions) { QStringList args(QLatin1String("log")); diff --git a/src/plugins/bazaar/bazaarclient.h b/src/plugins/bazaar/bazaarclient.h index d0b1f4a216..3dc756ef58 100644 --- a/src/plugins/bazaar/bazaarclient.h +++ b/src/plugins/bazaar/bazaarclient.h @@ -57,6 +57,7 @@ public: void view(const QString &source, const QString &id, const QStringList &extraOptions = QStringList()); QString findTopLevelForFile(const QFileInfo &file) const; + bool managesFile(const QString &workingDirectory, const QString &fileName) const; protected: Core::Id vcsEditorKind(VcsCommand cmd) const; diff --git a/src/plugins/bazaar/bazaarcontrol.cpp b/src/plugins/bazaar/bazaarcontrol.cpp index bf480761a0..5d27b46f63 100644 --- a/src/plugins/bazaar/bazaarcontrol.cpp +++ b/src/plugins/bazaar/bazaarcontrol.cpp @@ -61,6 +61,11 @@ bool BazaarControl::managesDirectory(const QString &directory, QString *topLevel return !topLevelFound.isEmpty(); } +bool BazaarControl::managesFile(const QString &workingDirectory, const QString &fileName) const +{ + return m_bazaarClient->managesFile(workingDirectory, fileName); +} + bool BazaarControl::isConfigured() const { const QString binary = m_bazaarClient->settings()->binaryPath(); diff --git a/src/plugins/bazaar/bazaarcontrol.h b/src/plugins/bazaar/bazaarcontrol.h index 673b70a524..94e57aebdd 100644 --- a/src/plugins/bazaar/bazaarcontrol.h +++ b/src/plugins/bazaar/bazaarcontrol.h @@ -53,6 +53,7 @@ public: Core::Id id() const; bool managesDirectory(const QString &filename, QString *topLevel = 0) const; + bool managesFile(const QString &workingDirectory, const QString &fileName) const; bool isConfigured() const; bool supportsOperation(Operation operation) const; bool vcsOpen(const QString &fileName); diff --git a/src/plugins/bazaar/bazaarplugin.cpp b/src/plugins/bazaar/bazaarplugin.cpp index 6253dad0b4..47045f8eb6 100644 --- a/src/plugins/bazaar/bazaarplugin.cpp +++ b/src/plugins/bazaar/bazaarplugin.cpp @@ -647,7 +647,7 @@ bool BazaarPlugin::submitEditorAboutToClose() Core::IDocument *editorDocument = commitEditor->document(); QTC_ASSERT(editorDocument, return true); - bool dummyPrompt = m_bazaarSettings.boolValue(BazaarSettings::promptOnSubmitKey); + bool dummyPrompt = false; const VcsBase::VcsBaseSubmitEditor::PromptSubmitResult response = commitEditor->promptSubmit(tr("Close Commit Editor"), tr("Do you want to commit the changes?"), tr("Message check failed. Do you want to proceed?"), diff --git a/src/plugins/bazaar/bazaarplugin.h b/src/plugins/bazaar/bazaarplugin.h index 0baa0157c1..ed93dd221f 100644 --- a/src/plugins/bazaar/bazaarplugin.h +++ b/src/plugins/bazaar/bazaarplugin.h @@ -118,7 +118,7 @@ protected: bool submitEditorAboutToClose(); private: - // Methods + // Functions void createMenu(); void createSubmitEditorActions(); void createFileActions(const Core::Context &context); diff --git a/src/plugins/bazaar/optionspage.cpp b/src/plugins/bazaar/optionspage.cpp index 8eea22e6a5..34d2caee04 100644 --- a/src/plugins/bazaar/optionspage.cpp +++ b/src/plugins/bazaar/optionspage.cpp @@ -54,7 +54,6 @@ BazaarSettings OptionsPageWidget::settings() const s.setValue(BazaarSettings::userEmailKey, m_ui.defaultEmailLineEdit->text().trimmed()); s.setValue(BazaarSettings::logCountKey, m_ui.logEntriesCount->value()); s.setValue(BazaarSettings::timeoutKey, m_ui.timeout->value()); - s.setValue(BazaarSettings::promptOnSubmitKey, m_ui.promptOnSubmitCheckBox->isChecked()); return s; } @@ -65,7 +64,6 @@ void OptionsPageWidget::setSettings(const BazaarSettings &s) m_ui.defaultEmailLineEdit->setText(s.stringValue(BazaarSettings::userEmailKey)); m_ui.logEntriesCount->setValue(s.intValue(BazaarSettings::logCountKey)); m_ui.timeout->setValue(s.intValue(BazaarSettings::timeoutKey)); - m_ui.promptOnSubmitCheckBox->setChecked(s.boolValue(BazaarSettings::promptOnSubmitKey)); } QString OptionsPageWidget::searchKeywords() const @@ -81,7 +79,6 @@ QString OptionsPageWidget::searchKeywords() const << sep << m_ui.miscGroupBox->title() << sep << m_ui.showLogEntriesLabel->text() << sep << m_ui.timeoutSecondsLabel->text() - << sep << m_ui.promptOnSubmitCheckBox->text() ; rc.remove(QLatin1Char('&')); return rc; diff --git a/src/plugins/bazaar/optionspage.ui b/src/plugins/bazaar/optionspage.ui index 755e108d41..297e5d1fea 100644 --- a/src/plugins/bazaar/optionspage.ui +++ b/src/plugins/bazaar/optionspage.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>649</width> - <height>337</height> + <height>268</height> </rect> </property> <property name="windowTitle"> @@ -132,16 +132,6 @@ </property> </spacer> </item> - <item row="1" column="0" colspan="2"> - <widget class="QCheckBox" name="promptOnSubmitCheckBox"> - <property name="text"> - <string>Prompt on submit</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> </layout> </widget> </item> diff --git a/src/plugins/classview/classviewnavigationwidget.cpp b/src/plugins/classview/classviewnavigationwidget.cpp index 846a210281..7f7418b43a 100644 --- a/src/plugins/classview/classviewnavigationwidget.cpp +++ b/src/plugins/classview/classviewnavigationwidget.cpp @@ -52,7 +52,7 @@ namespace Internal { \class NavigationWidgetPrivate The NavigationWidgetPrivate class provides internal data structures and - methods for NavigationWidget. + functions for NavigationWidget. */ class NavigationWidgetPrivate @@ -256,7 +256,7 @@ void NavigationWidget::onItemActivated(const QModelIndex &index) /*! Receives new data for the tree. \a result is a pointer to the Class View - model root item. The method does nothing if null is passed. + model root item. The function does nothing if null is passed. */ void NavigationWidget::onDataUpdate(QSharedPointer<QStandardItem> result) diff --git a/src/plugins/clearcase/clearcasecontrol.cpp b/src/plugins/clearcase/clearcasecontrol.cpp index 79f81242a1..c2f7dd44e0 100644 --- a/src/plugins/clearcase/clearcasecontrol.cpp +++ b/src/plugins/clearcase/clearcasecontrol.cpp @@ -134,6 +134,11 @@ bool ClearCaseControl::managesDirectory(const QString &directory, QString *topLe return m_plugin->managesDirectory(directory, topLevel); } +bool ClearCaseControl::managesFile(const QString &workingDirectory, const QString &fileName) const +{ + return m_plugin->managesFile(workingDirectory, fileName); +} + bool ClearCaseControl::vcsAnnotate(const QString &file, int line) { const QFileInfo fi(file); diff --git a/src/plugins/clearcase/clearcasecontrol.h b/src/plugins/clearcase/clearcasecontrol.h index f4a0fb5743..fa980595e2 100644 --- a/src/plugins/clearcase/clearcasecontrol.h +++ b/src/plugins/clearcase/clearcasecontrol.h @@ -48,6 +48,7 @@ public: Core::Id id() const; bool managesDirectory(const QString &directory, QString *topLevel = 0) const; + bool managesFile(const QString &workingDirectory, const QString &fileName) const; bool isConfigured() const; diff --git a/src/plugins/clearcase/clearcaseplugin.cpp b/src/plugins/clearcase/clearcaseplugin.cpp index 0ad3228d7a..4775f2e876 100644 --- a/src/plugins/clearcase/clearcaseplugin.cpp +++ b/src/plugins/clearcase/clearcaseplugin.cpp @@ -612,10 +612,10 @@ void ClearCasePlugin::diffCheckInFiles(const QStringList &files) ccDiffWithPred(m_checkInView, files); } -static inline void setDiffBaseDirectory(IEditor *editor, const QString &db) +static inline void setWorkingDirectory(IEditor *editor, const QString &wd) { if (VcsBase::VcsBaseEditorWidget *ve = qobject_cast<VcsBase::VcsBaseEditorWidget*>(editor->widget())) - ve->setDiffBaseDirectory(db); + ve->setWorkingDirectory(wd); } //! retrieve full location of predecessor of \a version @@ -934,14 +934,14 @@ void ClearCasePlugin::ccDiffWithPred(const QString &workingDir, const QStringLis if (IEditor *existingEditor = VcsBase::VcsBaseEditorWidget::locateEditorByTag(tag)) { existingEditor->document()->setContents(result.toUtf8()); EditorManager::activateEditor(existingEditor); - setDiffBaseDirectory(existingEditor, workingDir); + setWorkingDirectory(existingEditor, workingDir); return; } diffname = QDir::toNativeSeparators(files.first()); } const QString title = QString::fromLatin1("cc diff %1").arg(diffname); IEditor *editor = showOutputInEditor(title, result, VcsBase::DiffOutput, source, codec); - setDiffBaseDirectory(editor, workingDir); + setWorkingDirectory(editor, workingDir); VcsBase::VcsBaseEditorWidget::tagEditor(editor, tag); ClearCaseEditor *diffEditorWidget = qobject_cast<ClearCaseEditor *>(editor->widget()); QTC_ASSERT(diffEditorWidget, return); @@ -1037,7 +1037,7 @@ void ClearCasePlugin::diffActivity() m_diffPrefix.clear(); const QString title = QString::fromLatin1("%1.patch").arg(activity); IEditor *editor = showOutputInEditor(title, result, VcsBase::DiffOutput, activity, 0); - setDiffBaseDirectory(editor, topLevel); + setWorkingDirectory(editor, topLevel); } void ClearCasePlugin::diffCurrentFile() @@ -1253,12 +1253,12 @@ void ClearCasePlugin::annotateCurrentFile() vcsAnnotate(state.currentFileTopLevel(), state.relativeCurrentFile()); } -void ClearCasePlugin::annotateVersion(const QString &file, - const QString &revision, - int lineNr) +void ClearCasePlugin::annotateVersion(const QString &workingDirectory, + const QString &file, + const QString &revision, + int lineNr) { - const QFileInfo fi(file); - vcsAnnotate(fi.absolutePath(), fi.fileName(), revision, lineNr); + vcsAnnotate(workingDirectory, file, revision, lineNr); } void ClearCasePlugin::vcsAnnotate(const QString &workingDir, const QString &file, @@ -1402,8 +1402,8 @@ IEditor *ClearCasePlugin::showOutputInEditor(const QString& title, const QString << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec); QString s = title; IEditor *editor = EditorManager::openEditorWithContents(id, &s, output.toUtf8()); - connect(editor, SIGNAL(annotateRevisionRequested(QString,QString,int)), - this, SLOT(annotateVersion(QString,QString,int))); + connect(editor, SIGNAL(annotateRevisionRequested(QString,QString,QString,int)), + this, SLOT(annotateVersion(QString,QString,QString,int))); ClearCaseEditor *e = qobject_cast<ClearCaseEditor*>(editor->widget()); if (!e) return 0; @@ -1850,6 +1850,13 @@ bool ClearCasePlugin::ccCheckUcm(const QString &viewname, const QString &working return QRegExp(QLatin1String("(^|\\n)ucm\\n")).indexIn(catcsData) != -1; } +bool ClearCasePlugin::managesFile(const QString &workingDirectory, const QString &fileName) const +{ + QStringList args; + args << QLatin1String("ls") << fileName; + return runCleartoolSync(workingDirectory, args).contains(QLatin1String("@@")); +} + ViewData ClearCasePlugin::ccGetView(const QString &workingDir) const { static QHash<QString, ViewData> viewCache; diff --git a/src/plugins/clearcase/clearcaseplugin.h b/src/plugins/clearcase/clearcaseplugin.h index fb011182da..929844197a 100644 --- a/src/plugins/clearcase/clearcaseplugin.h +++ b/src/plugins/clearcase/clearcaseplugin.h @@ -166,6 +166,7 @@ public: void setStatus(const QString &file, FileStatus::Status status, bool update = true); bool ccCheckUcm(const QString &viewname, const QString &workingDir) const; + bool managesFile(const QString &workingDirectory, const QString &fileName) const; public slots: void vcsAnnotate(const QString &workingDir, const QString &file, @@ -185,7 +186,7 @@ private slots: void startCheckInCurrentFile(); void historyCurrentFile(); void annotateCurrentFile(); - void annotateVersion(const QString &file, const QString &revision, int lineNumber); + void annotateVersion(const QString &workingDirectory, const QString &file, const QString &revision, int lineNumber); void describe(const QString &source, const QString &changeNr); void viewStatus(); void checkInSelected(); diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index b480c9b5db..fe0c2561d0 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -208,7 +208,7 @@ QString CMakeManager::findCbpFile(const QDir &directory) { // Find the cbp file // the cbp file is named like the project() command in the CMakeList.txt file - // so this method below could find the wrong cbp file, if the user changes the project() + // so this function below could find the wrong cbp file, if the user changes the project() // 2name QDateTime t; QString file; diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp index e3567b2fbb..ab45581cdd 100644 --- a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp +++ b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp @@ -54,7 +54,7 @@ using namespace Core::Internal; You don't create instances of this class directly, but instead use the \l{ActionManager::createMenu()} - and \l{ActionManager::createMenuBar()} methods. + and \l{ActionManager::createMenuBar()} functions. Retrieve existing action containers for an ID with \l{ActionManager::actionContainer()}. diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp index 3bf3d902ca..a4b2080e93 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp +++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp @@ -59,8 +59,8 @@ using namespace Core::Internal; menu items and keyboard shortcuts. The ActionManager is the central bookkeeper of actions and their shortcuts and layout. - It is a singleton containing mostly static methods. If you need access to the instance, - e.g. for connecting to signals, is its ActionManager::instance() method. + It is a singleton containing mostly static functions. If you need access to the instance, + e.g. for connecting to signals, is its ActionManager::instance() function. The main reasons for the need of this class is to provide a central place where the user can specify all his keyboard shortcuts, and to provide a solution for actions that should @@ -92,7 +92,7 @@ using namespace Core::Internal; \section1 Registering Actions To register a globally active action "My Action" - put the following in your plugin's IPlugin::initialize method: + put the following in your plugin's IPlugin::initialize function: \code QAction *myAction = new QAction(tr("My Action"), this); Core::Command *cmd = Core::ActionManager::registerAction(myAction, @@ -113,7 +113,7 @@ using namespace Core::Internal; Also use the ActionManager to add items to registered action containers like the applications menu bar or menus in that menu bar. To do this, you register your action via the - registerAction methods, get the action container for a specific ID (like specified in + registerAction functions, get the action container for a specific ID (like specified in the Core::Constants namespace) with a call of actionContainer(const Id&) and add your command to this container. @@ -126,7 +126,7 @@ using namespace Core::Internal; \list \li Always register your actions and shortcuts! \li Register your actions and shortcuts during your plugin's \l{ExtensionSystem::IPlugin::initialize()} - or \l{ExtensionSystem::IPlugin::extensionsInitialized()} methods, otherwise the shortcuts won't appear + or \l{ExtensionSystem::IPlugin::extensionsInitialized()} functions, otherwise the shortcuts won't appear in the keyboard settings dialog from the beginning. \li When registering an action with \c{cmd=registerAction(action, id, contexts)} be sure to connect your own action \c{connect(action, SIGNAL...)} but make \c{cmd->action()} visible to the user, i.e. @@ -176,7 +176,7 @@ ActionManager *ActionManager::instance() or to add menu items to the menu. The ActionManager owns the returned ActionContainer. Add your menu to some other menu or a menu bar via the - ActionManager::actionContainer and ActionContainer::addMenu methods. + ActionManager::actionContainer and ActionContainer::addMenu functions. */ ActionContainer *ActionManager::createMenu(Id id) { diff --git a/src/plugins/coreplugin/basefilewizard.cpp b/src/plugins/coreplugin/basefilewizard.cpp index 4df472472c..bb26839348 100644 --- a/src/plugins/coreplugin/basefilewizard.cpp +++ b/src/plugins/coreplugin/basefilewizard.cpp @@ -162,13 +162,13 @@ void WizardEventLoop::rejected() \brief The BaseFileWizard class implements a generic wizard for creating files. - The following abstract methods must be implemented: + The following abstract functions must be implemented: \list \li createWizardDialog(): Called to create the QWizard dialog to be shown. \li generateFiles(): Generates file content. \endlist - The behaviour can be further customized by overwriting the virtual method \c postGenerateFiles(), + The behaviour can be further customized by overwriting the virtual function \c postGenerateFiles(), which is called after generating the files. \sa Core::GeneratedFile, Core::BaseFileWizardParameters, Core::StandardFileWizard diff --git a/src/plugins/coreplugin/dialogs/iwizard.cpp b/src/plugins/coreplugin/dialogs/iwizard.cpp index d6134c8dba..f1b638cd50 100644 --- a/src/plugins/coreplugin/dialogs/iwizard.cpp +++ b/src/plugins/coreplugin/dialogs/iwizard.cpp @@ -51,7 +51,7 @@ instead use one of the predefined wizards and adapt it to your needs. To make your wizard known to the system, add your IWizard instance to the - plugin manager's object pool in your plugin's initialize method: + plugin manager's object pool in your plugin's initialize function: \code bool MyPlugin::initialize(const QStringList &arguments, QString *errorString) { @@ -133,7 +133,7 @@ const QString &platform, const QVariantMap &variables) - This method is executed when the wizard has been selected by the user + This function is executed when the wizard has been selected by the user for execution. Any dialogs the wizard opens should use the given \a parent. The \a path argument is a suggestion for the location where files should be created. The wizard should fill this in its path selection elements as a diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index e7c2573e5a..9e7dbbdba3 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -81,7 +81,7 @@ as expected. On expected file changes all IDocument objects are notified to reload themselves. - The DocumentManager service also provides two convenience methods for saving + The DocumentManager service also provides two convenience functions for saving files: \c saveModifiedFiles() and \c saveModifiedFilesSilently(). Both take a list of FileInterfaces as an argument, and return the list of files which were _not_ saved. @@ -517,7 +517,7 @@ void DocumentManager::expectFileChange(const QString &fileName) d->m_expectedFileNames.insert(fileName); } -/* only called from unblock and unexpect file change methods */ +/* only called from unblock and unexpect file change functions */ static void updateExpectedState(const QString &fileName) { if (fileName.isEmpty()) diff --git a/src/plugins/coreplugin/documentmanager.h b/src/plugins/coreplugin/documentmanager.h index 6839b01ff4..70168a2b23 100644 --- a/src/plugins/coreplugin/documentmanager.h +++ b/src/plugins/coreplugin/documentmanager.h @@ -84,7 +84,7 @@ public: static void setCurrentFile(const QString &filePath); static QString currentFile(); - // helper methods + // helper functions static QString fixFileName(const QString &fileName, FixMode fixmode); static bool saveDocument(IDocument *document, const QString &fileName = QString(), bool *isReadOnly = 0); diff --git a/src/plugins/coreplugin/editormanager/documentmodel.h b/src/plugins/coreplugin/editormanager/documentmodel.h index 2ec74ff401..bc494050a9 100644 --- a/src/plugins/coreplugin/editormanager/documentmodel.h +++ b/src/plugins/coreplugin/editormanager/documentmodel.h @@ -87,7 +87,7 @@ public: QList<IEditor *> editorsForDocuments(const QList<IDocument *> &documents) const; QList<IEditor *> oneEditorForEachOpenedDocument() const; - // editor manager related methods, nobody else should call it + // editor manager related functions, nobody else should call it void addEditor(IEditor *editor, bool *isNewDocument); void addRestoredDocument(const QString &fileName, const QString &displayName, const Id &id); Entry *firstRestoredDocument() const; diff --git a/src/plugins/coreplugin/fileiconprovider.cpp b/src/plugins/coreplugin/fileiconprovider.cpp index 867d00eb6c..b136f8287c 100644 --- a/src/plugins/coreplugin/fileiconprovider.cpp +++ b/src/plugins/coreplugin/fileiconprovider.cpp @@ -57,7 +57,7 @@ using namespace Utils; own overlay icon handling (Mac/Windows). Plugins can register custom overlay icons via registerIconOverlayForSuffix(), and - retrieve icons via the icon() method. + retrieve icons via the icon() function. */ // Cache icons in a list of pairs suffix/icon which should be faster than diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 38bf0a128f..7564a59f02 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -161,7 +161,7 @@ Returns the absolute path in the users directory that is used for resources like project templates. - Use this method for finding the place for resources that the user may + Use this function for finding the place for resources that the user may write to, for example, to allow for custom palettes or templates. */ @@ -263,7 +263,7 @@ Enables plugins to perform some pre-end-of-life actions. The application is guaranteed to shut down after this signal is emitted. - It is there as an addition to the usual plugin lifecycle methods, namely + It is there as an addition to the usual plugin lifecycle functions, namely \c IPlugin::aboutToShutdown(), just for convenience. */ diff --git a/src/plugins/coreplugin/icorelistener.cpp b/src/plugins/coreplugin/icorelistener.cpp index 08ee9895e2..8c620812df 100644 --- a/src/plugins/coreplugin/icorelistener.cpp +++ b/src/plugins/coreplugin/icorelistener.cpp @@ -48,7 +48,7 @@ Guidelines for implementing the class: \list - \li Return \c false from the implemented method if you want to prevent + \li Return \c false from the implemented function if you want to prevent the event. \li Add your implementing object to the plugin managers objects: \c{ExtensionSystem::PluginManager::instance()->addObject(yourImplementingObject)} diff --git a/src/plugins/coreplugin/iversioncontrol.h b/src/plugins/coreplugin/iversioncontrol.h index 4ba0277a71..329f687f21 100644 --- a/src/plugins/coreplugin/iversioncontrol.h +++ b/src/plugins/coreplugin/iversioncontrol.h @@ -81,6 +81,14 @@ public: virtual bool managesDirectory(const QString &filename, QString *topLevel = 0) const = 0; /*! + * Returns whether \a fileName is managed by this version control. + * + * \a workingDirectory is assumed to be part of a valid repository (not necessarily its + * top level). \a fileName is expected to be relative to workingDirectory. + */ + virtual bool managesFile(const QString &workingDirectory, const QString &fileName) const = 0; + + /*! * Returns true is the VCS is configured to run. */ virtual bool isConfigured() const = 0; diff --git a/src/plugins/coreplugin/progressmanager/progressmanager.cpp b/src/plugins/coreplugin/progressmanager/progressmanager.cpp index 361f96a875..444f19296b 100644 --- a/src/plugins/coreplugin/progressmanager/progressmanager.cpp +++ b/src/plugins/coreplugin/progressmanager/progressmanager.cpp @@ -72,7 +72,7 @@ using namespace Core::Internal; The progress indicator also allows the user to cancel the task. You get the single instance of this class via the - Core::ICore::progressManager() method. + Core::ICore::progressManager() function. \section1 Registering a task The ProgressManager API uses QtConcurrent as the basis for defining @@ -110,7 +110,7 @@ using namespace Core::Internal; \endtable To register a task you create your \c QFuture<void> object, and call - addTask(). This method returns a + addTask(). This function returns a \l{Core::FutureProgress}{FutureProgress} object that you can use to further customize the progress bar's appearance. See the \l{Core::FutureProgress}{FutureProgress} documentation for @@ -122,16 +122,16 @@ using namespace Core::Internal; \section2 Create a threaded task with QtConcurrent The first option is to directly use QtConcurrent to actually start a task concurrently in a different thread. - QtConcurrent has several different methods to run e.g. - a class method in a different thread. Qt Creator itself + QtConcurrent has several different functions to run e.g. + a class function in a different thread. Qt Creator itself adds a few more in \c{src/libs/qtconcurrent/runextensions.h}. - The QtConcurrent methods to run a concurrent task return a + The QtConcurrent functions to run a concurrent task return a \c QFuture object. This is what you want to give the - ProgressManager in the addTask() method. + ProgressManager in the addTask() function. Have a look at e.g Locator::ILocatorFilter. Locator filters implement - a method \c refresh which takes a \c QFutureInterface object - as a parameter. These methods look something like: + a function \c refresh which takes a \c QFutureInterface object + as a parameter. These functions look something like: \code void Filter::refresh(QFutureInterface<void> &future) { future.setProgressRange(0, MAX); @@ -145,7 +145,7 @@ using namespace Core::Internal; } \endcode - The actual refresh, which calls all the filters' refresh methods + The actual refresh, which calls all the filters' refresh functions in a different thread, looks like this: \code QFuture<void> task = QtConcurrent::run(&ILocatorFilter::refresh, filters); @@ -154,7 +154,7 @@ using namespace Core::Internal; Locator::Constants::TASK_INDEX); \endcode First, we tell QtConcurrent to start a thread which calls all the filters' - refresh method. After that we register the returned QFuture object + refresh function. After that we register the returned QFuture object with the ProgressManager. \section2 Manually create QtConcurrent objects for your thread @@ -184,7 +184,7 @@ using namespace Core::Internal; We register the task with the ProgressManager, using the internal QFuture object that has been created for our QFutureInterface object. Next we report that the task has begun and start doing our actual - work, regularly reporting the progress via the methods + work, regularly reporting the progress via the functions in QFutureInterface. After the long taking operation has finished, we report so through the QFutureInterface object, and delete it afterwards. @@ -192,7 +192,7 @@ using namespace Core::Internal; \section1 Customizing progress appearance You can set a custom widget to show below the progress bar itself, - using the FutureProgress object returned by the addTask() method. + using the FutureProgress object returned by the addTask() function. Also use this object to get notified when the user clicks on the progress indicator. */ @@ -231,8 +231,8 @@ using namespace Core::Internal; which can be used to further customize. The FutureProgress object's life is managed by the ProgressManager and is guaranteed to live only until the next event loop cycle, or until the next call of addTask. - If you want to use the returned FutureProgress later than directly after calling this method, - you will need to use protective methods (like wrapping the returned object in QPointer and + If you want to use the returned FutureProgress later than directly after calling this function, + you will need to use protective functions (like wrapping the returned object in QPointer and checking for 0 whenever you use it). */ diff --git a/src/plugins/coreplugin/variablechooser.cpp b/src/plugins/coreplugin/variablechooser.cpp index 71a3199a28..354dac430c 100644 --- a/src/plugins/coreplugin/variablechooser.cpp +++ b/src/plugins/coreplugin/variablechooser.cpp @@ -58,7 +58,7 @@ using namespace Core; * * The variable chooser monitors focus changes of all children of its parent widget. * When a text control gets focus, the variable chooser checks if it has variable support set, - * either through the addVariableSupport() method or by manually setting the + * either through the addVariableSupport() function or by manually setting the * custom kVariableSupportProperty on the control. If the control supports variables, * a tool button which opens the variable chooser is shown in it while it has focus. * diff --git a/src/plugins/coreplugin/variablemanager.cpp b/src/plugins/coreplugin/variablemanager.cpp index 873a6481b5..a4f126d6e8 100644 --- a/src/plugins/coreplugin/variablemanager.cpp +++ b/src/plugins/coreplugin/variablemanager.cpp @@ -122,9 +122,9 @@ public: If there are conditions where your variable is not valid, you should call VariableManager::remove(kMyVariable) in updateVariable(). - For variables that refer to a file, you should use the convenience methods + For variables that refer to a file, you should use the convenience functions VariableManager::registerFileVariables(), VariableManager::fileVariableValue() and - VariableManager::isFileVariable(). The methods take a variable prefix, like \c MyFileVariable, + VariableManager::isFileVariable(). The functions take a variable prefix, like \c MyFileVariable, and automatically handle standardized postfixes like \c{:FilePath}, \c{:Path} and \c{:FileBaseName}, resulting in the combined variables, such as \c{MyFileVariable:FilePath}. @@ -162,12 +162,12 @@ public: \li Using VariableManager::expandedString(). This is the most comfortable way to get a string with variable values expanded, but also the least flexible one. If this is sufficient for you, use it. - \li Using the Utils::expandMacros() methods. These take a string and a macro expander (for which + \li Using the Utils::expandMacros() functions. These take a string and a macro expander (for which you would use the one provided by the variable manager). Mostly the same as VariableManager::expandedString(), but also has a variant that does the replacement inline instead of returning a new string. \li Using Utils::QtcProcess::expandMacros(). This expands the string while conforming to the - quoting rules of the platform it is run on. Use this method with the variable manager's + quoting rules of the platform it is run on. Use this function with the variable manager's macro expander if your string will be passed as a command line parameter string to an external command. \li Writing your own macro expander that nests the variable manager's macro expander. And then @@ -208,7 +208,7 @@ VariableManager::~VariableManager() * Used to set the \a value of a \a variable. Most of the time this is only done when * requested by VariableManager::variableUpdateRequested(). If the value of the variable * does not change, or changes very seldom, you can also keep the value up to date by calling - * this method whenever the value changes. + * this function whenever the value changes. * * As long as insert() was never called for a variable, it will not have a value, not even * an empty string, meaning that the variable will not be expanded when expanding strings. @@ -273,8 +273,8 @@ Utils::AbstractMacroExpander *VariableManager::macroExpander() } /*! - * Returns the variable manager instance, for connecting to signals. All other methods are static - * and should be called as class methods, not through the instance. + * Returns the variable manager instance, for connecting to signals. All other functions are static + * and should be called as class functions, not through the instance. */ QObject *VariableManager::instance() { @@ -294,7 +294,7 @@ void VariableManager::registerVariable(const QByteArray &variable, const QString } /*! - * Convenience method to register several variables with the same \a prefix, that have a file + * Convenience function to register several variables with the same \a prefix, that have a file * as a value. Takes the prefix and registers variables like \c{prefix:FilePath} and * \c{prefix:Path}, with descriptions that start with the given \a heading. * For example \c{registerFileVariables("CurrentDocument", tr("Current Document"))} registers diff --git a/src/plugins/coreplugin/vcsmanager.cpp b/src/plugins/coreplugin/vcsmanager.cpp index c2419d8beb..d58a678d46 100644 --- a/src/plugins/coreplugin/vcsmanager.cpp +++ b/src/plugins/coreplugin/vcsmanager.cpp @@ -271,14 +271,18 @@ IVersionControl* VcsManager::findVersionControlForDirectory(const QString &input // Register Vcs(s) with the cache QString tmpDir = QFileInfo(directory).canonicalFilePath(); - const QChar slash = QLatin1Char('/'); - const StringVersionControlPairs::const_iterator cend = allThatCanManage.constEnd(); - for (StringVersionControlPairs::const_iterator i = allThatCanManage.constBegin(); i != cend; ++i) { - d->cache(i->second, i->first, tmpDir); - tmpDir = i->first; - const int slashPos = tmpDir.lastIndexOf(slash); - if (slashPos >= 0) - tmpDir.truncate(slashPos); + // directory might refer to a historical directory which doesn't exist. + // In this case, don't cache it. + if (!tmpDir.isEmpty()) { + const QChar slash = QLatin1Char('/'); + const StringVersionControlPairs::const_iterator cend = allThatCanManage.constEnd(); + for (StringVersionControlPairs::const_iterator i = allThatCanManage.constBegin(); i != cend; ++i) { + d->cache(i->second, i->first, tmpDir); + tmpDir = i->first; + const int slashPos = tmpDir.lastIndexOf(slash); + if (slashPos >= 0) + tmpDir.truncate(slashPos); + } } // return result @@ -412,11 +416,20 @@ void VcsManager::promptToAdd(const QString &directory, const QStringList &fileNa if (!vc || !vc->supportsOperation(Core::IVersionControl::AddOperation)) return; + QStringList unmanagedFiles; + QDir dir(directory); + foreach (const QString &fileName, fileNames) { + if (!vc->managesFile(directory, dir.relativeFilePath(fileName))) + unmanagedFiles << fileName; + } + if (unmanagedFiles.isEmpty()) + return; + Internal::AddToVcsDialog dlg(Core::ICore::mainWindow(), VcsManager::msgAddToVcsTitle(), - fileNames, vc->displayName()); + unmanagedFiles, vc->displayName()); if (dlg.exec() == QDialog::Accepted) { QStringList notAddedToVc; - foreach (const QString &file, fileNames) { + foreach (const QString &file, unmanagedFiles) { if (!vc->vcsAdd(file)) notAddedToVc << file; } diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index bd848509c6..7b36de8cf0 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -1023,7 +1023,7 @@ void CPPEditorWidget::jumpToOutlineElement(int index) // the view's currentIndex is updated, so we want to use that. // When the scroll wheel was used on the combo box, // the view's currentIndex is not updated, - // but the passed index to this method is correct. + // but the passed index to this function is correct. // So, if the view has a current index, we reset it, to be able // to distinguish wheel events later if (modelIndex.isValid()) diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index 4735be7018..4ffa0d93d6 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -128,7 +128,7 @@ void CppEditorPlugin::initializeEditor(CPPEditorWidget *editor) editor->setLanguageSettingsId(CppTools::Constants::CPP_SETTINGS_ID); TextEditor::TextEditorSettings::initializeEditor(editor); - // method combo box sorting + // function combo box sorting connect(this, SIGNAL(outlineSortingChanged(bool)), editor, SLOT(setSortedOutline(bool))); } @@ -210,7 +210,7 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err contextMenu->addAction(cmd); cppToolsMenu->addAction(cmd); - QAction *switchDeclarationDefinition = new QAction(tr("Switch Between Method Declaration/Definition"), this); + QAction *switchDeclarationDefinition = new QAction(tr("Switch Between Function Declaration/Definition"), this); cmd = ActionManager::registerAction(switchDeclarationDefinition, Constants::SWITCH_DECLARATION_DEFINITION, context, true); cmd->setDefaultKeySequence(QKeySequence(tr("Shift+F2"))); @@ -223,7 +223,7 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err cppToolsMenu->addAction(cmd); QAction *openDeclarationDefinitionInNextSplit = - new QAction(tr("Open Method Declaration/Definition in Next Split"), this); + new QAction(tr("Open Function Declaration/Definition in Next Split"), this); cmd = ActionManager::registerAction(openDeclarationDefinitionInNextSplit, Constants::OPEN_DECLARATION_DEFINITION_IN_NEXT_SPLIT, context, true); cmd->setDefaultKeySequence(QKeySequence(Utils::HostOsInfo::isMacHost() diff --git a/src/plugins/cppeditor/cpppreprocessoradditionwidget.cpp b/src/plugins/cppeditor/cpppreprocessoradditionwidget.cpp index 23a93224a3..7762af59cc 100644 --- a/src/plugins/cppeditor/cpppreprocessoradditionwidget.cpp +++ b/src/plugins/cppeditor/cpppreprocessoradditionwidget.cpp @@ -32,9 +32,9 @@ #include "cppsnippetprovider.h" -#include "utils/tooltip/tipcontents.h" -#include "utils/tooltip/tooltip.h" -#include "projectexplorer/project.h" +#include <utils/tooltip/tipcontents.h> +#include <utils/tooltip/tooltip.h> +#include <projectexplorer/project.h> #include <QDebug> @@ -49,6 +49,7 @@ PreProcessorAdditionWidget::PreProcessorAdditionWidget(QWidget *parent) prov.decorateEditor(ui->additionalEdit); setAttribute(Qt::WA_QuitOnClose, false); setFocusPolicy(Qt::StrongFocus); + ui->additionalEdit->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); } PreProcessorAdditionWidget::~PreProcessorAdditionWidget() @@ -66,31 +67,31 @@ PreProcessorAdditionPopUp *PreProcessorAdditionPopUp::instance() void PreProcessorAdditionPopUp::show(QWidget *parent, const QList<CppTools::ProjectPart::Ptr> &projectParts) { - widget = new PreProcessorAdditionWidget(); - originalPartAdditions.clear(); + m_widget = new PreProcessorAdditionWidget(); + m_originalPartAdditions.clear(); foreach (CppTools::ProjectPart::Ptr projectPart, projectParts) { ProjectPartAddition addition; addition.projectPart = projectPart; - widget->ui->projectComboBox->addItem(projectPart->displayName); + m_widget->ui->projectComboBox->addItem(projectPart->displayName); addition.additionalDefines = projectPart->project ->additionalCppDefines().value(projectPart->projectFile).toByteArray(); - originalPartAdditions << addition; + m_originalPartAdditions << addition; } - partAdditions = originalPartAdditions; + m_partAdditions = m_originalPartAdditions; - widget->ui->additionalEdit->setPlainText(QLatin1String( - partAdditions[widget->ui->projectComboBox->currentIndex()].additionalDefines)); + m_widget->ui->additionalEdit->setPlainText(QLatin1String( + m_partAdditions[m_widget->ui->projectComboBox->currentIndex()].additionalDefines)); QPoint pos = parent->mapToGlobal(parent->rect().topRight()); - pos.setX(pos.x() - widget->width()); - showInternal(pos, Utils::WidgetContent(widget, true), parent, QRect()); + pos.setX(pos.x() - m_widget->width()); + showInternal(pos, Utils::WidgetContent(m_widget, true), parent, QRect()); - connect(widget->ui->additionalEdit, SIGNAL(textChanged()), SLOT(textChanged())); - connect(widget->ui->projectComboBox, SIGNAL(currentIndexChanged(int)), + connect(m_widget->ui->additionalEdit, SIGNAL(textChanged()), SLOT(textChanged())); + connect(m_widget->ui->projectComboBox, SIGNAL(currentIndexChanged(int)), SLOT(projectChanged(int))); - connect(widget, SIGNAL(finished()), SLOT(finish())); - connect(widget->ui->buttonBox, SIGNAL(accepted()), SLOT(apply())); - connect(widget->ui->buttonBox, SIGNAL(rejected()), SLOT(cancel())); + connect(m_widget, SIGNAL(finished()), SLOT(finish())); + connect(m_widget->ui->buttonBox, SIGNAL(accepted()), SLOT(apply())); + connect(m_widget->ui->buttonBox, SIGNAL(rejected()), SLOT(cancel())); } bool PreProcessorAdditionPopUp::eventFilter(QObject *o, QEvent *event) @@ -99,7 +100,7 @@ bool PreProcessorAdditionPopUp::eventFilter(QObject *o, QEvent *event) switch (event->type()) { case QEvent::Leave: // This event would hide the ToolTip because the view isn't a child of the WidgetContent - if (widget->ui->projectComboBox->view() == qApp->focusWidget()) + if (m_widget->ui->projectComboBox->view() == qApp->focusWidget()) return false; break; case QEvent::KeyPress: @@ -116,7 +117,7 @@ bool PreProcessorAdditionPopUp::eventFilter(QObject *o, QEvent *event) case QEvent::MouseButtonDblClick: case QEvent::Wheel: // This event would hide the ToolTip because the viewport isn't a child of the WidgetContent - if (o == widget->ui->projectComboBox->view()->viewport()) + if (o == m_widget->ui->projectComboBox->view()->viewport()) return false; break; default: @@ -127,15 +128,15 @@ bool PreProcessorAdditionPopUp::eventFilter(QObject *o, QEvent *event) void PreProcessorAdditionPopUp::textChanged() { - partAdditions[widget->ui->projectComboBox->currentIndex()].additionalDefines - = widget->ui->additionalEdit->toPlainText().toLatin1(); + m_partAdditions[m_widget->ui->projectComboBox->currentIndex()].additionalDefines + = m_widget->ui->additionalEdit->toPlainText().toLatin1(); } void PreProcessorAdditionPopUp::finish() { - widget->disconnect(this); - foreach (ProjectPartAddition partAddition, originalPartAdditions) { + m_widget->disconnect(this); + foreach (ProjectPartAddition partAddition, m_originalPartAdditions) { QVariantMap settings = partAddition.projectPart->project->additionalCppDefines(); if (!settings[partAddition.projectPart->projectFile].toString().isEmpty() && !partAddition.additionalDefines.isEmpty()) { @@ -143,26 +144,28 @@ void PreProcessorAdditionPopUp::finish() partAddition.projectPart->project->setAdditionalCppDefines(settings); } } - emit finished(originalPartAdditions[widget->ui->projectComboBox->currentIndex()].additionalDefines); + emit finished(m_originalPartAdditions.value(m_widget->ui->projectComboBox->currentIndex()) + .additionalDefines); } void PreProcessorAdditionPopUp::projectChanged(int index) { - widget->ui->additionalEdit->setPlainText(QLatin1String(partAdditions[index].additionalDefines)); + m_widget->ui->additionalEdit->setPlainText( + QLatin1String(m_partAdditions[index].additionalDefines)); } void PreProcessorAdditionPopUp::apply() { - originalPartAdditions = partAdditions; + m_originalPartAdditions = m_partAdditions; hideTipImmediately(); } void PreProcessorAdditionPopUp::cancel() { - partAdditions = originalPartAdditions; + m_partAdditions = m_originalPartAdditions; hideTipImmediately(); } PreProcessorAdditionPopUp::PreProcessorAdditionPopUp() - : widget(0) + : m_widget(0) {} diff --git a/src/plugins/cppeditor/cpppreprocessoradditionwidget.h b/src/plugins/cppeditor/cpppreprocessoradditionwidget.h index d69a3d9de3..828805ca1d 100644 --- a/src/plugins/cppeditor/cpppreprocessoradditionwidget.h +++ b/src/plugins/cppeditor/cpppreprocessoradditionwidget.h @@ -84,9 +84,9 @@ private: QByteArray additionalDefines; }; - PreProcessorAdditionWidget* widget; - QList<ProjectPartAddition> originalPartAdditions; - QList<ProjectPartAddition> partAdditions; + PreProcessorAdditionWidget* m_widget; + QList<ProjectPartAddition> m_originalPartAdditions; + QList<ProjectPartAddition> m_partAdditions; }; diff --git a/src/plugins/cppeditor/cppquickfix.h b/src/plugins/cppeditor/cppquickfix.h index 16466682b7..f9f4ca4963 100644 --- a/src/plugins/cppeditor/cppquickfix.h +++ b/src/plugins/cppeditor/cppquickfix.h @@ -67,7 +67,7 @@ public: TextEditor::QuickFixOperations &result); /*! - Implement this method to match and create the appropriate + Implement this function to match and create the appropriate CppQuickFixOperation objects. */ virtual void match(const CppQuickFixInterface &interface, diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 4802a3a346..dcdd879686 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -1302,14 +1302,14 @@ void TranslateStringLiteral::match(const CppQuickFixInterface &interface, QSharedPointer<Control> control = interface->context().bindings()->control(); const Name *trName = control->identifier("tr"); - // Check whether we are in a method: + // Check whether we are in a function: const QString description = QApplication::translate("CppTools::QuickFix", "Mark as Translatable"); for (int i = path.size() - 1; i >= 0; --i) { if (FunctionDefinitionAST *definition = path.at(i)->asFunctionDefinition()) { Function *function = definition->symbol; ClassOrNamespace *b = interface->context().lookupType(function); if (b) { - // Do we have a tr method? + // Do we have a tr function? foreach (const LookupItem &r, b->find(trName)) { Symbol *s = r.declaration(); if (s->type()->isFunctionType()) { @@ -2180,7 +2180,7 @@ void ReformatPointerDeclaration::match(const CppQuickFixInterface &interface, PointerDeclarationFormatter::RespectCursor); if (cursor.hasSelection()) { - // This will no work always as expected since this method is only called if + // This will no work always as expected since this function is only called if // interface-path() is not empty. If the user selects the whole document via // ctrl-a and there is an empty line in the end, then the cursor is not on // any AST and therefore no quick fix will be triggered. diff --git a/src/plugins/cppeditor/cppvirtualfunctionassistprovider.cpp b/src/plugins/cppeditor/cppvirtualfunctionassistprovider.cpp index 7d3e2d1cb9..7e16d2cf28 100644 --- a/src/plugins/cppeditor/cppvirtualfunctionassistprovider.cpp +++ b/src/plugins/cppeditor/cppvirtualfunctionassistprovider.cpp @@ -252,11 +252,6 @@ static bool isVirtualFunction_helper(const Function *function, foreach (const LookupItem &item, results) { if (Symbol *symbol = item.declaration()) { if (Function *functionType = symbol->type()->asFunctionType()) { - if (!functionType) { - if (Template *t = item.type()->asTemplateType()) - if ((symbol = t->declaration())) - functionType = symbol->type()->asFunctionType(); - } const bool foundSuitable = virtualType == Virtual ? functionType->isVirtual() : functionType->isPureVirtual(); @@ -282,13 +277,14 @@ bool FunctionHelper::isPureVirtualFunction(const Function *function, const Snaps } QList<Symbol *> FunctionHelper::overrides(Class *startClass, Function *function, - const Snapshot &snapshot) + const Snapshot &snapshot) { QList<Symbol *> result; - QTC_ASSERT(function && startClass, return result); + QTC_ASSERT(startClass && function, return result); FullySpecifiedType referenceType = function->type(); const Name *referenceName = function->name(); + QTC_ASSERT(referenceName && referenceType.isValid(), return result); // Add itself result << function; @@ -315,7 +311,9 @@ QList<Symbol *> FunctionHelper::overrides(Class *startClass, Function *function, for (int i = 0, total = c->memberCount(); i < total; ++i) { Symbol *candidate = c->memberAt(i); const Name *candidateName = candidate->name(); - FullySpecifiedType candidateType = candidate->type(); + const FullySpecifiedType candidateType = candidate->type(); + if (!candidateName || !candidateType.isValid()) + continue; if (candidateName->isEqualTo(referenceName) && candidateType.isEqualTo(referenceType)) result << candidate; } diff --git a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp index 441af4b440..19f33336ae 100644 --- a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp +++ b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp @@ -43,7 +43,7 @@ /*! - Tests for Follow Symbol Under Cursor and Switch Between Method Declaration/Definition + Tests for Follow Symbol Under Cursor and Switch Between Function Declaration/Definition Section numbers refer to @@ -187,7 +187,7 @@ public: /** * Encapsulates the whole process of setting up several editors, positioning the cursor, - * executing Follow Symbol Under Cursor or Switch Between Method Declaration/Definition + * executing Follow Symbol Under Cursor or Switch Between Function Declaration/Definition * and checking the result. */ class TestCase diff --git a/src/plugins/cpptools/cppchecksymbols.cpp b/src/plugins/cpptools/cppchecksymbols.cpp index 066e71f619..4aaef9c7e6 100644 --- a/src/plugins/cpptools/cppchecksymbols.cpp +++ b/src/plugins/cpptools/cppchecksymbols.cpp @@ -517,10 +517,10 @@ bool CheckSymbols::visit(SimpleDeclarationAST *ast) if ((_usages.back().kind != CppHighlightingSupport::VirtualMethodUse)) { if (funTy->isOverride()) warning(declrIdNameAST, QCoreApplication::translate( - "CPlusplus::CheckSymbols", "Only virtual methods can be marked 'override'")); + "CPlusplus::CheckSymbols", "Only virtual functions can be marked 'override'")); else if (funTy->isFinal()) warning(declrIdNameAST, QCoreApplication::translate( - "CPlusPlus::CheckSymbols", "Only virtual methods can be marked 'final'")); + "CPlusPlus::CheckSymbols", "Only virtual functions can be marked 'final'")); } } } diff --git a/src/plugins/cpptools/cppcodestylesettingspage.ui b/src/plugins/cpptools/cppcodestylesettingspage.ui index fed6d45722..0206b96549 100644 --- a/src/plugins/cpptools/cppcodestylesettingspage.ui +++ b/src/plugins/cpptools/cppcodestylesettingspage.ui @@ -17,7 +17,7 @@ <item> <widget class="QTabWidget" name="categoryTab"> <property name="currentIndex"> - <number>5</number> + <number>0</number> </property> <widget class="QWidget" name="generalTab"> <attribute name="title"> @@ -101,7 +101,7 @@ <item> <widget class="QCheckBox" name="indentFunctionBody"> <property name="text"> - <string>Statements within method body</string> + <string>Statements within function body</string> </property> </widget> </item> @@ -192,7 +192,7 @@ <item> <widget class="QCheckBox" name="indentFunctionBraces"> <property name="text"> - <string>Method declarations</string> + <string>Function declarations</string> </property> </widget> </item> diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index 4dcbb2b6ea..fd4430320c 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -380,7 +380,7 @@ QByteArray CppModelManager::internalDefinedMacros() const return macros; } -/// This method will aquire the mutex! +/// This function will aquire the mutex! void CppModelManager::dumpModelManagerConfiguration() { // Tons of debug output... diff --git a/src/plugins/cpptools/cppmodelmanagerinterface.h b/src/plugins/cpptools/cppmodelmanagerinterface.h index b0c01d9a38..eacfa6f756 100644 --- a/src/plugins/cpptools/cppmodelmanagerinterface.h +++ b/src/plugins/cpptools/cppmodelmanagerinterface.h @@ -273,7 +273,7 @@ signals: void documentUpdated(CPlusPlus::Document::Ptr doc); void sourceFilesRefreshed(const QStringList &files); - /// \brief Emitted after updateProjectInfo method is called on the model-manager. + /// \brief Emitted after updateProjectInfo function is called on the model-manager. /// /// Other classes can use this to get notified when the \c ProjectExplorer has updated the parts. void projectPartsUpdated(ProjectExplorer::Project *project); diff --git a/src/plugins/cpptools/cpptoolseditorsupport.cpp b/src/plugins/cpptools/cpptoolseditorsupport.cpp index fb02d392cf..631b1c1a44 100644 --- a/src/plugins/cpptools/cpptoolseditorsupport.cpp +++ b/src/plugins/cpptools/cpptoolseditorsupport.cpp @@ -383,7 +383,7 @@ void CppEditorSupport::startHighlighting() } } -/// \brief This slot puts the new diagnostics into the editorUpdates. This method has to be called +/// \brief This slot puts the new diagnostics into the editorUpdates. This function has to be called /// on the UI thread. void CppEditorSupport::onDiagnosticsChanged() { diff --git a/src/plugins/cpptools/symbolsfindfilter.cpp b/src/plugins/cpptools/symbolsfindfilter.cpp index ad15b7d6bc..f9a8d5f326 100644 --- a/src/plugins/cpptools/symbolsfindfilter.cpp +++ b/src/plugins/cpptools/symbolsfindfilter.cpp @@ -246,7 +246,7 @@ QString SymbolsFindFilter::toolTip(Find::FindFlags findFlags) const if (m_symbolsToSearch & SymbolSearcher::Classes) types.append(tr("Classes")); if (m_symbolsToSearch & SymbolSearcher::Functions) - types.append(tr("Methods")); + types.append(tr("Functions")); if (m_symbolsToSearch & SymbolSearcher::Enums) types.append(tr("Enums")); if (m_symbolsToSearch & SymbolSearcher::Declarations) @@ -274,7 +274,7 @@ SymbolsFindFilterConfigWidget::SymbolsFindFilterConfigWidget(SymbolsFindFilter * m_typeClasses = new QCheckBox(tr("Classes")); layout->addWidget(m_typeClasses, 0, 1); - m_typeMethods = new QCheckBox(tr("Methods")); + m_typeMethods = new QCheckBox(tr("Functions")); layout->addWidget(m_typeMethods, 0, 2); m_typeEnums = new QCheckBox(tr("Enums")); diff --git a/src/plugins/cvs/cvscontrol.cpp b/src/plugins/cvs/cvscontrol.cpp index e4ddcfd380..af579f3e99 100644 --- a/src/plugins/cvs/cvscontrol.cpp +++ b/src/plugins/cvs/cvscontrol.cpp @@ -148,7 +148,8 @@ bool CvsControl::vcsRemoveSnapshot(const QString &, const QString &) bool CvsControl::vcsAnnotate(const QString &file, int line) { - m_plugin->vcsAnnotate(file, QString(), line); + const QFileInfo fi(file); + m_plugin->vcsAnnotate(fi.absolutePath(), fi.fileName(), QString(), line); return true; } @@ -162,6 +163,11 @@ bool CvsControl::managesDirectory(const QString &directory, QString *topLevel) c return m_plugin->managesDirectory(directory, topLevel); } +bool CvsControl::managesFile(const QString &workingDirectory, const QString &fileName) const +{ + return m_plugin->managesFile(workingDirectory, fileName); +} + void CvsControl::emitRepositoryChanged(const QString &s) { emit repositoryChanged(s); diff --git a/src/plugins/cvs/cvscontrol.h b/src/plugins/cvs/cvscontrol.h index 586296fa4d..4a765557a3 100644 --- a/src/plugins/cvs/cvscontrol.h +++ b/src/plugins/cvs/cvscontrol.h @@ -48,6 +48,7 @@ public: Core::Id id() const; bool managesDirectory(const QString &directory, QString *topLevel = 0) const; + bool managesFile(const QString &workingDirectory, const QString &fileName) const; bool isConfigured() const; bool supportsOperation(Operation operation) const; diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp index fdbd7ea1c3..9d4a8055f7 100644 --- a/src/plugins/cvs/cvsplugin.cpp +++ b/src/plugins/cvs/cvsplugin.cpp @@ -503,7 +503,7 @@ void CvsPlugin::diffCommitFiles(const QStringList &files) static void setDiffBaseDirectory(IEditor *editor, const QString &db) { if (VcsBaseEditorWidget *ve = qobject_cast<VcsBaseEditorWidget*>(editor->widget())) - ve->setDiffBaseDirectory(db); + ve->setWorkingDirectory(db); } // Collect all parameters required for a diff to be able to associate them @@ -923,10 +923,10 @@ void CvsPlugin::annotateCurrentFile() annotate(state.currentFileTopLevel(), state.relativeCurrentFile()); } -void CvsPlugin::vcsAnnotate(const QString &file, const QString &revision, int lineNumber) +void CvsPlugin::vcsAnnotate(const QString &workingDirectory, const QString &file, + const QString &revision, int lineNumber) { - const QFileInfo fi(file); - annotate(fi.absolutePath(), fi.fileName(), revision, lineNumber); + annotate(workingDirectory, file, revision, lineNumber); } bool CvsPlugin::edit(const QString &topLevel, const QStringList &files) @@ -1226,7 +1226,7 @@ CvsResponse CvsPlugin::runCvs(const QString &workingDirectory, const QStringList &arguments, int timeOut, unsigned flags, - QTextCodec *outputCodec) + QTextCodec *outputCodec) const { const QString executable = m_settings.cvsBinaryPath; CvsResponse response; @@ -1274,8 +1274,8 @@ IEditor *CvsPlugin::showOutputInEditor(const QString& title, const QString &outp << "source=" << source << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec); QString s = title; IEditor *editor = EditorManager::openEditorWithContents(id, &s, output.toUtf8()); - connect(editor, SIGNAL(annotateRevisionRequested(QString,QString,int)), - this, SLOT(vcsAnnotate(QString,QString,int))); + connect(editor, SIGNAL(annotateRevisionRequested(QString,QString,QString,int)), + this, SLOT(vcsAnnotate(QString,QString,QString,int))); CvsEditor *e = qobject_cast<CvsEditor*>(editor->widget()); if (!e) return 0; @@ -1365,6 +1365,17 @@ bool CvsPlugin::managesDirectory(const QString &directory, QString *topLevel /* return manages; } +bool CvsPlugin::managesFile(const QString &workingDirectory, const QString &fileName) const +{ + QStringList args; + args << QLatin1String("status") << fileName; + const CvsResponse response = + runCvs(workingDirectory, args, m_settings.timeOutMS(), SshPasswordPrompt); + if (response.result != CvsResponse::Ok) + return false; + return !response.stdOut.contains(QLatin1String("Status: Unknown")); +} + bool CvsPlugin::checkCVSDirectory(const QDir &directory) const { const QString cvsDir = directory.absoluteFilePath(QLatin1String("CVS")); diff --git a/src/plugins/cvs/cvsplugin.h b/src/plugins/cvs/cvsplugin.h index 9608cd2e1b..6d8f057b83 100644 --- a/src/plugins/cvs/cvsplugin.h +++ b/src/plugins/cvs/cvsplugin.h @@ -90,13 +90,15 @@ public: bool vcsAdd(const QString &workingDir, const QString &fileName); bool vcsDelete(const QString &workingDir, const QString &fileName); bool managesDirectory(const QString &directory, QString *topLevel = 0) const; + bool managesFile(const QString &workingDirectory, const QString &fileName) const; // cvs 'edit' is used to implement 'open' (cvsnt). bool edit(const QString &topLevel, const QStringList &files); static CvsPlugin *instance(); public slots: - void vcsAnnotate(const QString &file, const QString &revision /* = QString() */, int lineNumber); + void vcsAnnotate(const QString &workingDirectory, const QString &file, + const QString &revision, int lineNumber); private slots: void addCurrentFile(); @@ -142,7 +144,8 @@ private: CvsResponse runCvs(const QString &workingDirectory, const QStringList &arguments, int timeOut, - unsigned flags, QTextCodec *outputCodec = 0); + unsigned flags, + QTextCodec *outputCodec = 0) const; void annotate(const QString &workingDir, const QString &file, const QString &revision = QString(), int lineNumber= -1); diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 4a74ae0f8f..955b533cf5 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -483,7 +483,7 @@ bool CdbEngine::setToolTipExpression(const QPoint &mousePos, tw->setContext(context); tw->setIname(localVariable->iname); tw->acquireEngine(this); - DebuggerToolTipManager::instance()->showToolTip(mousePos, editor, tw); + DebuggerToolTipManager::showToolTip(mousePos, tw); return true; } @@ -587,7 +587,7 @@ void CdbEngine::consoleStubProcessStarted() QString errorMessage; if (!launchCDB(attachParameters, &errorMessage)) { showMessage(errorMessage, LogError); - showMessageBox(QMessageBox::Critical, tr("Failed To Start The Debugger"), errorMessage); + showMessageBox(QMessageBox::Critical, tr("Failed to Start the Debugger"), errorMessage); STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineSetupFailed") notifyEngineSetupFailed(); } @@ -624,7 +624,7 @@ void CdbEngine::setupEngine() qDebug("<setupEngine ok=%d", ok); if (!ok) { showMessage(errorMessage, LogError); - showMessageBox(QMessageBox::Critical, tr("Failed To Start The Debugger"), errorMessage); + showMessageBox(QMessageBox::Critical, tr("Failed to Start the Debugger"), errorMessage); STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineSetupFailed") notifyEngineSetupFailed(); } diff --git a/src/plugins/debugger/debuggerkitconfigwidget.cpp b/src/plugins/debugger/debuggerkitconfigwidget.cpp index bf50f7b085..b5ceed0415 100644 --- a/src/plugins/debugger/debuggerkitconfigwidget.cpp +++ b/src/plugins/debugger/debuggerkitconfigwidget.cpp @@ -254,14 +254,6 @@ void DebuggerKitInformation::setDebugger(Kit *k, const DebuggerItem &item) k->setValue(DebuggerKitInformation::id(), id); } -void DebuggerKitInformation::setDebugger(Kit *k, const FileName &command) -{ - DebuggerItem item; - item.setEngineType(GdbEngineType); - item.setCommand(command); - setDebugger(k, item); -} - Core::Id DebuggerKitInformation::id() { return "Debugger.Information"; @@ -447,8 +439,9 @@ void DebuggerItemManager::autoDetectDebuggers() DebuggerItem item; item.setCommand(command); item.reinitializeFromFile(); + //: %1: Debugger engine type (GDB, LLDB, CDB...), %2: Path item.setDisplayName(tr("System %1 at %2") - .arg(item.engineTypeName()).arg(fi.absoluteFilePath())); + .arg(item.engineTypeName()).arg(QDir::toNativeSeparators(fi.absoluteFilePath()))); item.setAutoDetected(true); doAddDebugger(item); } @@ -1030,7 +1023,7 @@ DebuggerItemConfigWidget::DebuggerItemConfigWidget() // formLayout->addRow(new QLabel(tr("Type:")), m_engineTypeComboBox); formLayout->addRow(m_cdbLabel); formLayout->addRow(new QLabel(tr("Path:")), m_binaryChooser); - formLayout->addRow(new QLabel(tr("Abis:")), m_abis); + formLayout->addRow(new QLabel(tr("ABIs:")), m_abis); connectDirty(); } diff --git a/src/plugins/debugger/debuggerkitinformation.h b/src/plugins/debugger/debuggerkitinformation.h index 30623bdae0..dc3c5e2b64 100644 --- a/src/plugins/debugger/debuggerkitinformation.h +++ b/src/plugins/debugger/debuggerkitinformation.h @@ -107,7 +107,6 @@ public: ItemList toUserOutput(const ProjectExplorer::Kit *k) const; static void setDebugger(ProjectExplorer::Kit *k, const DebuggerItem &item); - static void setDebugger(ProjectExplorer::Kit *k, const Utils::FileName &command); static Core::Id id(); static Utils::FileName debuggerCommand(const ProjectExplorer::Kit *k); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 6e4606e884..5bbf72ac2b 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -94,8 +94,6 @@ #include <projectexplorer/session.h> #include <projectexplorer/target.h> -#include <android/androidconstants.h> - #include <texteditor/basetexteditor.h> #include <texteditor/fontsettings.h> #include <texteditor/texteditorsettings.h> @@ -1752,12 +1750,7 @@ void DebuggerPluginPrivate::attachToQmlPort() IDevice::ConstPtr device = DeviceKitInformation::device(kit); if (device) { sp.connParams = device->sshParameters(); - if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE - || device->type() == Android::Constants::ANDROID_DEVICE_TYPE) { - sp.qmlServerAddress = QLatin1String("localhost"); - } else { - sp.qmlServerAddress = sp.connParams.host; - } + sp.qmlServerAddress = device->qmlProfilerHost(); } sp.qmlServerPort = dlg.port(); sp.startMode = AttachToRemoteProcess; diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index eeba0d25c1..2c5a71e716 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -145,7 +145,7 @@ DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfiguration, d->m_engine = DebuggerRunControlFactory::createEngine(sp.masterEngineType, sp, &errorMessage); if (d->m_engine) { - DebuggerToolTipManager::instance()->registerEngine(d->m_engine); + DebuggerToolTipManager::registerEngine(d->m_engine); } else { debuggingFinished(); Core::ICore::showWarningWithOptions(DebuggerRunControl::tr("Debugger"), errorMessage); diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index 60854617f0..2080d92d38 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -431,7 +431,7 @@ DebuggerSourcePathMappingWidget::SourcePathMap // We could query the QtVersion for this information directly, but then we // will need to add a dependency on QtSupport to the debugger. // - // The profile could also get a method to extract the required information from + // The profile could also get a function to extract the required information from // its information to avoid this dependency (as we do for the environment). const QString qtInstallPath = findQtInstallPath(qmake); SourcePathMap rc = in; diff --git a/src/plugins/debugger/debuggertooltipmanager.cpp b/src/plugins/debugger/debuggertooltipmanager.cpp index f61ceffe9e..858ff7067e 100644 --- a/src/plugins/debugger/debuggertooltipmanager.cpp +++ b/src/plugins/debugger/debuggertooltipmanager.cpp @@ -191,38 +191,24 @@ class DebuggerToolTipEditor { public: explicit DebuggerToolTipEditor(IEditor *ie = 0); - bool isValid() const { return textEditor && baseTextEditor && document; } - operator bool() const { return isValid(); } - QString fileName() const { return document ? document->filePath() : QString(); } + bool isValid() const { return editor; } + QString fileName() const { return editor->document() ? editor->document()->filePath() : QString(); } - static DebuggerToolTipEditor currentToolTipEditor(); - - ITextEditor *textEditor; - BaseTextEditorWidget *baseTextEditor; - IDocument *document; + IEditor *editor; + BaseTextEditorWidget *widget; }; DebuggerToolTipEditor::DebuggerToolTipEditor(IEditor *ie) : - textEditor(0), baseTextEditor(0), document(0) + editor(0), widget(0) { if (ie && ie->document()) { - if (ITextEditor *te = qobject_cast<ITextEditor *>(ie)) { - if (BaseTextEditorWidget *pe = qobject_cast<BaseTextEditorWidget *>(ie->widget())) { - textEditor = te; - baseTextEditor = pe; - document = ie->document(); - } + if (BaseTextEditorWidget *w = qobject_cast<BaseTextEditorWidget *>(ie->widget())) { + editor = ie; + widget = w; } } } -DebuggerToolTipEditor DebuggerToolTipEditor::currentToolTipEditor() -{ - if (IEditor *ie = EditorManager::currentEditor()) - return DebuggerToolTipEditor(ie); - return DebuggerToolTipEditor(); -} - /* Helper for building a QStandardItemModel of a tree form (see TreeModelVisitor). * The recursion/building is based on the scheme: \code <row><item1><item2> @@ -684,8 +670,8 @@ bool DebuggerToolTipWidget::positionShow(const DebuggerToolTipEditor &te) { // Figure out new position of tooltip using the text edit. // If the line changed too much, close this tip. - QTC_ASSERT(te, return false); - QTextCursor cursor(te.baseTextEditor->document()); + QTC_ASSERT(te.isValid(), return false); + QTextCursor cursor(te.widget->document()); cursor.setPosition(m_context.position); const int line = cursor.blockNumber(); if (qAbs(m_context.line - line) > 2) { @@ -698,16 +684,16 @@ bool DebuggerToolTipWidget::positionShow(const DebuggerToolTipEditor &te) if (debugToolTipPositioning) qDebug() << "positionShow" << this << line << cursor.columnNumber(); - const QPoint screenPos = te.baseTextEditor->toolTipPosition(cursor) + m_offset; + const QPoint screenPos = te.widget->toolTipPosition(cursor) + m_offset; const QRect toolTipArea = QRect(screenPos, QSize(sizeHint())); - const QRect plainTextArea = QRect(te.baseTextEditor->mapToGlobal(QPoint(0, 0)), te.baseTextEditor->size()); + const QRect plainTextArea = QRect(te.widget->mapToGlobal(QPoint(0, 0)), te.widget->size()); const bool visible = plainTextArea.contains(toolTipArea); if (debugToolTips) qDebug() << "DebuggerToolTipWidget::positionShow() " << this << m_context << " line: " << line << " plainTextPos " << toolTipArea << " offset: " << m_offset << " Area: " << plainTextArea << " Screen pos: " - << screenPos << te.baseTextEditor << " visible=" << visible; + << screenPos << te.widget << " visible=" << visible; if (!visible) { hide(); @@ -951,6 +937,11 @@ void DebuggerToolTipTreeView::computeSize() setMinimumSize(m_size); setMaximumSize(m_size); setRootIsDecorated(rootDecorated); + + // This pretty much feels like a hack. + // But it "solves" QTCREATORBUG-9852 + QApplication::processEvents(); + viewport()->update(); } void DebuggerToolTipWidget::doAcquireEngine(DebuggerEngine *engine) @@ -1086,45 +1077,71 @@ QString DebuggerToolTipWidget::clipboardContents() const (by file name and function) acquire the engine, others release. */ -DebuggerToolTipManager *DebuggerToolTipManager::m_instance = 0; +typedef QList<QPointer<DebuggerToolTipWidget> > DebuggerToolTipWidgetList; +class DebuggerToolTipManagerData +{ +public: + DebuggerToolTipManagerData() + : m_debugModeActive(false), m_lastToolTipPoint(-1, -1), m_lastToolTipEditor(0) + {} + + void registerToolTip(DebuggerToolTipWidget *toolTipWidget); + void moveToolTipsBy(const QPoint &distance); + // Purge out closed (null) tooltips and return list for convenience + void purgeClosedToolTips(); + + DebuggerToolTipWidgetList m_tooltips; + + bool m_debugModeActive; + QPoint m_lastToolTipPoint; + Core::IEditor *m_lastToolTipEditor; +}; + +static DebuggerToolTipManagerData *d = 0; +static DebuggerToolTipManager *m_instance = 0; DebuggerToolTipManager::DebuggerToolTipManager(QObject *parent) : - QObject(parent), m_debugModeActive(false), - m_lastToolTipPoint(-1, -1), m_lastToolTipEditor(0) + QObject(parent) { - DebuggerToolTipManager::m_instance = this; + d = new DebuggerToolTipManagerData; + m_instance = this; } DebuggerToolTipManager::~DebuggerToolTipManager() { - DebuggerToolTipManager::m_instance = 0; + delete d; + m_instance = 0; } void DebuggerToolTipManager::registerEngine(DebuggerEngine *engine) { connect(engine, SIGNAL(stateChanged(Debugger::DebuggerState)), - this, SLOT(slotDebuggerStateChanged(Debugger::DebuggerState))); - connect(engine, SIGNAL(stackFrameCompleted()), this, SLOT(slotStackFrameCompleted())); + m_instance, SLOT(slotDebuggerStateChanged(Debugger::DebuggerState))); + connect(engine, SIGNAL(stackFrameCompleted()), + m_instance, SLOT(slotStackFrameCompleted())); +} + +bool DebuggerToolTipManager::hasToolTips() +{ + return !d->m_tooltips.isEmpty(); } -void DebuggerToolTipManager::showToolTip(const QPoint &p, IEditor *editor, - DebuggerToolTipWidget *toolTipWidget) +void DebuggerToolTipManager::showToolTip(const QPoint &p, DebuggerToolTipWidget *toolTipWidget) { - QWidget *widget = editor->widget(); if (debugToolTipPositioning) qDebug() << "DebuggerToolTipManager::showToolTip" << p << " Mouse at " << QCursor::pos(); const Utils::WidgetContent widgetContent(toolTipWidget, true); - Utils::ToolTip::show(p, widgetContent, widget); - registerToolTip(toolTipWidget); + Utils::ToolTip::show(p, widgetContent, debuggerCore()->mainWindow()); + d->registerToolTip(toolTipWidget); } -void DebuggerToolTipManager::registerToolTip(DebuggerToolTipWidget *toolTipWidget) +void DebuggerToolTipManagerData::registerToolTip(DebuggerToolTipWidget *toolTipWidget) { QTC_ASSERT(toolTipWidget->context().isValid(), return); m_tooltips.push_back(toolTipWidget); } -void DebuggerToolTipManager::purgeClosedToolTips() +void DebuggerToolTipManagerData::purgeClosedToolTips() { for (DebuggerToolTipWidgetList::iterator it = m_tooltips.begin(); it != m_tooltips.end() ; ) { if (it->isNull()) @@ -1134,7 +1151,7 @@ void DebuggerToolTipManager::purgeClosedToolTips() } } -void DebuggerToolTipManager::moveToolTipsBy(const QPoint &distance) +void DebuggerToolTipManagerData::moveToolTipsBy(const QPoint &distance) { purgeClosedToolTips(); foreach (const QPointer<DebuggerToolTipWidget> &tw, m_tooltips) @@ -1149,7 +1166,7 @@ bool DebuggerToolTipManager::eventFilter(QObject *o, QEvent *e) switch (e->type()) { case QEvent::Move: { // Move along with parent (toplevel) const QMoveEvent *me = static_cast<const QMoveEvent *>(e); - moveToolTipsBy(me->pos() - me->oldPos()); + d->moveToolTipsBy(me->pos() - me->oldPos()); } break; case QEvent::WindowStateChange: { // Hide/Show along with parent (toplevel) @@ -1157,8 +1174,8 @@ bool DebuggerToolTipManager::eventFilter(QObject *o, QEvent *e) const bool wasMinimized = se->oldState() & Qt::WindowMinimized; const bool isMinimized = static_cast<const QWidget *>(o)->windowState() & Qt::WindowMinimized; if (wasMinimized ^ isMinimized) { - purgeClosedToolTips(); - foreach (const QPointer<DebuggerToolTipWidget> &tw, m_tooltips) + d->purgeClosedToolTips(); + foreach (const QPointer<DebuggerToolTipWidget> &tw, d->m_tooltips) tw->setVisible(!isMinimized); } } @@ -1186,29 +1203,29 @@ void DebuggerToolTipManager::loadSessionData() const double version = r.attributes().value(QLatin1String(sessionVersionAttributeC)).toString().toDouble(); while (!r.atEnd()) if (DebuggerToolTipWidget *tw = DebuggerToolTipWidget::loadSessionData(r)) - registerToolTip(tw); + d->registerToolTip(tw); if (debugToolTips) - qDebug() << "DebuggerToolTipManager::loadSessionData version " << version << " restored " << m_tooltips.size(); + qDebug() << "DebuggerToolTipManager::loadSessionData version " << version << " restored " << d->m_tooltips.size(); slotUpdateVisibleToolTips(); } void DebuggerToolTipManager::saveSessionData() { QString data; - purgeClosedToolTips(); - if (!m_tooltips.isEmpty()) { + d->purgeClosedToolTips(); + if (!d->m_tooltips.isEmpty()) { QXmlStreamWriter w(&data); w.writeStartDocument(); w.writeStartElement(QLatin1String(sessionDocumentC)); w.writeAttribute(QLatin1String(sessionVersionAttributeC), QLatin1String("1.0")); - foreach (const QPointer<DebuggerToolTipWidget> &tw, m_tooltips) + foreach (const QPointer<DebuggerToolTipWidget> &tw, d->m_tooltips) if (tw->isPinned()) tw->saveSessionData(w); w.writeEndDocument(); } if (debugToolTips) - qDebug() << "DebuggerToolTipManager::saveSessionData" << m_tooltips.size() << data ; + qDebug() << "DebuggerToolTipManager::saveSessionData" << d->m_tooltips.size() << data ; DebuggerCore::setSessionValue(sessionSettingsKeyC, QVariant(data)); } @@ -1217,34 +1234,33 @@ void DebuggerToolTipManager::closeAllToolTips() if (debugToolTips) qDebug() << "DebuggerToolTipManager::closeAllToolTips"; - purgeClosedToolTips(); - foreach (const QPointer<DebuggerToolTipWidget> &tw, m_tooltips) + d->purgeClosedToolTips(); + foreach (const QPointer<DebuggerToolTipWidget> &tw, d->m_tooltips) tw->close(); - m_tooltips.clear(); + d->m_tooltips.clear(); } void DebuggerToolTipManager::hide() { - purgeClosedToolTips(); - foreach (const QPointer<DebuggerToolTipWidget> &tw, m_tooltips) + d->purgeClosedToolTips(); + foreach (const QPointer<DebuggerToolTipWidget> &tw, d->m_tooltips) tw->hide(); } void DebuggerToolTipManager::slotUpdateVisibleToolTips() { - purgeClosedToolTips(); - if (m_tooltips.isEmpty()) + d->purgeClosedToolTips(); + if (d->m_tooltips.isEmpty()) return; - if (!m_debugModeActive) { + if (!d->m_debugModeActive) { hide(); return; } - DebuggerToolTipEditor toolTipEditor = DebuggerToolTipEditor::currentToolTipEditor(); - if (debugToolTips) qDebug() << "DebuggerToolTipManager::slotUpdateVisibleToolTips() " << sender(); + DebuggerToolTipEditor toolTipEditor = DebuggerToolTipEditor(EditorManager::currentEditor()); if (!toolTipEditor.isValid() || toolTipEditor.fileName().isEmpty()) { hide(); return; @@ -1252,7 +1268,7 @@ void DebuggerToolTipManager::slotUpdateVisibleToolTips() // Reposition and show all tooltips of that file. const QString fileName = toolTipEditor.fileName(); - foreach (const QPointer<DebuggerToolTipWidget> &tw, m_tooltips) { + foreach (const QPointer<DebuggerToolTipWidget> &tw, d->m_tooltips) { if (tw->fileName() == fileName) tw->positionShow(toolTipEditor); else @@ -1278,8 +1294,8 @@ void DebuggerToolTipManager::slotDebuggerStateChanged(DebuggerState state) case EngineShutdownRequested: case DebuggerFinished: case EngineShutdownOk: { - purgeClosedToolTips(); - foreach (const QPointer<DebuggerToolTipWidget> &tw, m_tooltips) + d->purgeClosedToolTips(); + foreach (const QPointer<DebuggerToolTipWidget> &tw, d->m_tooltips) if (tw->engineType() == name) tw->releaseEngine(); break; @@ -1291,8 +1307,8 @@ void DebuggerToolTipManager::slotDebuggerStateChanged(DebuggerState state) void DebuggerToolTipManager::slotStackFrameCompleted() { - purgeClosedToolTips(); - if (m_tooltips.isEmpty()) + d->purgeClosedToolTips(); + if (d->m_tooltips.isEmpty()) return; DebuggerEngine *engine = qobject_cast<DebuggerEngine *>(sender()); QTC_ASSERT(engine, return); @@ -1318,7 +1334,7 @@ void DebuggerToolTipManager::slotStackFrameCompleted() qPrintable(engineName), qPrintable(fileName), lineNumber, qPrintable(function)); unsigned acquiredCount = 0; - foreach (const QPointer<DebuggerToolTipWidget> &tw, m_tooltips) { + foreach (const QPointer<DebuggerToolTipWidget> &tw, d->m_tooltips) { if (tw->matches(fileName, engineName, function)) { tw->acquireEngine(engine); acquiredCount++; @@ -1340,10 +1356,11 @@ bool DebuggerToolTipManager::debug() void DebuggerToolTipManager::slotEditorOpened(IEditor *e) { // Move tooltip along when scrolled. - if (DebuggerToolTipEditor toolTipEditor = DebuggerToolTipEditor(e)) { - connect(toolTipEditor.baseTextEditor->verticalScrollBar(), SIGNAL(valueChanged(int)), + DebuggerToolTipEditor toolTipEditor = DebuggerToolTipEditor(e); + if (toolTipEditor.isValid()) { + connect(toolTipEditor.widget->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(slotUpdateVisibleToolTips())); - connect(toolTipEditor.textEditor, + connect(toolTipEditor.editor, SIGNAL(tooltipOverrideRequested(TextEditor::ITextEditor*,QPoint,int,bool*)), SLOT(slotTooltipOverrideRequested(TextEditor::ITextEditor*,QPoint,int,bool*))); } @@ -1355,8 +1372,8 @@ void DebuggerToolTipManager::debugModeEntered() qDebug("DebuggerToolTipManager::debugModeEntered"); // Hook up all signals in debug mode. - if (!m_debugModeActive) { - m_debugModeActive = true; + if (!d->m_debugModeActive) { + d->m_debugModeActive = true; QWidget *topLevel = ICore::mainWindow()->topLevelWidget(); topLevel->installEventFilter(this); QObject *em = EditorManager::instance(); @@ -1368,7 +1385,7 @@ void DebuggerToolTipManager::debugModeEntered() foreach (IEditor *e, documentModel->editorsForDocuments(documentModel->openedDocuments())) slotEditorOpened(e); // Position tooltips delayed once all the editor placeholder layouting is done. - if (!m_tooltips.isEmpty()) + if (!d->m_tooltips.isEmpty()) QTimer::singleShot(0, this, SLOT(slotUpdateVisibleToolTips())); } } @@ -1379,21 +1396,22 @@ void DebuggerToolTipManager::leavingDebugMode() qDebug("DebuggerToolTipManager::leavingDebugMode"); // Remove all signals in debug mode. - if (m_debugModeActive) { - m_debugModeActive = false; + if (d->m_debugModeActive) { + d->m_debugModeActive = false; hide(); if (QWidget *topLevel = ICore::mainWindow()->topLevelWidget()) topLevel->removeEventFilter(this); DocumentModel *documentModel = EditorManager::documentModel(); foreach (IEditor *e, documentModel->editorsForDocuments(documentModel->openedDocuments())) { - if (DebuggerToolTipEditor toolTipEditor = DebuggerToolTipEditor(e)) { - toolTipEditor.baseTextEditor->verticalScrollBar()->disconnect(this); - toolTipEditor.textEditor->disconnect(this); + DebuggerToolTipEditor toolTipEditor = DebuggerToolTipEditor(e); + if (toolTipEditor.isValid()) { + toolTipEditor.widget->verticalScrollBar()->disconnect(this); + toolTipEditor.editor->disconnect(this); } } EditorManager::instance()->disconnect(this); - m_lastToolTipEditor = 0; - m_lastToolTipPoint = QPoint(-1, -1); + d->m_lastToolTipEditor = 0; + d->m_lastToolTipPoint = QPoint(-1, -1); } } @@ -1403,11 +1421,11 @@ void DebuggerToolTipManager::slotTooltipOverrideRequested(ITextEditor *editor, { QTC_ASSERT(handled, return); - const int movedDistance = (point - m_lastToolTipPoint).manhattanLength(); - const bool samePosition = m_lastToolTipEditor == editor && movedDistance < 25; + const int movedDistance = (point - d->m_lastToolTipPoint).manhattanLength(); + const bool samePosition = d->m_lastToolTipEditor == editor && movedDistance < 25; if (debugToolTipPositioning) qDebug() << ">slotTooltipOverrideRequested() " << editor << point - << "from " << m_lastToolTipPoint << ") pos: " + << "from " << d->m_lastToolTipPoint << ") pos: " << pos << *handled << " Same position=" << samePosition << " d=" << movedDistance; @@ -1430,8 +1448,8 @@ void DebuggerToolTipManager::slotTooltipOverrideRequested(ITextEditor *editor, const DebuggerToolTipContext context = DebuggerToolTipContext::fromEditor(editor, pos); if (context.isValid() && currentEngine->setToolTipExpression(point, editor, context)) { *handled = true; - m_lastToolTipEditor = editor; - m_lastToolTipPoint = point; + d->m_lastToolTipEditor = editor; + d->m_lastToolTipPoint = point; } } while (false); @@ -1439,8 +1457,8 @@ void DebuggerToolTipManager::slotTooltipOverrideRequested(ITextEditor *editor, // Other tooltip, close all in case mouse never entered the tooltip // and no leave was triggered. if (!*handled) { - m_lastToolTipEditor = 0; - m_lastToolTipPoint = QPoint(-1, -1); + d->m_lastToolTipEditor = 0; + d->m_lastToolTipPoint = QPoint(-1, -1); } if (debugToolTipPositioning) qDebug() << "<slotTooltipOverrideRequested() " << currentEngine << *handled; @@ -1450,10 +1468,10 @@ void DebuggerToolTipManager::slotTooltipOverrideRequested(ITextEditor *editor, DebuggerToolTipManager::ExpressionInamePairs DebuggerToolTipManager::treeWidgetExpressions(const QString &fileName, const QString &engineType, - const QString &function) const + const QString &function) { ExpressionInamePairs rc; - foreach (const QPointer<DebuggerToolTipWidget> &tw, m_tooltips) { + foreach (const QPointer<DebuggerToolTipWidget> &tw, d->m_tooltips) { if (!tw.isNull() && tw->matches(fileName, engineType, function)) rc.push_back(ExpressionInamePair(tw->expression(), tw->iname())); } diff --git a/src/plugins/debugger/debuggertooltipmanager.h b/src/plugins/debugger/debuggertooltipmanager.h index 8465436ad8..9575353b6d 100644 --- a/src/plugins/debugger/debuggertooltipmanager.h +++ b/src/plugins/debugger/debuggertooltipmanager.h @@ -196,18 +196,17 @@ public: typedef QList<ExpressionInamePair> ExpressionInamePairs; explicit DebuggerToolTipManager(QObject *parent = 0); - virtual ~DebuggerToolTipManager(); + ~DebuggerToolTipManager(); - static DebuggerToolTipManager *instance() { return m_instance; } - void registerEngine(DebuggerEngine *engine); - bool hasToolTips() const { return !m_tooltips.isEmpty(); } + static void registerEngine(DebuggerEngine *engine); + static bool hasToolTips(); // Collect all expressions of DebuggerTreeViewToolTipWidget - ExpressionInamePairs treeWidgetExpressions(const QString &fileName, + static ExpressionInamePairs treeWidgetExpressions(const QString &fileName, const QString &engineType = QString(), - const QString &function= QString()) const; + const QString &function= QString()); - void showToolTip(const QPoint &p, Core::IEditor *editor, DebuggerToolTipWidget *); + static void showToolTip(const QPoint &p, DebuggerToolTipWidget *); virtual bool eventFilter(QObject *, QEvent *); @@ -219,7 +218,7 @@ public slots: void sessionAboutToChange(); void loadSessionData(); void saveSessionData(); - void closeAllToolTips(); + static void closeAllToolTips(); void hide(); private slots: @@ -229,22 +228,6 @@ private slots: void slotEditorOpened(Core::IEditor *); void slotTooltipOverrideRequested(TextEditor::ITextEditor *editor, const QPoint &point, int pos, bool *handled); - -private: - typedef QList<QPointer<DebuggerToolTipWidget> > DebuggerToolTipWidgetList; - - void registerToolTip(DebuggerToolTipWidget *toolTipWidget); - void moveToolTipsBy(const QPoint &distance); - // Purge out closed (null) tooltips and return list for convenience - void purgeClosedToolTips(); - - static DebuggerToolTipManager *m_instance; - - DebuggerToolTipWidgetList m_tooltips; - - bool m_debugModeActive; - QPoint m_lastToolTipPoint; - Core::IEditor *m_lastToolTipEditor; }; } // namespace Internal diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index b2cab00f27..c64cada434 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -95,12 +95,11 @@ class GdbToolTipContext : public DebuggerToolTipContext { public: GdbToolTipContext(const DebuggerToolTipContext &c) : - DebuggerToolTipContext(c), editor(0) {} + DebuggerToolTipContext(c) {} QPoint mousePosition; QString expression; QByteArray iname; - Core::IEditor *editor; }; enum { debugPending = 0 }; @@ -2418,7 +2417,7 @@ void GdbEngine::handleExecuteReturn(const GdbResponse &response) /*! Discards the results of all pending watch-updating commands. - This method is called at the beginning of all step, next, finish, and so on, + This function is called at the beginning of all step, next, finish, and so on, debugger functions. If non-watch-updating commands with call-backs are still in the pipe, it will complain. @@ -3984,8 +3983,7 @@ void GdbEngine::showToolTip() tw->setExpression(m_toolTipContext->expression); tw->setContext(*m_toolTipContext); tw->acquireEngine(this); - DebuggerToolTipManager::instance()->showToolTip(m_toolTipContext->mousePosition, - m_toolTipContext->editor, tw); + DebuggerToolTipManager::showToolTip(m_toolTipContext->mousePosition, tw); // Prevent tooltip from re-occurring (classic GDB, QTCREATORBUG-4711). m_toolTipContext.reset(); } @@ -4037,7 +4035,6 @@ bool GdbEngine::setToolTipExpression(const QPoint &mousePos, m_toolTipContext->mousePosition = mousePos; m_toolTipContext->expression = exp; m_toolTipContext->iname = iname; - m_toolTipContext->editor = editor; // Local variable: Display synchronously. if (iname.startsWith("local")) { showToolTip(); diff --git a/src/plugins/debugger/gdb/pythongdbengine.cpp b/src/plugins/debugger/gdb/pythongdbengine.cpp index 459b4ecfaa..b341ec6183 100644 --- a/src/plugins/debugger/gdb/pythongdbengine.cpp +++ b/src/plugins/debugger/gdb/pythongdbengine.cpp @@ -67,8 +67,8 @@ void GdbEngine::updateLocalsPython(const UpdateParameters ¶ms) // Re-create tooltip items that are not filters on existing local variables in // the tooltip model. - ExpressionInamePairs toolTips = DebuggerToolTipManager::instance() - ->treeWidgetExpressions(fileName, objectName(), function); + ExpressionInamePairs toolTips = + DebuggerToolTipManager::treeWidgetExpressions(fileName, objectName(), function); const QString currentExpression = tooltipExpression(); if (!currentExpression.isEmpty()) { diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 8c2334c32c..b8318deb90 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -151,7 +151,7 @@ void LldbEngine::setupEngine() << (Core::ICore::resourcePath() + _("/debugger/lldbbridge.py")) << m_lldbCmd); if (!m_lldbProc.waitForStarted()) { - const QString msg = tr("Unable to start lldb '%1': %2") + const QString msg = tr("Unable to start LLDB '%1': %2") .arg(m_lldbCmd, m_lldbProc.errorString()); notifyEngineSetupFailed(); showMessage(_("ADAPTER START FAILED")); @@ -774,7 +774,7 @@ void LldbEngine::handleLldbError(QProcess::ProcessError error) default: //setState(EngineShutdownRequested, true); m_lldbProc.kill(); - showMessageBox(QMessageBox::Critical, tr("Lldb I/O Error"), + showMessageBox(QMessageBox::Critical, tr("LLDB I/O Error"), errorMessage(error)); break; } @@ -784,12 +784,12 @@ QString LldbEngine::errorMessage(QProcess::ProcessError error) const { switch (error) { case QProcess::FailedToStart: - return tr("The Lldb process failed to start. Either the " + return tr("The LLDB process failed to start. Either the " "invoked program '%1' is missing, or you may have insufficient " "permissions to invoke the program.") .arg(m_lldbCmd); case QProcess::Crashed: - return tr("The Lldb process crashed some time after starting " + return tr("The LLDB process crashed some time after starting " "successfully."); case QProcess::Timedout: return tr("The last waitFor...() function timed out. " @@ -797,7 +797,7 @@ QString LldbEngine::errorMessage(QProcess::ProcessError error) const "waitFor...() again."); case QProcess::WriteError: return tr("An error occurred when attempting to write " - "to the Lldb process. For example, the process may not be running, " + "to the LLDB process. For example, the process may not be running, " "or it may have closed its input channel."); case QProcess::ReadError: return tr("An error occurred when attempting to read from " diff --git a/src/plugins/debugger/logwindow.cpp b/src/plugins/debugger/logwindow.cpp index 68fca7500c..7fa9760109 100644 --- a/src/plugins/debugger/logwindow.cpp +++ b/src/plugins/debugger/logwindow.cpp @@ -376,7 +376,7 @@ LogWindow::LogWindow(QWidget *parent) QToolButton *repeatButton = new QToolButton(this); repeatButton->setIcon(QIcon(QLatin1String(":/debugger/images/debugger_stepover_small.png"))); repeatButton->setIconSize(QSize(12, 12)); - repeatButton->setToolTip(tr("Repeat last command for debug reasons")); + repeatButton->setToolTip(tr("Repeat last command for debug reasons.")); QHBoxLayout *commandBox = new QHBoxLayout; commandBox->addWidget(repeatButton); diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 7c33d83f59..89929350c7 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -292,7 +292,7 @@ QmlEngine::QmlEngine(const DebuggerStartParameters &startParameters, DebuggerEng connect(&m_applicationLauncher, - SIGNAL(processExited(int, QProcess::ExitStatus)), + SIGNAL(processExited(int,QProcess::ExitStatus)), SLOT(disconnected())); connect(&m_applicationLauncher, SIGNAL(appendMessage(QString,Utils::OutputFormat)), diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index 81e4798578..1619cfeb2f 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -863,7 +863,7 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev) QAction *actCloseEditorToolTips = new QAction(tr("Close Editor Tooltips"), &menu); - actCloseEditorToolTips->setEnabled(DebuggerToolTipManager::instance()->hasToolTips()); + actCloseEditorToolTips->setEnabled(DebuggerToolTipManager::hasToolTips()); menu.addAction(actCloseEditorToolTips); addBaseContextActions(&menu); @@ -932,7 +932,7 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev) } else if (act == showUnprintableHexadecimal) { handler->setUnprintableBase(16); } else if (act == actCloseEditorToolTips) { - DebuggerToolTipManager::instance()->closeAllToolTips(); + DebuggerToolTipManager::closeAllToolTips(); } else if (handleBaseContextAction(act)) { ; } else { diff --git a/src/plugins/designer/formeditorplugin.cpp b/src/plugins/designer/formeditorplugin.cpp index ce5c6da2b9..b9ce323654 100644 --- a/src/plugins/designer/formeditorplugin.cpp +++ b/src/plugins/designer/formeditorplugin.cpp @@ -103,7 +103,7 @@ void FormEditorPlugin::extensionsInitialized() //////////////////////////////////////////////////// // -// PRIVATE methods +// PRIVATE functions // //////////////////////////////////////////////////// diff --git a/src/plugins/designer/formeditorw.h b/src/plugins/designer/formeditorw.h index eeabafb47c..7a5f0f25b7 100644 --- a/src/plugins/designer/formeditorw.h +++ b/src/plugins/designer/formeditorw.h @@ -80,7 +80,7 @@ class SettingsPage; class DesignerContext; /** FormEditorW is a singleton that stores the Designer CoreInterface and - * performs centralized operations. The instance() method will return an + * performs centralized operations. The instance() function will return an * instance. However, it must be manually deleted when unloading the * plugin. Since fully initializing Designer at startup is expensive, the * class has an internal partial initialisation stage "RegisterPlugins" diff --git a/src/plugins/designer/qt_private/qdesigner_formwindowmanager_p.h b/src/plugins/designer/qt_private/qdesigner_formwindowmanager_p.h index 89deab50d3..ec290a84a2 100644 --- a/src/plugins/designer/qt_private/qdesigner_formwindowmanager_p.h +++ b/src/plugins/designer/qt_private/qdesigner_formwindowmanager_p.h @@ -51,7 +51,7 @@ namespace qdesigner_internal { class PreviewManager; // -// Convenience methods to manage form previews (ultimately forwarded to PreviewManager). +// Convenience functions to manage form previews (ultimately forwarded to PreviewManager). // class QDESIGNER_SHARED_EXPORT QDesignerFormWindowManager : public QDesignerFormWindowManagerInterface diff --git a/src/plugins/designer/qtcreatorintegration.cpp b/src/plugins/designer/qtcreatorintegration.cpp index 1297a7f4ac..723c6f3191 100644 --- a/src/plugins/designer/qtcreatorintegration.cpp +++ b/src/plugins/designer/qtcreatorintegration.cpp @@ -228,8 +228,8 @@ static Function *findDeclaration(const Class *cl, const QString &functionName) { const QString funName = QString::fromUtf8(QMetaObject::normalizedSignature(functionName.toUtf8())); const unsigned mCount = cl->memberCount(); - // we are interested only in declarations (can be decl of method or of a field) - // we are only interested in declarations of methods + // we are interested only in declarations (can be decl of function or of a field) + // we are only interested in declarations of functions const Overview overview; for (unsigned j = 0; j < mCount; ++j) { // go through all members if (Declaration *decl = cl->memberAt(j)->asDeclaration()) @@ -254,7 +254,7 @@ static Function *findDeclaration(const Class *cl, const QString &functionName) return 0; } -// TODO: remove me, this is taken from cppeditor.cpp. Find some common place for this method +// TODO: remove me, this is taken from cppeditor.cpp. Find some common place for this function static Document::Ptr findDefinition(Function *functionDeclaration, int *line) { if (CppTools::CppModelManagerInterface *cppModelManager = CppTools::CppModelManagerInterface::instance()) { diff --git a/src/plugins/diffeditor/diffeditorwidget.cpp b/src/plugins/diffeditor/diffeditorwidget.cpp index 881423b97a..7146b6099d 100644 --- a/src/plugins/diffeditor/diffeditorwidget.cpp +++ b/src/plugins/diffeditor/diffeditorwidget.cpp @@ -114,7 +114,7 @@ public: : BaseTextEditor(editorWidget) { connect(this, SIGNAL(tooltipRequested(TextEditor::ITextEditor*,QPoint,int)), - this, SLOT(slotTooltipRequested(TextEditor::ITextEditor*,QPoint, int))); + this, SLOT(slotTooltipRequested(TextEditor::ITextEditor*,QPoint,int))); } Core::Id id() const { return "DiffViewEditor"; } diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 9379af6cd8..04f70f0260 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -2100,9 +2100,6 @@ void FakeVimHandler::Private::init() void FakeVimHandler::Private::focus() { - if (g.inFakeVim) - return; - enterFakeVim(); stopIncrementalFind(); @@ -2135,6 +2132,8 @@ void FakeVimHandler::Private::enterFakeVim() m_cursor = EDITOR(textCursor()); g.inFakeVim = true; + removeEventFilter(); + updateFirstVisibleLine(); importSelection(); @@ -2186,6 +2185,8 @@ void FakeVimHandler::Private::leaveFakeVim(bool needUpdate) scrollToLine(firstVisibleLine()); updateScrollOffset(); } + + installEventFilter(); } g.inFakeVim = false; diff --git a/src/plugins/find/ifindfilter.cpp b/src/plugins/find/ifindfilter.cpp index 06754f9ca0..7755d7088d 100644 --- a/src/plugins/find/ifindfilter.cpp +++ b/src/plugins/find/ifindfilter.cpp @@ -74,20 +74,20 @@ The common pattern is roughly this: - Implement the actual search within a QtConcurrent based method, that is - a method that takes a \c{QFutureInterface<MySearchResult> &future} + Implement the actual search within a QtConcurrent based function, that is + a function that takes a \c{QFutureInterface<MySearchResult> &future} as the first parameter and the other information needed for the search as additional parameters. It should set useful progress information on the QFutureInterface, regularly check for \c{future.isPaused()} and \c{future.isCanceled()}, and report the search results (possibly in chunks) via \c{future.reportResult}. - In the find filter's find/replaceAll method, get the shared + In the find filter's find/replaceAll function, get the shared \gui{Search Results} window, initiate a new search and connect the signals for handling selection of results and the replace action (see the Find::SearchResultWindow class for details). Start your search implementation via the corresponding QtConcurrent - methods. Add the returned QFuture object to the Core::ProgressManager. + functions. Add the returned QFuture object to the Core::ProgressManager. Use a QFutureWatcher on the returned QFuture object to receive a signal when your search implementation reports search results, and add these to the shared \gui{Search Results} window. @@ -138,13 +138,13 @@ \fn bool IFindFilter::isReplaceSupported() const Returns whether the find filter supports search and replace. - The default value is false, override this method to return \c true, if + The default value is false, override this function to return \c true, if your find filter supports global search and replace. */ /*! \fn void IFindFilter::findAll(const QString &txt, Find::FindFlags findFlags) - This method is called when the user selected this find scope and + This function is called when the user selected this find scope and initiated a search. You should start a thread which actually performs the search for \a txt @@ -161,9 +161,9 @@ /*! \fn void IFindFilter::replaceAll(const QString &txt, Find::FindFlags findFlags) - Override this method if you want to support search and replace. + Override this function if you want to support search and replace. - This method is called when the user selected this find scope and + This function is called when the user selected this find scope and initiated a search and replace. The default implementation does nothing. diff --git a/src/plugins/find/searchresultwindow.cpp b/src/plugins/find/searchresultwindow.cpp index 38b2e58224..c6cc1906d5 100644 --- a/src/plugins/find/searchresultwindow.cpp +++ b/src/plugins/find/searchresultwindow.cpp @@ -238,14 +238,14 @@ using namespace Find::Internal; of this class. Except for being an implementation of a output pane, the - SearchResultWindow has a few methods and one enum that allows other + SearchResultWindow has a few functions and one enum that allows other plugins to show their search results and hook into the user actions for selecting an entry and performing a global replace. Whenever you start a search, call startNewSearch(SearchMode) to initialize the \gui {Search Results} output pane. The parameter determines if the GUI for replacing should be shown. - The method returns a SearchResult object that is your + The function returns a SearchResult object that is your hook into the signals from user interaction for this search. When you produce search results, call addResults or addResult to add them to the \gui {Search Results} output pane. diff --git a/src/plugins/git/branchadddialog.cpp b/src/plugins/git/branchadddialog.cpp index 979b0cdb54..df5d2ba9cf 100644 --- a/src/plugins/git/branchadddialog.cpp +++ b/src/plugins/git/branchadddialog.cpp @@ -30,6 +30,8 @@ #include "branchadddialog.h" #include "ui_branchadddialog.h" +#include <utils/hostosinfo.h> + #include <QPushButton> #include <QValidator> @@ -46,7 +48,7 @@ namespace Internal { class BranchNameValidator : public QValidator { public: - BranchNameValidator(QObject *parent = 0) : + BranchNameValidator(const QStringList &localBranches, QObject *parent = 0) : QValidator(parent), m_invalidChars(QLatin1String( "\\s" // no whitespace @@ -59,8 +61,9 @@ public: "|@\\{" // no "@{" sequence "|\\\\" // no backslash "|//" // no double slash - "|^/" // no leading slash - )) + "|^[/-]" // no leading slash or dash + )), + m_localBranches(localBranches) { } @@ -87,22 +90,28 @@ public: if (input.endsWith(QLatin1Char('/'))) // no slash at the end (but allowed in the middle) return Intermediate; + if (m_localBranches.contains(input, Utils::HostOsInfo::isWindowsHost() + ? Qt::CaseInsensitive : Qt::CaseSensitive)) { + return Intermediate; + } + // is a valid branch name return Acceptable; } private: const QRegExp m_invalidChars; + QStringList m_localBranches; }; -BranchAddDialog::BranchAddDialog(bool addBranch, QWidget *parent) : +BranchAddDialog::BranchAddDialog(const QStringList &localBranches, bool addBranch, QWidget *parent) : QDialog(parent), m_ui(new Ui::BranchAddDialog) { m_ui->setupUi(this); setWindowTitle(addBranch ? tr("Add Branch") : tr("Rename Branch")); - m_ui->branchNameEdit->setValidator(new BranchNameValidator(this)); + m_ui->branchNameEdit->setValidator(new BranchNameValidator(localBranches, this)); connect(m_ui->branchNameEdit, SIGNAL(textChanged(QString)), this, SLOT(updateButtonStatus())); } diff --git a/src/plugins/git/branchadddialog.h b/src/plugins/git/branchadddialog.h index eb9df638f4..df67d55a4c 100644 --- a/src/plugins/git/branchadddialog.h +++ b/src/plugins/git/branchadddialog.h @@ -45,7 +45,7 @@ class BranchAddDialog : public QDialog Q_OBJECT public: - BranchAddDialog(bool addBranch, QWidget *parent); + BranchAddDialog(const QStringList &localBranches, bool addBranch, QWidget *parent); ~BranchAddDialog(); void setBranchName(const QString &); diff --git a/src/plugins/git/branchdialog.cpp b/src/plugins/git/branchdialog.cpp index fa5321f479..9fadf16934 100644 --- a/src/plugins/git/branchdialog.cpp +++ b/src/plugins/git/branchdialog.cpp @@ -154,7 +154,7 @@ void BranchDialog::add() ++i; } - BranchAddDialog branchAddDialog(true, this); + BranchAddDialog branchAddDialog(localNames, true, this); branchAddDialog.setBranchName(suggestedName); branchAddDialog.setTrackedBranchName(isTag ? QString() : trackedBranch, !isLocal); @@ -276,7 +276,7 @@ void BranchDialog::rename() if (!isTag) localNames = m_model->localBranchNames(); - BranchAddDialog branchAddDialog(false, this); + BranchAddDialog branchAddDialog(localNames, false, this); if (isTag) branchAddDialog.setWindowTitle(tr("Rename Tag")); branchAddDialog.setBranchName(oldName); @@ -287,12 +287,6 @@ void BranchDialog::rename() if (branchAddDialog.result() == QDialog::Accepted && m_model) { if (branchAddDialog.branchName() == oldName) return; - if (localNames.contains(branchAddDialog.branchName())) { - QMessageBox::critical(this, tr("Branch Exists"), - tr("Local branch \'%1\' already exists.") - .arg(branchAddDialog.branchName())); - return; - } if (isTag) m_model->renameTag(oldName, branchAddDialog.branchName()); else diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 87fb48d6f3..eab02e8c05 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -972,6 +972,15 @@ QString GitClient::findGitDirForRepository(const QString &repositoryDir) const return res; } +bool GitClient::managesFile(const QString &workingDirectory, const QString &fileName) const +{ + QByteArray output; + QStringList arguments; + arguments << QLatin1String("ls-files") << QLatin1String("--error-unmatch") << fileName; + return fullySynchronousGit(workingDirectory, arguments, &output, 0, + VcsBasePlugin::SuppressCommandLogging); +} + VcsBase::VcsBaseEditorWidget *GitClient::findExistingVCSEditor(const char *registerDynamicProperty, const QString &dynamicPropertyValue) const { @@ -1038,8 +1047,8 @@ VcsBase::VcsBaseEditorWidget *GitClient::createVcsEditor( m_msgWait.toUtf8()); outputEditor->document()->setProperty(registerDynamicProperty, dynamicPropertyValue); rc = VcsBase::VcsBaseEditorWidget::getVcsBaseEditor(outputEditor); - connect(rc, SIGNAL(annotateRevisionRequested(QString,QString,int)), - this, SLOT(slotBlameRevisionRequested(QString,QString,int))); + connect(rc, SIGNAL(annotateRevisionRequested(QString,QString,QString,int)), + this, SLOT(slotBlameRevisionRequested(QString,QString,QString,int))); QTC_ASSERT(rc, return 0); rc->setSource(source); if (codecType == CodecSource) { @@ -1122,7 +1131,7 @@ void GitClient::diff(const QString &workingDirectory, vcsEditor->configurationWidget()); argWidget->setFileNames(unstagedFileNames, stagedFileNames); QStringList userDiffArgs = argWidget->arguments(); - vcsEditor->setDiffBaseDirectory(workingDirectory); + vcsEditor->setWorkingDirectory(workingDirectory); // Create a batch of 2 commands to be run after each other in case // we have a mixture of staged/unstaged files as is the case @@ -1220,7 +1229,7 @@ void GitClient::diff(const QString &workingDirectory, const QString &fileName) connect(vcsEditor, SIGNAL(diffChunkReverted(VcsBase::DiffChunk)), argWidget, SLOT(executeCommand())); } - vcsEditor->setDiffBaseDirectory(workingDirectory); + vcsEditor->setWorkingDirectory(workingDirectory); QStringList cmdArgs; cmdArgs << QLatin1String("diff") @@ -1280,7 +1289,7 @@ void GitClient::diffBranch(const QString &workingDirectory, branchName)); newEditor = vcsEditor->editor(); } - vcsEditor->setDiffBaseDirectory(workingDirectory); + vcsEditor->setWorkingDirectory(workingDirectory); QStringList cmdArgs; cmdArgs << QLatin1String("diff") @@ -1331,7 +1340,7 @@ void GitClient::log(const QString &workingDirectory, const QString &fileName, enableAnnotationContextMenu, args, fileName)); editor->setFileLogAnnotateEnabled(enableAnnotationContextMenu); - editor->setDiffBaseDirectory(workingDirectory); + editor->setWorkingDirectory(workingDirectory); QStringList arguments; arguments << QLatin1String("log") << QLatin1String(noColorOption) @@ -1363,6 +1372,7 @@ void GitClient::reflog(const QString &workingDirectory) editor = createVcsEditor(editorId, title, workingDirectory, CodecLogOutput, "reflogRepository", workingDirectory, 0); } + editor->setWorkingDirectory(workingDirectory); QStringList arguments; arguments << QLatin1String("reflog") << QLatin1String(noColorOption) @@ -1444,7 +1454,7 @@ void GitClient::show(const QString &source, const QString &id, << vcsEditor->configurationWidget()->arguments() << id; - vcsEditor->setDiffBaseDirectory(workingDirectory); + vcsEditor->setWorkingDirectory(workingDirectory); executeGit(workingDirectory, arguments, vcsEditor); } if (newEditor) { @@ -1461,15 +1471,15 @@ void GitClient::saveSettings() settings()->writeSettings(Core::ICore::settings()); } -void GitClient::slotBlameRevisionRequested(const QString &source, QString change, int lineNumber) +void GitClient::slotBlameRevisionRequested(const QString &workingDirectory, const QString &file, + QString change, int lineNumber) { // This might be invoked with a verbose revision description // "SHA1 author subject" from the annotation context menu. Strip the rest. const int blankPos = change.indexOf(QLatin1Char(' ')); if (blankPos != -1) change.truncate(blankPos); - const QFileInfo fi(source); - blame(fi.absolutePath(), QStringList(), fi.fileName(), change, lineNumber); + blame(workingDirectory, QStringList(), file, change, lineNumber); } QTextCodec *GitClient::getSourceCodec(const QString &file) const @@ -1502,6 +1512,7 @@ void GitClient::blame(const QString &workingDirectory, argWidget->setEditor(editor); } + editor->setWorkingDirectory(workingDirectory); QStringList arguments(QLatin1String("blame")); arguments << QLatin1String("--root"); arguments.append(editor->configurationWidget()->arguments()); @@ -3434,6 +3445,7 @@ void GitClient::subversionLog(const QString &workingDirectory) VcsBase::VcsBaseEditorWidget *editor = findExistingVCSEditor("svnLog", sourceFile); if (!editor) editor = createVcsEditor(editorId, title, sourceFile, CodecNone, "svnLog", sourceFile, 0); + editor->setWorkingDirectory(workingDirectory); executeGit(workingDirectory, arguments, editor); } diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h index 610a08498e..f21a148672 100644 --- a/src/plugins/git/gitclient.h +++ b/src/plugins/git/gitclient.h @@ -137,6 +137,7 @@ public: QString findRepositoryForDirectory(const QString &dir); QString findGitDirForRepository(const QString &repositoryDir) const; + bool managesFile(const QString &workingDirectory, const QString &fileName) const; void diff(const QString &workingDirectory, const QString &fileName); void diff(const QString &workingDirectory, @@ -335,7 +336,8 @@ public slots: void saveSettings(); private slots: - void slotBlameRevisionRequested(const QString &source, QString change, int lineNumber); + void slotBlameRevisionRequested(const QString &workingDirectory, const QString &file, + QString change, int lineNumber); void finishSubmoduleUpdate(); void fetchFinished(const QVariant &cookie); diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp index 7aa36ec7fe..4f0b8314c6 100644 --- a/src/plugins/git/giteditor.cpp +++ b/src/plugins/git/giteditor.cpp @@ -249,7 +249,7 @@ void GitEditor::applyDiffChunk(const VcsBase::DiffChunk& chunk, bool revert) if (!patchFile.open()) return; - const QString baseDir = diffBaseDirectory(); + const QString baseDir = workingDirectory(); patchFile.write(chunk.header); patchFile.write(chunk.chunk); patchFile.close(); @@ -366,5 +366,19 @@ bool GitEditor::supportChangeLinks() const || (editor()->id() == Git::Constants::GIT_REBASE_EDITOR_ID); } +QString GitEditor::fileNameForLine(int line) const +{ + // 7971b6e7 share/qtcreator/dumper/dumper.py (hjk + QTextBlock block = document()->findBlockByLineNumber(line - 1); + QTC_ASSERT(block.isValid(), return source()); + static QRegExp renameExp(QLatin1String("^" CHANGE_PATTERN "\\s+([^(]+)")); + if (renameExp.indexIn(block.text()) != -1) { + const QString fileName = renameExp.cap(1).trimmed(); + if (!fileName.isEmpty()) + return fileName; + } + return source(); +} + } // namespace Internal } // namespace Git diff --git a/src/plugins/git/giteditor.h b/src/plugins/git/giteditor.h index 1ed80c7ccf..84b5399221 100644 --- a/src/plugins/git/giteditor.h +++ b/src/plugins/git/giteditor.h @@ -74,6 +74,7 @@ private: void addChangeActions(QMenu *menu, const QString &change); QString revisionSubject(const QTextBlock &inBlock) const; bool supportChangeLinks() const; + QString fileNameForLine(int line) const; mutable QRegExp m_changeNumberPattern; QString m_currentChange; diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index ab195cde66..5759e2e122 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -1075,15 +1075,15 @@ bool GitPlugin::submitEditorAboutToClose() return true; // Prompt user. Force a prompt unless submit was actually invoked (that // is, the editor was closed or shutdown). - bool *promptData = m_settings.boolPointer(GitSettings::promptOnSubmitKey); VcsBase::VcsBaseSubmitEditor::PromptSubmitResult answer; if (editor->forceClose()) { answer = VcsBase::VcsBaseSubmitEditor::SubmitDiscarded; } else { + bool promptData = false; answer = editor->promptSubmit(tr("Closing Git Editor"), tr("Do you want to commit the change?"), tr("Git will not accept this commit. Do you want to continue to edit it?"), - promptData, !m_submitActionTriggered, false); + &promptData, !m_submitActionTriggered, false); } m_submitActionTriggered = false; switch (answer) { @@ -1352,7 +1352,7 @@ void GitPlugin::stashSnapshot() m_stashDialog->refresh(state.topLevel(), true); } -// Create a non-modal dialog with refresh method or raise if it exists +// Create a non-modal dialog with refresh function or raise if it exists template <class NonModalDialog> inline void showNonModalDialog(const QString &topLevel, QPointer<NonModalDialog> &dialog) diff --git a/src/plugins/git/gitversioncontrol.cpp b/src/plugins/git/gitversioncontrol.cpp index b98e9ea350..ae5154e81e 100644 --- a/src/plugins/git/gitversioncontrol.cpp +++ b/src/plugins/git/gitversioncontrol.cpp @@ -229,6 +229,11 @@ bool GitVersionControl::managesDirectory(const QString &directory, QString *topL return !topLevelFound.isEmpty(); } +bool GitVersionControl::managesFile(const QString &workingDirectory, const QString &fileName) const +{ + return m_client->managesFile(workingDirectory, fileName); +} + bool GitVersionControl::vcsAnnotate(const QString &file, int line) { const QFileInfo fi(file); diff --git a/src/plugins/git/gitversioncontrol.h b/src/plugins/git/gitversioncontrol.h index 6baa152077..71c53be43c 100644 --- a/src/plugins/git/gitversioncontrol.h +++ b/src/plugins/git/gitversioncontrol.h @@ -48,6 +48,7 @@ public: Core::Id id() const; bool managesDirectory(const QString &directory, QString *topLevel) const; + bool managesFile(const QString &workingDirectory, const QString &fileName) const; bool isConfigured() const; bool supportsOperation(Operation operation) const; diff --git a/src/plugins/git/settingspage.cpp b/src/plugins/git/settingspage.cpp index a76d07bc2c..075ad9ba44 100644 --- a/src/plugins/git/settingspage.cpp +++ b/src/plugins/git/settingspage.cpp @@ -72,7 +72,6 @@ GitSettings SettingsPageWidget::settings() const rc.setValue(GitSettings::timeoutKey, m_ui.timeoutSpinBox->value()); rc.setValue(GitSettings::pullRebaseKey, m_ui.pullRebaseCheckBox->isChecked()); rc.setValue(GitSettings::showTagsKey, m_ui.showTagsCheckBox->isChecked()); - rc.setValue(GitSettings::promptOnSubmitKey, m_ui.promptToSubmitCheckBox->isChecked()); rc.setValue(GitSettings::winSetHomeEnvironmentKey, m_ui.winHomeCheckBox->isChecked()); rc.setValue(GitSettings::gitkOptionsKey, m_ui.gitkOptionsLineEdit->text().trimmed()); rc.setValue(GitSettings::repositoryBrowserCmd, m_ui.repBrowserCommandPathChooser->path().trimmed()); @@ -86,7 +85,6 @@ void SettingsPageWidget::setSettings(const GitSettings &s) m_ui.timeoutSpinBox->setValue(s.intValue(GitSettings::timeoutKey)); m_ui.pullRebaseCheckBox->setChecked(s.boolValue(GitSettings::pullRebaseKey)); m_ui.showTagsCheckBox->setChecked(s.boolValue(GitSettings::showTagsKey)); - m_ui.promptToSubmitCheckBox->setChecked(s.boolValue(GitSettings::promptOnSubmitKey)); m_ui.winHomeCheckBox->setChecked(s.boolValue(GitSettings::winSetHomeEnvironmentKey)); m_ui.gitkOptionsLineEdit->setText(s.stringValue(GitSettings::gitkOptionsKey)); m_ui.repBrowserCommandPathChooser->setPath(s.stringValue(GitSettings::repositoryBrowserCmd)); @@ -102,8 +100,6 @@ QString SettingsPageWidget::searchKeywords() const << sep << m_ui.groupBox->title() << sep << m_ui.logCountLabel->text() << sep << m_ui.timeoutLabel->text() - << sep << m_ui.promptToSubmitCheckBox->text() - << sep << m_ui.promptToSubmitCheckBox->text() << sep << m_ui.gitkGroupBox->title() << sep << m_ui.gitkOptionsLabel->text() << sep << m_ui.repBrowserGroupBox->title() diff --git a/src/plugins/git/settingspage.ui b/src/plugins/git/settingspage.ui index 5e010df2a3..c546712093 100644 --- a/src/plugins/git/settingspage.ui +++ b/src/plugins/git/settingspage.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>705</width> - <height>459</height> + <height>427</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout"> @@ -60,7 +60,7 @@ <string>Miscellaneous</string> </property> <layout class="QGridLayout" name="gridLayout"> - <item row="2" column="0" colspan="2"> + <item row="1" column="0" colspan="2"> <widget class="QCheckBox" name="pullRebaseCheckBox"> <property name="text"> <string>Pull with rebase</string> @@ -96,13 +96,6 @@ </property> </widget> </item> - <item row="1" column="0" colspan="2"> - <widget class="QCheckBox" name="promptToSubmitCheckBox"> - <property name="text"> - <string>Prompt on submit</string> - </property> - </widget> - </item> <item row="0" column="0"> <widget class="QLabel" name="logCountLabel"> <property name="text"> @@ -130,7 +123,7 @@ </property> </widget> </item> - <item row="3" column="0"> + <item row="2" column="0"> <widget class="QCheckBox" name="showTagsCheckBox"> <property name="text"> <string>Show tags in Branches dialog</string> diff --git a/src/plugins/helloworld/helloworldplugin.cpp b/src/plugins/helloworld/helloworldplugin.cpp index ea781f4026..314d1e9065 100644 --- a/src/plugins/helloworld/helloworldplugin.cpp +++ b/src/plugins/helloworld/helloworldplugin.cpp @@ -68,7 +68,7 @@ public: /*! Constructs the Hello World plugin. Normally plugins don't do anything in their constructor except for initializing their member variables. The actual work is done later, in the initialize() and extensionsInitialized() - methods. + functions. */ HelloWorldPlugin::HelloWorldPlugin() { @@ -131,7 +131,7 @@ bool HelloWorldPlugin::initialize(const QStringList &arguments, QString *errorMe /*! Notification that all extensions that this plugin depends on have been initialized. The dependencies are defined in the plugins .pluginspec file. - Normally this method is used for things that rely on other plugins to have + Normally this function is used for things that rely on other plugins to have added objects to the plugin manager, that implement interfaces that we're interested in. These objects can now be requested through the PluginManagerInterface. diff --git a/src/plugins/ios/ios.pro b/src/plugins/ios/ios.pro index fcfe58b6e2..a9f3201e80 100644 --- a/src/plugins/ios/ios.pro +++ b/src/plugins/ios/ios.pro @@ -5,7 +5,7 @@ include(../../qtcreatorplugin.pri) QT += xml network -LIBS += -framework CoreFoundation -framework IOKit +macx: LIBS += -framework CoreFoundation -framework IOKit HEADERS += \ iosconstants.h \ diff --git a/src/plugins/ios/iosbuildstep.h b/src/plugins/ios/iosbuildstep.h index 43d99ce8a4..7834f3b789 100644 --- a/src/plugins/ios/iosbuildstep.h +++ b/src/plugins/ios/iosbuildstep.h @@ -30,6 +30,7 @@ #define IOSBUILDSTEP_H #include <projectexplorer/abstractprocessstep.h> +#include <utils/qtcoverride.h> QT_BEGIN_NAMESPACE class QListWidgetItem; @@ -53,11 +54,11 @@ public: IosBuildStep(ProjectExplorer::BuildStepList *parent); ~IosBuildStep(); - bool init(); - void run(QFutureInterface<bool> &fi); + bool init() QTC_OVERRIDE; + void run(QFutureInterface<bool> &fi) QTC_OVERRIDE; - ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); - bool immutable() const; + ProjectExplorer::BuildStepConfigWidget *createConfigWidget() QTC_OVERRIDE; + bool immutable() const QTC_OVERRIDE; void setBaseArguments(const QStringList &args); void setExtraArguments(const QStringList &extraArgs); QStringList baseArguments() const; @@ -68,11 +69,11 @@ public: void setClean(bool clean); bool isClean() const; - QVariantMap toMap() const; + QVariantMap toMap() const QTC_OVERRIDE; protected: IosBuildStep(ProjectExplorer::BuildStepList *parent, IosBuildStep *bs); IosBuildStep(ProjectExplorer::BuildStepList *parent, const Core::Id id); - bool fromMap(const QVariantMap &map); + bool fromMap(const QVariantMap &map) QTC_OVERRIDE; private: void ctor(); @@ -114,18 +115,18 @@ class IosBuildStepFactory : public ProjectExplorer::IBuildStepFactory public: explicit IosBuildStepFactory(QObject *parent = 0); - bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const; - ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id); + bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const QTC_OVERRIDE; + ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id) QTC_OVERRIDE; bool canClone(ProjectExplorer::BuildStepList *parent, - ProjectExplorer::BuildStep *source) const; + ProjectExplorer::BuildStep *source) const QTC_OVERRIDE; ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, - ProjectExplorer::BuildStep *source); - bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const; + ProjectExplorer::BuildStep *source) QTC_OVERRIDE; + bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const QTC_OVERRIDE; ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, - const QVariantMap &map); + const QVariantMap &map) QTC_OVERRIDE; - QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const; - QString displayNameForId(const Core::Id id) const; + QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const QTC_OVERRIDE; + QString displayNameForId(const Core::Id id) const QTC_OVERRIDE; }; } // namespace Internal diff --git a/src/plugins/ios/iosbuildstep.ui b/src/plugins/ios/iosbuildstep.ui index 70f1599101..ef8dec89e4 100644 --- a/src/plugins/ios/iosbuildstep.ui +++ b/src/plugins/ios/iosbuildstep.ui @@ -39,7 +39,7 @@ <enum>Qt::RightToLeft</enum> </property> <property name="text"> - <string>Reset defaults</string> + <string>Reset Defaults</string> </property> </widget> </item> diff --git a/src/plugins/ios/iosconfigurations.cpp b/src/plugins/ios/iosconfigurations.cpp index 9f6dff19af..5df12001f0 100644 --- a/src/plugins/ios/iosconfigurations.cpp +++ b/src/plugins/ios/iosconfigurations.cpp @@ -342,7 +342,15 @@ void IosConfigurations::updateAutomaticKitList() ToolChainKitInformation::setToolChain(newKit, pToolchain); QtSupport::QtKitInformation::setQtVersion(newKit, qt); //DeviceKitInformation::setDevice(newKit, device); - Debugger::DebuggerKitInformation::setDebugger(newKit, pToolchain->suggestedDebugger()); + + Debugger::DebuggerItem debugger; + debugger.setCommand(pToolchain->suggestedDebugger()); + debugger.setEngineType(Debugger::LldbEngineType); + debugger.setDisplayName(tr("IOS Debugger")); + debugger.setAutoDetected(true); + debugger.setAbi(pToolchain->targetAbi()); + Debugger::DebuggerKitInformation::setDebugger(newKit, debugger); + SysRootKitInformation::setSysRoot(newKit, p.sdkPath); //Qt4ProjectManager::QmakeKitInformation::setMkspec(newKit, // Utils::FileName::fromString(QLatin1String("macx-ios-clang"))); diff --git a/src/plugins/ios/iosdeployconfiguration.h b/src/plugins/ios/iosdeployconfiguration.h index 632b2b5aa4..f92ac8cc3c 100644 --- a/src/plugins/ios/iosdeployconfiguration.h +++ b/src/plugins/ios/iosdeployconfiguration.h @@ -30,6 +30,7 @@ #define IOSDEPLOYCONFIGURATION_H #include <projectexplorer/deployconfiguration.h> +#include <utils/qtcoverride.h> namespace Ios { namespace Internal { @@ -58,22 +59,22 @@ class IosDeployConfigurationFactory : public ProjectExplorer::DeployConfiguratio public: explicit IosDeployConfigurationFactory(QObject *parent = 0); - bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; - ProjectExplorer::DeployConfiguration *create(ProjectExplorer::Target *parent, const Core::Id id); - bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; + bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const QTC_OVERRIDE; + ProjectExplorer::DeployConfiguration *create(ProjectExplorer::Target *parent, const Core::Id id) QTC_OVERRIDE; + bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const QTC_OVERRIDE; ProjectExplorer::DeployConfiguration *restore(ProjectExplorer::Target *parent, - const QVariantMap &map); + const QVariantMap &map) QTC_OVERRIDE; bool canClone(ProjectExplorer::Target *parent, - ProjectExplorer::DeployConfiguration *source) const; + ProjectExplorer::DeployConfiguration *source) const QTC_OVERRIDE; ProjectExplorer::DeployConfiguration *clone(ProjectExplorer::Target *parent, - ProjectExplorer::DeployConfiguration *source); + ProjectExplorer::DeployConfiguration *source) QTC_OVERRIDE; - QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const; + QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const QTC_OVERRIDE; // used to translate the ids to names to display to the user - QString displayNameForId(const Core::Id id) const; + QString displayNameForId(const Core::Id id) const QTC_OVERRIDE; private: - bool canHandle(ProjectExplorer::Target *parent) const; + bool canHandle(ProjectExplorer::Target *parent) const QTC_OVERRIDE; }; } // namespace Internal diff --git a/src/plugins/ios/iosdeploystepfactory.h b/src/plugins/ios/iosdeploystepfactory.h index 9249488392..be9fc63bc7 100644 --- a/src/plugins/ios/iosdeploystepfactory.h +++ b/src/plugins/ios/iosdeploystepfactory.h @@ -30,6 +30,7 @@ #define IOSDEPLOYSTEPFACTORY_H #include <projectexplorer/buildstep.h> +#include <utils/qtcoverride.h> namespace Ios { namespace Internal { @@ -40,20 +41,20 @@ class IosDeployStepFactory : public ProjectExplorer::IBuildStepFactory public: explicit IosDeployStepFactory(QObject *parent = 0); - QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const; - QString displayNameForId(const Core::Id id) const; + QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const QTC_OVERRIDE; + QString displayNameForId(const Core::Id id) const QTC_OVERRIDE; bool canCreate(ProjectExplorer::BuildStepList *parent, - const Core::Id id) const; - ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id); + const Core::Id id) const QTC_OVERRIDE; + ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id) QTC_OVERRIDE; - bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const; - ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map); + bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const QTC_OVERRIDE; + ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) QTC_OVERRIDE; bool canClone(ProjectExplorer::BuildStepList *parent, - ProjectExplorer::BuildStep *product) const; + ProjectExplorer::BuildStep *product) const QTC_OVERRIDE; ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, - ProjectExplorer::BuildStep *product); + ProjectExplorer::BuildStep *product) QTC_OVERRIDE; }; } // namespace Internal diff --git a/src/plugins/ios/iosdevice.cpp b/src/plugins/ios/iosdevice.cpp index e5641426a5..378cf43031 100644 --- a/src/plugins/ios/iosdevice.cpp +++ b/src/plugins/ios/iosdevice.cpp @@ -39,15 +39,18 @@ #include <QVariantMap> #include <QMessageBox> +#ifdef Q_OS_MAC #include <IOKit/IOKitLib.h> #include <IOKit/usb/IOUSBLib.h> #include <CoreFoundation/CoreFoundation.h> +#endif + using namespace ProjectExplorer; static bool debugDeviceDetection = false; -namespace { -QString CFStringRef2QString(CFStringRef s) +#ifdef Q_OS_MAC +static QString CFStringRef2QString(CFStringRef s) { unsigned char buf[250]; CFIndex len = CFStringGetLength(s); @@ -67,8 +70,7 @@ QString CFStringRef2QString(CFStringRef s) delete[] bigBuf; return res; } - -} +#endif namespace Ios { namespace Internal { @@ -269,7 +271,7 @@ void IosDeviceManager::updateInfo(const QString &devId) { IosToolHandler *requester = new IosToolHandler(IosToolHandler::IosDeviceType, this); connect(requester, SIGNAL(deviceInfo(Ios::IosToolHandler*,QString,Ios::IosToolHandler::Dict)), - SLOT(deviceInfo(Ios::IosToolHandler *,QString,Ios::IosToolHandler::Dict)), Qt::QueuedConnection); + SLOT(deviceInfo(Ios::IosToolHandler*,QString,Ios::IosToolHandler::Dict)), Qt::QueuedConnection); connect(requester, SIGNAL(finished(Ios::IosToolHandler*)), SLOT(infoGathererFinished(Ios::IosToolHandler*))); requester->requestDeviceInfo(devId); @@ -349,6 +351,7 @@ void IosDeviceManager::infoGathererFinished(IosToolHandler *gatherer) gatherer->deleteLater(); } +#ifdef Q_OS_MAC namespace { io_iterator_t gAddedIter; io_iterator_t gRemovedIter; @@ -418,9 +421,11 @@ void deviceDisconnectedCallback(void *refCon, io_iterator_t iterator) } // extern C } // anonymous namespace +#endif void IosDeviceManager::monitorAvailableDevices() { +#ifdef Q_OS_MAC CFMutableDictionaryRef matchingDictionary = IOServiceMatching("IOUSBDevice" ); { @@ -469,7 +474,7 @@ void IosDeviceManager::monitorAvailableDevices() // Iterate once to get already-present devices and arm the notification deviceConnectedCallback(NULL, gAddedIter); deviceDisconnectedCallback(NULL, gRemovedIter); - +#endif } diff --git a/src/plugins/ios/iosdevicefactory.h b/src/plugins/ios/iosdevicefactory.h index c77ecc7483..704e4f34f6 100644 --- a/src/plugins/ios/iosdevicefactory.h +++ b/src/plugins/ios/iosdevicefactory.h @@ -33,6 +33,7 @@ #include <QTimer> #include <QMap> #include <QString> +#include <utils/qtcoverride.h> namespace Ios { namespace Internal { @@ -43,13 +44,13 @@ class IosDeviceFactory : public ProjectExplorer::IDeviceFactory public: IosDeviceFactory(); - QString displayNameForId(Core::Id type) const; - QList<Core::Id> availableCreationIds() const; + QString displayNameForId(Core::Id type) const QTC_OVERRIDE; + QList<Core::Id> availableCreationIds() const QTC_OVERRIDE; - bool canCreate() const; - ProjectExplorer::IDevice::Ptr create(Core::Id id) const; - bool canRestore(const QVariantMap &map) const; - ProjectExplorer::IDevice::Ptr restore(const QVariantMap &map) const; + bool canCreate() const QTC_OVERRIDE; + ProjectExplorer::IDevice::Ptr create(Core::Id id) const QTC_OVERRIDE; + bool canRestore(const QVariantMap &map) const QTC_OVERRIDE; + ProjectExplorer::IDevice::Ptr restore(const QVariantMap &map) const QTC_OVERRIDE; }; } // namespace Internal diff --git a/src/plugins/ios/iosmanager.cpp b/src/plugins/ios/iosmanager.cpp index 4f25cba3b9..16fddc102b 100644 --- a/src/plugins/ios/iosmanager.cpp +++ b/src/plugins/ios/iosmanager.cpp @@ -47,7 +47,6 @@ #include <QFileSystemWatcher> #include <QList> #include <QProcess> -#include <QMessageBox> #include <QApplication> #include <QDomDocument> diff --git a/src/plugins/ios/iosqtversionfactory.h b/src/plugins/ios/iosqtversionfactory.h index d63b578086..2757576e0f 100644 --- a/src/plugins/ios/iosqtversionfactory.h +++ b/src/plugins/ios/iosqtversionfactory.h @@ -30,6 +30,7 @@ #define IOSQTVERSIONFACTORY_H #include <qtsupport/qtversionfactory.h> +#include <utils/qtcoverride.h> namespace Ios { namespace Internal { @@ -39,13 +40,13 @@ class IosQtVersionFactory : public QtSupport::QtVersionFactory public: explicit IosQtVersionFactory(QObject *parent = 0); - bool canRestore(const QString &type); - QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data); + bool canRestore(const QString &type) QTC_OVERRIDE; + QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data) QTC_OVERRIDE; - int priority() const; + int priority() const QTC_OVERRIDE; QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, - const QString &autoDetectionSource = QString()); + const QString &autoDetectionSource = QString()) QTC_OVERRIDE; }; } // namespace Internal diff --git a/src/plugins/ios/iosrunfactories.cpp b/src/plugins/ios/iosrunfactories.cpp index 2ddaf5e1b1..c5517270bd 100644 --- a/src/plugins/ios/iosrunfactories.cpp +++ b/src/plugins/ios/iosrunfactories.cpp @@ -110,27 +110,6 @@ QString IosRunConfigurationFactory::displayNameForId(const Core::Id id) const return QFileInfo(pathFromId(id)).completeBaseName(); } -RunConfiguration *IosRunConfigurationFactory::create(Target *parent, const Core::Id id) -{ - if (!canCreate(parent, id)) - return 0; - return new IosRunConfiguration(parent, id, pathFromId(id)); -} - -RunConfiguration *IosRunConfigurationFactory::restore(Target *parent, - const QVariantMap &map) -{ - if (!canRestore(parent, map)) - return 0; - Core::Id id = ProjectExplorer::idFromMap(map); - IosRunConfiguration *rc = new IosRunConfiguration(parent, id, pathFromId(id)); - if (rc->fromMap(map)) - return rc; - - delete rc; - return 0; -} - RunConfiguration *IosRunConfigurationFactory::clone(Target *parent, RunConfiguration *source) { if (!canClone(parent, source)) @@ -193,10 +172,5 @@ RunControl *IosRunControlFactory::create(RunConfiguration *runConfig, return IosDebugSupport::createDebugRunControl(rc, errorMessage); } -QString IosRunControlFactory::displayName() const -{ - return tr("Run on iOS device or simulator."); -} - } // namespace Internal } // namespace Qt4ProjectManager diff --git a/src/plugins/ios/iosrunfactories.h b/src/plugins/ios/iosrunfactories.h index 5b63620e6b..c7de3148a7 100644 --- a/src/plugins/ios/iosrunfactories.h +++ b/src/plugins/ios/iosrunfactories.h @@ -54,12 +54,8 @@ public: QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const QTC_OVERRIDE; bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const QTC_OVERRIDE; - ProjectExplorer::RunConfiguration *create(ProjectExplorer::Target *parent, - const Core::Id id) QTC_OVERRIDE; bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const QTC_OVERRIDE; - ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent, - const QVariantMap &map) QTC_OVERRIDE; bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const QTC_OVERRIDE; @@ -82,13 +78,11 @@ class IosRunControlFactory : public ProjectExplorer::IRunControlFactory public: explicit IosRunControlFactory(QObject *parent = 0); - QString displayName() const; - bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, - ProjectExplorer::RunMode mode) const; + ProjectExplorer::RunMode mode) const QTC_OVERRIDE; ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode, - QString *errorMessage); + QString *errorMessage) QTC_OVERRIDE; }; } // namespace Internal diff --git a/src/plugins/ios/iosrunner.cpp b/src/plugins/ios/iosrunner.cpp index e2cb6b6f8f..f084659900 100644 --- a/src/plugins/ios/iosrunner.cpp +++ b/src/plugins/ios/iosrunner.cpp @@ -159,8 +159,8 @@ void IosRunner::handleErrorMsg(IosToolHandler *handler, const QString &msg) { if (msg.contains(QLatin1String("AMDeviceStartService returned -402653150"))) { QMessageBox mBox; - mBox.setText(tr("Running on iOS device failed")); - mBox.setInformativeText(tr("This might be due to not up-to date certificates in Xcode or the device, go to the organizer window of Xcode to ensure that all certificates are up to date and try again.")); + mBox.setText(tr("Running on iOS device failed.")); + mBox.setInformativeText(tr("The certificates in Xcode or the device might be outdated. Check the certificates in the organizer window of Xcode, and try again.")); mBox.setStandardButtons(QMessageBox::Ok); mBox.setDefaultButton(QMessageBox::Ok); mBox.setIcon(QMessageBox::Information); diff --git a/src/plugins/ios/iossimulatorfactory.h b/src/plugins/ios/iossimulatorfactory.h index 763912ce8e..5055af6f07 100644 --- a/src/plugins/ios/iossimulatorfactory.h +++ b/src/plugins/ios/iossimulatorfactory.h @@ -30,6 +30,7 @@ #define IOSSIMULATORFACTORY_H #include <projectexplorer/devicesupport/idevicefactory.h> +#include <utils/qtcoverride.h> namespace Ios { namespace Internal { @@ -40,13 +41,13 @@ class IosSimulatorFactory : public ProjectExplorer::IDeviceFactory public: IosSimulatorFactory(); - QString displayNameForId(Core::Id type) const; - QList<Core::Id> availableCreationIds() const; + QString displayNameForId(Core::Id type) const QTC_OVERRIDE; + QList<Core::Id> availableCreationIds() const QTC_OVERRIDE; - bool canCreate() const; - ProjectExplorer::IDevice::Ptr create(Core::Id id) const; - bool canRestore(const QVariantMap &map) const; - ProjectExplorer::IDevice::Ptr restore(const QVariantMap &map) const; + bool canCreate() const QTC_OVERRIDE; + ProjectExplorer::IDevice::Ptr create(Core::Id id) const QTC_OVERRIDE; + bool canRestore(const QVariantMap &map) const QTC_OVERRIDE; + ProjectExplorer::IDevice::Ptr restore(const QVariantMap &map) const QTC_OVERRIDE; }; } // namespace Internal diff --git a/src/plugins/macros/imacrohandler.cpp b/src/plugins/macros/imacrohandler.cpp index 25630a24ae..c29be0b74e 100644 --- a/src/plugins/macros/imacrohandler.cpp +++ b/src/plugins/macros/imacrohandler.cpp @@ -60,8 +60,8 @@ using namespace Macros::Internal; When replaying a macro, the manager iterates through all macro events specified in \a macroEvent - in the macro and calls this method to determine which handler to use. - If the method returns \c true, \c executeEvent is called. + in the macro and calls this function to determine which handler to use. + If the function returns \c true, \c executeEvent is called. */ /*! diff --git a/src/plugins/macros/macromanager.cpp b/src/plugins/macros/macromanager.cpp index 036a0f7320..b24573c6c9 100644 --- a/src/plugins/macros/macromanager.cpp +++ b/src/plugins/macros/macromanager.cpp @@ -77,13 +77,13 @@ using namespace Macros::Internal; The MacroManager manages all macros, loads them on startup, keeps track of the current macro, and creates new macros. - There are two important methods in this class that can be used outside the Macros plugin: + There are two important functions in this class that can be used outside the Macros plugin: \list \li registerEventHandler: add a new event handler \li registerAction: add a macro event when this action is triggered \endlist - This class is a singleton and can be accessed using the instance method. + This class is a singleton and can be accessed using the instance function. */ /*! diff --git a/src/plugins/mercurial/mercurialclient.cpp b/src/plugins/mercurial/mercurialclient.cpp index e4966d2627..f1969682f5 100644 --- a/src/plugins/mercurial/mercurialclient.cpp +++ b/src/plugins/mercurial/mercurialclient.cpp @@ -257,6 +257,15 @@ QString MercurialClient::vcsGetRepositoryURL(const QString &directory) return QString(); } +bool MercurialClient::managesFile(const QString &workingDirectory, const QString &fileName) const +{ + QStringList args; + args << QLatin1String("status") << QLatin1String("--unknown") << fileName; + QByteArray output; + vcsFullySynchronousExec(workingDirectory, args, &output); + return output.isEmpty(); +} + void MercurialClient::incoming(const QString &repositoryRoot, const QString &repository) { QStringList args; diff --git a/src/plugins/mercurial/mercurialclient.h b/src/plugins/mercurial/mercurialclient.h index 7f12b8470f..845d2db478 100644 --- a/src/plugins/mercurial/mercurialclient.h +++ b/src/plugins/mercurial/mercurialclient.h @@ -63,6 +63,7 @@ public: void incoming(const QString &repositoryRoot, const QString &repository = QString()); void outgoing(const QString &repositoryRoot); QString vcsGetRepositoryURL(const QString &directory); + bool managesFile(const QString &workingDirectory, const QString &fileName) const; void annotate(const QString &workingDir, const QString &file, const QString revision = QString(), int lineNumber = -1, diff --git a/src/plugins/mercurial/mercurialcontrol.cpp b/src/plugins/mercurial/mercurialcontrol.cpp index 8eaa73dce1..c8fa812e2d 100644 --- a/src/plugins/mercurial/mercurialcontrol.cpp +++ b/src/plugins/mercurial/mercurialcontrol.cpp @@ -64,6 +64,11 @@ bool MercurialControl::managesDirectory(const QString &directory, QString *topLe return !topLevelFound.isEmpty(); } +bool MercurialControl::managesFile(const QString &workingDirectory, const QString &fileName) const +{ + return mercurialClient->managesFile(workingDirectory, fileName); +} + bool MercurialControl::isConfigured() const { const QString binary = mercurialClient->settings()->binaryPath(); diff --git a/src/plugins/mercurial/mercurialcontrol.h b/src/plugins/mercurial/mercurialcontrol.h index 3fac104c04..4a5c2e872c 100644 --- a/src/plugins/mercurial/mercurialcontrol.h +++ b/src/plugins/mercurial/mercurialcontrol.h @@ -53,6 +53,7 @@ public: QString displayName() const; Core::Id id() const; bool managesDirectory(const QString &filename, QString *topLevel = 0) const; + bool managesFile(const QString &workingDirectory, const QString &fileName) const; bool isConfigured() const; bool supportsOperation(Operation operation) const; bool vcsOpen(const QString &fileName); diff --git a/src/plugins/mercurial/mercurialplugin.cpp b/src/plugins/mercurial/mercurialplugin.cpp index abd529c2ad..8febeebee6 100644 --- a/src/plugins/mercurial/mercurialplugin.cpp +++ b/src/plugins/mercurial/mercurialplugin.cpp @@ -606,7 +606,7 @@ bool MercurialPlugin::submitEditorAboutToClose() Core::IDocument *editorFile = commitEditor->document(); QTC_ASSERT(editorFile, return true); - bool dummyPrompt = mercurialSettings.boolValue(MercurialSettings::promptOnSubmitKey); + bool dummyPrompt = false; const VcsBaseSubmitEditor::PromptSubmitResult response = commitEditor->promptSubmit(tr("Close Commit Editor"), tr("Do you want to commit the changes?"), tr("Message check failed. Do you want to proceed?"), diff --git a/src/plugins/mercurial/optionspage.cpp b/src/plugins/mercurial/optionspage.cpp index fa51834145..79e5ca41ad 100644 --- a/src/plugins/mercurial/optionspage.cpp +++ b/src/plugins/mercurial/optionspage.cpp @@ -56,7 +56,6 @@ MercurialSettings OptionsPageWidget::settings() const s.setValue(MercurialSettings::userEmailKey, m_ui.defaultEmailLineEdit->text().trimmed()); s.setValue(MercurialSettings::logCountKey, m_ui.logEntriesCount->value()); s.setValue(MercurialSettings::timeoutKey, m_ui.timeout->value()); - s.setValue(MercurialSettings::promptOnSubmitKey, m_ui.promptOnSubmitCheckBox->isChecked()); return s; } @@ -67,7 +66,6 @@ void OptionsPageWidget::setSettings(const MercurialSettings &s) m_ui.defaultEmailLineEdit->setText(s.stringValue(MercurialSettings::userEmailKey)); m_ui.logEntriesCount->setValue(s.intValue(MercurialSettings::logCountKey)); m_ui.timeout->setValue(s.intValue(MercurialSettings::timeoutKey)); - m_ui.promptOnSubmitCheckBox->setChecked(s.boolValue(MercurialSettings::promptOnSubmitKey)); } QString OptionsPageWidget::searchKeywords() const @@ -83,7 +81,6 @@ QString OptionsPageWidget::searchKeywords() const << sep << m_ui.miscGroupBox->title() << sep << m_ui.showLogEntriesLabel->text() << sep << m_ui.timeoutSecondsLabel->text() - << sep << m_ui.promptOnSubmitCheckBox->text() ; rc.remove(QLatin1Char('&')); return rc; diff --git a/src/plugins/mercurial/optionspage.ui b/src/plugins/mercurial/optionspage.ui index 00f4362d27..2a763c596b 100644 --- a/src/plugins/mercurial/optionspage.ui +++ b/src/plugins/mercurial/optionspage.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>617</width> - <height>327</height> + <height>268</height> </rect> </property> <property name="windowTitle"> @@ -82,26 +82,6 @@ <string>Miscellaneous</string> </property> <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="showLogEntriesLabel"> - <property name="text"> - <string>Log count:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QSpinBox" name="logEntriesCount"> - <property name="toolTip"> - <string>The number of recent commit logs to show, choose 0 to see all entries.</string> - </property> - <property name="maximum"> - <number>100</number> - </property> - <property name="value"> - <number>100</number> - </property> - </widget> - </item> <item row="0" column="2"> <widget class="QLabel" name="timeoutSecondsLabel"> <property name="text"> @@ -132,13 +112,23 @@ </property> </spacer> </item> - <item row="1" column="0" colspan="2"> - <widget class="QCheckBox" name="promptOnSubmitCheckBox"> - <property name="text"> - <string>Prompt on submit</string> + <item row="0" column="1"> + <widget class="QSpinBox" name="logEntriesCount"> + <property name="toolTip"> + <string>The number of recent commit logs to show, choose 0 to see all entries.</string> + </property> + <property name="maximum"> + <number>100</number> </property> - <property name="checked"> - <bool>true</bool> + <property name="value"> + <number>100</number> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="showLogEntriesLabel"> + <property name="text"> + <string>Log count:</string> </property> </widget> </item> diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index a4e42e28bd..69dcc62fbc 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -692,10 +692,10 @@ void PerforcePlugin::annotate() } } -void PerforcePlugin::vcsAnnotate(const QString &file, const QString &revision, int lineNumber) +void PerforcePlugin::vcsAnnotate(const QString &workingDirectory, const QString &file, + const QString &revision, int lineNumber) { - const QFileInfo fi(file); - annotate(fi.absolutePath(), fi.fileName(), revision, lineNumber); + annotate(workingDirectory, file, revision, lineNumber); } void PerforcePlugin::annotate(const QString &workingDir, @@ -828,6 +828,14 @@ bool PerforcePlugin::managesDirectory(const QString &directory, QString *topLeve return rc; } +bool PerforcePlugin::managesFile(const QString &workingDirectory, const QString &fileName) const +{ + QStringList args; + args << QLatin1String("fstat") << QLatin1String("-m1") << fileName; + const PerforceResponse result = runP4Cmd(workingDirectory, args, RunFullySynchronous); + return result.stdOut.contains(QLatin1String("depotFile")); +} + bool PerforcePlugin::managesDirectoryFstat(const QString &directory) { if (!m_settings.isValid()) @@ -1166,8 +1174,8 @@ Core::IEditor *PerforcePlugin::showOutputInEditor(const QString &title, const QS << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec); QString s = title; Core::IEditor *editor = Core::EditorManager::openEditorWithContents(id, &s, output.toUtf8()); - connect(editor, SIGNAL(annotateRevisionRequested(QString,QString,int)), - this, SLOT(vcsAnnotate(QString,QString,int))); + connect(editor, SIGNAL(annotateRevisionRequested(QString,QString,QString,int)), + this, SLOT(vcsAnnotate(QString,QString,QString,int))); PerforceEditor *e = qobject_cast<PerforceEditor*>(editor->widget()); if (!e) return 0; diff --git a/src/plugins/perforce/perforceplugin.h b/src/plugins/perforce/perforceplugin.h index 33d8f4737b..b03fab15c9 100644 --- a/src/plugins/perforce/perforceplugin.h +++ b/src/plugins/perforce/perforceplugin.h @@ -86,6 +86,7 @@ public: void extensionsInitialized(); bool managesDirectory(const QString &directory, QString *topLevel = 0); + bool managesFile(const QString &workingDirectory, const QString &fileName) const; bool vcsOpen(const QString &workingDir, const QString &fileName); bool vcsAdd(const QString &workingDir, const QString &fileName); bool vcsDelete(const QString &workingDir, const QString &filename); @@ -105,7 +106,8 @@ public: public slots: void describe(const QString &source, const QString &n); - void vcsAnnotate(const QString &file, const QString &revision /* = QString() */, int lineNumber); + void vcsAnnotate(const QString &workingDirectory, const QString &file, + const QString &revision, int lineNumber); void p4Diff(const Perforce::Internal::PerforceDiffParameters &p); private slots: diff --git a/src/plugins/perforce/perforceversioncontrol.cpp b/src/plugins/perforce/perforceversioncontrol.cpp index 19303a66fa..37c78efce9 100644 --- a/src/plugins/perforce/perforceversioncontrol.cpp +++ b/src/plugins/perforce/perforceversioncontrol.cpp @@ -147,7 +147,8 @@ bool PerforceVersionControl::vcsRemoveSnapshot(const QString &, const QString &) bool PerforceVersionControl::vcsAnnotate(const QString &file, int line) { - m_plugin->vcsAnnotate(file, QString(), line); + const QFileInfo fi(file); + m_plugin->vcsAnnotate(fi.absolutePath(), fi.fileName(), QString(), line); return true; } @@ -183,6 +184,11 @@ bool PerforceVersionControl::managesDirectory(const QString &directory, QString return rc; } +bool PerforceVersionControl::managesFile(const QString &workingDirectory, const QString &fileName) const +{ + return m_plugin->managesFile(workingDirectory, fileName); +} + void PerforceVersionControl::emitRepositoryChanged(const QString &s) { emit repositoryChanged(s); diff --git a/src/plugins/perforce/perforceversioncontrol.h b/src/plugins/perforce/perforceversioncontrol.h index 888ce89850..844791429e 100644 --- a/src/plugins/perforce/perforceversioncontrol.h +++ b/src/plugins/perforce/perforceversioncontrol.h @@ -47,6 +47,7 @@ public: Core::Id id() const; bool managesDirectory(const QString &directory, QString *topLevel = 0) const; + bool managesFile(const QString &workingDirectory, const QString &fileName) const; bool isConfigured() const; bool supportsOperation(Operation operation) const; diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index b20e24425f..39311cdc0f 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -48,11 +48,8 @@ SUBDIRS = \ todo \ qnx \ clearcase \ - baremetal - -macx { - SUBDIRS += ios -} + baremetal \ + ios isEmpty(QBS_INSTALL_DIR): QBS_INSTALL_DIR = $$(QBS_INSTALL_DIR) exists(../shared/qbs/qbs.pro)|!isEmpty(QBS_INSTALL_DIR): \ diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index 768cd9556a..a9933d3ffc 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -74,7 +74,7 @@ using namespace ProjectExplorer; Enables or disables a BuildStep. - Disabled BuildSteps immediately return true from their run method. + Disabled BuildSteps immediately return true from their run function. Should be called from init(). */ diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index 343032ea1b..38bd39b6eb 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -120,6 +120,11 @@ DeviceProcessSignalOperation::Ptr DesktopDevice::signalOperation() const return DeviceProcessSignalOperation::Ptr(new DesktopProcessSignalOperation()); } +QString DesktopDevice::qmlProfilerHost() const +{ + return QLatin1String("localhost"); +} + IDevice::Ptr DesktopDevice::clone() const { return Ptr(new DesktopDevice(*this)); diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.h b/src/plugins/projectexplorer/devicesupport/desktopdevice.h index 1b65f6c49b..e83783e1bf 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.h +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.h @@ -56,6 +56,7 @@ public: bool canCreateProcess() const { return true; } DeviceProcess *createProcess(QObject *parent) const; DeviceProcessSignalOperation::Ptr signalOperation() const; + QString qmlProfilerHost() const; IDevice::Ptr clone() const; diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 304991c86d..88b135a59e 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -380,6 +380,11 @@ void IDevice::setSshParameters(const QSsh::SshConnectionParameters &sshParameter d->sshParameters = sshParameters; } +QString IDevice::qmlProfilerHost() const +{ + return d->sshParameters.host; +} + void IDevice::setFreePorts(const Utils::PortList &freePorts) { d->freePorts = freePorts; diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index 9b0df7453c..a0e021fc2a 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -159,6 +159,8 @@ public: QSsh::SshConnectionParameters sshParameters() const; void setSshParameters(const QSsh::SshConnectionParameters &sshParameters); + virtual QString qmlProfilerHost() const; + Utils::PortList freePorts() const; void setFreePorts(const Utils::PortList &freePorts); diff --git a/src/plugins/projectexplorer/ioutputparser.cpp b/src/plugins/projectexplorer/ioutputparser.cpp index ea073d0824..2c03191ad5 100644 --- a/src/plugins/projectexplorer/ioutputparser.cpp +++ b/src/plugins/projectexplorer/ioutputparser.cpp @@ -102,14 +102,14 @@ /*! \fn void ProjectExplorer::IOutputParser::outputAdded(const QString &string, ProjectExplorer::BuildStep::OutputFormat format) - This method can be overwritten to change the string. + This function can be overwritten to change the string. */ /*! \fn void ProjectExplorer::IOutputParser::taskAdded(const ProjectExplorer::Task &task) Subparsers have their addTask signal connected to this slot. - This method can be overwritten to change the task. + This function can be overwritten to change the task. */ /*! @@ -118,7 +118,7 @@ Instructs a parser to flush its state. Parsers may have state (for example, because they need to aggregate several lines into one task). This - method is called when this state needs to be flushed out to be visible. + function is called when this state needs to be flushed out to be visible. doFlush() is called by flush(). flush() is called on child parsers whenever a new task is added. diff --git a/src/plugins/projectexplorer/nodesvisitor.cpp b/src/plugins/projectexplorer/nodesvisitor.cpp index ba64f18752..bdc29fb80d 100644 --- a/src/plugins/projectexplorer/nodesvisitor.cpp +++ b/src/plugins/projectexplorer/nodesvisitor.cpp @@ -38,7 +38,7 @@ using namespace ProjectExplorer; \brief Base class for visitors that can be used to traverse a node hierarchy. The class follows the visitor pattern as described in Gamma et al. Pass - an instance of NodesVisitor to FolderNode::accept(): The visit methods + an instance of NodesVisitor to FolderNode::accept(): The visit functions will be called for each node in the subtree, except for file nodes: Access these through FolderNode::fileNodes() in visitProjectNode() and visitoFolderNode(). diff --git a/src/plugins/projectexplorer/outputparser_test.cpp b/src/plugins/projectexplorer/outputparser_test.cpp index 0b5ab36600..4e42bee6e6 100644 --- a/src/plugins/projectexplorer/outputparser_test.cpp +++ b/src/plugins/projectexplorer/outputparser_test.cpp @@ -40,7 +40,7 @@ OutputParserTester::OutputParserTester() : m_debug(false) { } -// test methods: +// test functions: void OutputParserTester::testParsing(const QString &lines, Channel inputChannel, QList<Task> tasks, diff --git a/src/plugins/projectexplorer/outputparser_test.h b/src/plugins/projectexplorer/outputparser_test.h index d56c5492d2..54e50ab5ad 100644 --- a/src/plugins/projectexplorer/outputparser_test.h +++ b/src/plugins/projectexplorer/outputparser_test.h @@ -54,7 +54,7 @@ public: OutputParserTester(); - // test methods: + // test functions: void testParsing(const QString &lines, Channel inputChannel, QList<Task> tasks, const QString &childStdOutLines, diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 63c0051fcf..b70f20254b 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -326,7 +326,7 @@ bool Project::restoreSettings() This map is then saved in the .user file of the project. Just put all your data into the map. - \note Do not forget to call your base class' toMap method. + \note Do not forget to call your base class' toMap function. \note Do not forget to call setActiveBuildConfiguration when creating new build configurations. */ diff --git a/src/plugins/projectexplorer/projectconfiguration.h b/src/plugins/projectexplorer/projectconfiguration.h index 2bcebb811e..0fcc4dab06 100644 --- a/src/plugins/projectexplorer/projectconfiguration.h +++ b/src/plugins/projectexplorer/projectconfiguration.h @@ -57,10 +57,10 @@ public: void setDisplayName(const QString &name); void setDefaultDisplayName(const QString &name); - // Note: Make sure subclasses call the superclasses' fromMap() method! + // Note: Make sure subclasses call the superclasses' fromMap() function! virtual bool fromMap(const QVariantMap &map); - // Note: Make sure subclasses call the superclasses' toMap() method! + // Note: Make sure subclasses call the superclasses' toMap() function! virtual QVariantMap toMap() const; signals: diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index dad6d1720f..58497eb38f 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1519,7 +1519,7 @@ static inline QStringList projectFileGlobs() } /*! - This method is connected to the ICore::coreOpened signal. If + This function is connected to the ICore::coreOpened signal. If there was no session explicitly loaded, it creates an empty new default session and puts the list of recent projects and sessions onto the welcome page. diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index c27b0980e8..bf8fe13f65 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -98,7 +98,6 @@ QtcPlugin { "namedwidget.cpp", "namedwidget.h", "nodesvisitor.cpp", "nodesvisitor.h", "osparser.cpp", "osparser.h", - "outputparser_test.cpp", "outputparser_test.h", "pluginfilefactory.cpp", "pluginfilefactory.h", "processparameters.cpp", "processparameters.h", "processstep.cpp", "processstep.h", "processstep.ui", diff --git a/src/plugins/projectexplorer/projectfilewizardextension.cpp b/src/plugins/projectexplorer/projectfilewizardextension.cpp index 05fd1c2cf3..f7d3c32db4 100644 --- a/src/plugins/projectexplorer/projectfilewizardextension.cpp +++ b/src/plugins/projectexplorer/projectfilewizardextension.cpp @@ -62,6 +62,9 @@ #include <QTextCursor> #include <QMessageBox> +using namespace TextEditor; +using namespace Core; + /*! \class ProjectExplorer::Internal::ProjectFileWizardExtension @@ -177,13 +180,13 @@ struct ProjectWizardContext ProjectWizardContext(); void clear(); - QList<Core::IVersionControl*> versionControls; - QList<Core::IVersionControl*> activeVersionControls; + QList<IVersionControl*> versionControls; + QList<IVersionControl*> activeVersionControls; QList<ProjectEntry> projects; QPointer<ProjectWizardPage> page; // this is managed by the wizard! bool repositoryExists; // Is VCS 'add' sufficient, or should a repository be created? QString commonDirectory; - const Core::IWizard *wizard; + const IWizard *wizard; }; ProjectWizardContext::ProjectWizardContext() : @@ -265,16 +268,16 @@ static int findMatchingProject(const QList<ProjectEntry> &projects, return bestMatch; } -static QString generatedProjectFilePath(const QList<Core::GeneratedFile> &files) +static QString generatedProjectFilePath(const QList<GeneratedFile> &files) { - foreach (const Core::GeneratedFile &file, files) - if (file.attributes() & Core::GeneratedFile::OpenProjectAttribute) + foreach (const GeneratedFile &file, files) + if (file.attributes() & GeneratedFile::OpenProjectAttribute) return file.path(); return QString(); } void ProjectFileWizardExtension::firstExtensionPageShown( - const QList<Core::GeneratedFile> &files, + const QList<GeneratedFile> &files, const QVariantMap &extraValues) { initProjectChoices(generatedProjectFilePath(files)); @@ -284,7 +287,7 @@ void ProjectFileWizardExtension::firstExtensionPageShown( // Parametrize wizard page: find best project to add to, set up files display and // version control depending on path QStringList fileNames; - foreach (const Core::GeneratedFile &f, files) + foreach (const GeneratedFile &f, files) fileNames.push_back(f.path()); m_context->commonDirectory = Utils::commonPath(fileNames); m_context->page->setFilesDisplay(m_context->commonDirectory, fileNames); @@ -321,7 +324,7 @@ void ProjectFileWizardExtension::firstExtensionPageShown( // Store all version controls for later use: if (m_context->versionControls.isEmpty()) { - foreach (Core::IVersionControl *vc, ExtensionSystem::PluginManager::getObjects<Core::IVersionControl>()) { + foreach (IVersionControl *vc, ExtensionSystem::PluginManager::getObjects<IVersionControl>()) { m_context->versionControls.append(vc); connect(vc, SIGNAL(configurationChanged()), this, SLOT(initializeVersionControlChoices())); } @@ -340,7 +343,7 @@ void ProjectFileWizardExtension::initializeVersionControlChoices() // 2) Directory is managed and VCS does not support "Add" -> None available // 3) Directory is not managed -> Offer all VCS that support "CreateRepository" - Core::IVersionControl *currentSelection = 0; + IVersionControl *currentSelection = 0; int currentIdx = m_context->page->versionControlIndex() - 1; if (currentIdx >= 0 && currentIdx <= m_context->activeVersionControls.size() - 1) currentSelection = m_context->activeVersionControls.at(currentIdx); @@ -349,18 +352,18 @@ void ProjectFileWizardExtension::initializeVersionControlChoices() QStringList versionControlChoices = QStringList(tr("<None>")); if (!m_context->commonDirectory.isEmpty()) { - Core::IVersionControl *managingControl = Core::VcsManager::findVersionControlForDirectory(m_context->commonDirectory); + IVersionControl *managingControl = VcsManager::findVersionControlForDirectory(m_context->commonDirectory); if (managingControl) { // Under VCS - if (managingControl->supportsOperation(Core::IVersionControl::AddOperation)) { + if (managingControl->supportsOperation(IVersionControl::AddOperation)) { versionControlChoices.append(managingControl->displayName()); m_context->activeVersionControls.push_back(managingControl); m_context->repositoryExists = true; } } else { // Create - foreach (Core::IVersionControl *vc, m_context->versionControls) - if (vc->supportsOperation(Core::IVersionControl::CreateRepositoryOperation)) { + foreach (IVersionControl *vc, m_context->versionControls) + if (vc->supportsOperation(IVersionControl::CreateRepositoryOperation)) { versionControlChoices.append(vc->displayName()); m_context->activeVersionControls.append(vc); } @@ -378,7 +381,7 @@ void ProjectFileWizardExtension::initializeVersionControlChoices() } } -QList<QWizardPage *> ProjectFileWizardExtension::extensionPages(const Core::IWizard *wizard) +QList<QWizardPage *> ProjectFileWizardExtension::extensionPages(const IWizard *wizard) { if (!m_context) m_context = new ProjectWizardContext; @@ -410,7 +413,7 @@ static inline void getProjectChoicesAndToolTips(QStringList *projectChoicesParam ProjectEntryMap entryMap; ProjectNode::ProjectAction projectAction = - context->wizard->kind() == Core::IWizard::ProjectWizard + context->wizard->kind() == IWizard::ProjectWizard ? ProjectNode::AddSubProject : ProjectNode::AddNewFile; foreach (ProjectNode *n, AllProjectNodesVisitor::allProjects(projectAction)) { if (projectAction == ProjectNode::AddNewFile @@ -448,7 +451,7 @@ void ProjectFileWizardExtension::initProjectChoices(const QString &generatedProj } bool ProjectFileWizardExtension::processFiles( - const QList<Core::GeneratedFile> &files, + const QList<GeneratedFile> &files, bool *removeOpenProjectAttribute, QString *errorMessage) { if (!processProject(files, removeOpenProjectAttribute, errorMessage)) @@ -461,7 +464,7 @@ bool ProjectFileWizardExtension::processFiles( errorMessage->clear(); } message.append(tr("Open project anyway?")); - if (QMessageBox::question(Core::ICore::mainWindow(), tr("Version Control Failure"), message, + if (QMessageBox::question(ICore::mainWindow(), tr("Version Control Failure"), message, QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) return false; } @@ -470,7 +473,7 @@ bool ProjectFileWizardExtension::processFiles( // Add files to project && version control bool ProjectFileWizardExtension::processProject( - const QList<Core::GeneratedFile> &files, + const QList<GeneratedFile> &files, bool *removeOpenProjectAttribute, QString *errorMessage) { *removeOpenProjectAttribute = false; @@ -482,7 +485,7 @@ bool ProjectFileWizardExtension::processProject( if (projectIndex < 0 || projectIndex >= m_context->projects.size()) return true; ProjectNode *project = m_context->projects.at(projectIndex).node; - if (m_context->wizard->kind() == Core::IWizard::ProjectWizard) { + if (m_context->wizard->kind() == IWizard::ProjectWizard) { if (!project->addSubProjects(QStringList(generatedProject))) { *errorMessage = tr("Failed to add subproject '%1'\nto project '%2'.") .arg(generatedProject).arg(project->path()); @@ -491,7 +494,7 @@ bool ProjectFileWizardExtension::processProject( *removeOpenProjectAttribute = true; } else { QStringList filePaths; - foreach (const Core::GeneratedFile &generatedFile, files) + foreach (const GeneratedFile &generatedFile, files) filePaths << generatedFile.path(); if (!project->addFiles(filePaths)) { *errorMessage = tr("Failed to add one or more files to project\n'%1' (%2)."). @@ -502,25 +505,25 @@ bool ProjectFileWizardExtension::processProject( return true; } -bool ProjectFileWizardExtension::processVersionControl(const QList<Core::GeneratedFile> &files, QString *errorMessage) +bool ProjectFileWizardExtension::processVersionControl(const QList<GeneratedFile> &files, QString *errorMessage) { // Add files to version control (Entry at 0 is 'None'). const int vcsIndex = m_context->page->versionControlIndex() - 1; if (vcsIndex < 0 || vcsIndex >= m_context->activeVersionControls.size()) return true; QTC_ASSERT(!m_context->commonDirectory.isEmpty(), return false); - Core::IVersionControl *versionControl = m_context->activeVersionControls.at(vcsIndex); + IVersionControl *versionControl = m_context->activeVersionControls.at(vcsIndex); // Create repository? if (!m_context->repositoryExists) { - QTC_ASSERT(versionControl->supportsOperation(Core::IVersionControl::CreateRepositoryOperation), return false); + QTC_ASSERT(versionControl->supportsOperation(IVersionControl::CreateRepositoryOperation), return false); if (!versionControl->vcsCreateRepository(m_context->commonDirectory)) { *errorMessage = tr("A version control system repository could not be created in '%1'.").arg(m_context->commonDirectory); return false; } } // Add files if supported. - if (versionControl->supportsOperation(Core::IVersionControl::AddOperation)) { - foreach (const Core::GeneratedFile &generatedFile, files) { + if (versionControl->supportsOperation(IVersionControl::AddOperation)) { + foreach (const GeneratedFile &generatedFile, files) { if (!versionControl->vcsAdd(generatedFile.path())) { *errorMessage = tr("Failed to add '%1' to the version control system.").arg(generatedFile.path()); return false; @@ -530,7 +533,7 @@ bool ProjectFileWizardExtension::processVersionControl(const QList<Core::Generat return true; } -static TextEditor::ICodeStylePreferences *codeStylePreferences(ProjectExplorer::Project *project, Core::Id languageId) +static ICodeStylePreferences *codeStylePreferences(Project *project, Id languageId) { if (!languageId.isValid()) return 0; @@ -538,16 +541,16 @@ static TextEditor::ICodeStylePreferences *codeStylePreferences(ProjectExplorer:: if (project) return project->editorConfiguration()->codeStyle(languageId); - return TextEditor::TextEditorSettings::codeStyle(languageId); + return TextEditorSettings::codeStyle(languageId); } -void ProjectFileWizardExtension::applyCodeStyle(Core::GeneratedFile *file) const +void ProjectFileWizardExtension::applyCodeStyle(GeneratedFile *file) const { if (file->isBinary() || file->contents().isEmpty()) return; // nothing to do - Core::MimeType mt = Core::MimeDatabase::findByFile(QFileInfo(file->path())); - Core::Id languageId = TextEditor::TextEditorSettings::languageId(mt.type()); + MimeType mt = MimeDatabase::findByFile(QFileInfo(file->path())); + Id languageId = TextEditorSettings::languageId(mt.type()); if (!languageId.isValid()) return; // don't modify files like *.ui *.pro @@ -559,23 +562,22 @@ void ProjectFileWizardExtension::applyCodeStyle(Core::GeneratedFile *file) const Project *baseProject = SessionManager::projectForNode(project); - TextEditor::ICodeStylePreferencesFactory *factory - = TextEditor::TextEditorSettings::codeStyleFactory(languageId); + ICodeStylePreferencesFactory *factory = TextEditorSettings::codeStyleFactory(languageId); - TextEditor::Indenter *indenter = 0; + Indenter *indenter = 0; if (factory) indenter = factory->createIndenter(); if (!indenter) - indenter = new TextEditor::NormalIndenter(); + indenter = new NormalIndenter(); - TextEditor::ICodeStylePreferences *codeStylePrefs = codeStylePreferences(baseProject, languageId); + ICodeStylePreferences *codeStylePrefs = codeStylePreferences(baseProject, languageId); indenter->setCodeStylePreferences(codeStylePrefs); QTextDocument doc(file->contents()); QTextCursor cursor(&doc); cursor.select(QTextCursor::Document); indenter->indent(&doc, cursor, QChar::Null, codeStylePrefs->currentTabSettings()); delete indenter; - if (TextEditor::TextEditorSettings::storageSettings().m_cleanWhitespace) { + if (TextEditorSettings::storageSettings().m_cleanWhitespace) { QTextBlock block = doc.firstBlock(); while (block.isValid()) { codeStylePrefs->currentTabSettings().removeTrailingWhitespace(cursor, block); diff --git a/src/plugins/projectexplorer/projectnodes.cpp b/src/plugins/projectexplorer/projectnodes.cpp index e1f97cf178..06f4e78ee1 100644 --- a/src/plugins/projectexplorer/projectnodes.cpp +++ b/src/plugins/projectexplorer/projectnodes.cpp @@ -91,7 +91,7 @@ void Node::emitNodeSortKeyChanged() /*! * The path of the file representing this node. * - * This method does not emit any signals. That has to be done by the calling + * This function does not emit any signals. That has to be done by the calling * class. */ void Node::setPath(const QString &path) @@ -613,7 +613,7 @@ void ProjectNode::removeFolderNodes(const QList<FolderNode*> &subFolders, Adds file nodes specified by \a files to the internal list in the location specified by \a folder and emits the corresponding signals. - This method should be called within an implementation of the public method + This function should be called within an implementation of the public function addFiles. */ @@ -658,7 +658,7 @@ void ProjectNode::addFileNodes(const QList<FileNode*> &files, FolderNode *folder Removes \a files from the internal list and emits the corresponding signals. All objects in the \a files list are deleted. - This method should be called within an implementation of the public method + This function should be called within an implementation of the public function removeFiles. */ diff --git a/src/plugins/projectexplorer/projectnodes.h b/src/plugins/projectexplorer/projectnodes.h index b324dff4ec..424a877d80 100644 --- a/src/plugins/projectexplorer/projectnodes.h +++ b/src/plugins/projectexplorer/projectnodes.h @@ -240,7 +240,7 @@ public: void removeFileNodes(const QList<FileNode*> &files, FolderNode *parentFolder); // to be called in implementation of - // the corresponding public methods + // the corresponding public functions void addProjectNodes(const QList<ProjectNode*> &subProjects); void removeProjectNodes(const QList<ProjectNode*> &subProjects); diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 583ed05988..86bd83d6c3 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -201,7 +201,7 @@ protected: RunConfiguration(Target *parent, const Core::Id id); RunConfiguration(Target *parent, RunConfiguration *source); - /// convenience method to get current build configuration. + /// convenience function to get current build configuration. BuildConfiguration *activeBuildConfiguration() const; private: diff --git a/src/plugins/projectexplorer/targetsetuppage.cpp b/src/plugins/projectexplorer/targetsetuppage.cpp index 30689aa050..adc3db5474 100644 --- a/src/plugins/projectexplorer/targetsetuppage.cpp +++ b/src/plugins/projectexplorer/targetsetuppage.cpp @@ -458,6 +458,7 @@ void TargetSetupPage::import(const Utils::FileName &path, bool silent) widget->addBuildInfo(info, true); widget->setKitSelected(true); } + emit completeChanged(); } void TargetSetupPage::removeWidget(Kit *k) diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index d6b3d2d919..0ca4793033 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -156,7 +156,7 @@ bool ToolChain::operator == (const ToolChain &tc) const /*! Used by the tool chain manager to save user-generated tool chains. - Make sure to call this method when deriving. + Make sure to call this function when deriving. */ QVariantMap ToolChain::toMap() const @@ -185,7 +185,7 @@ void ToolChain::setDetection(ToolChain::Detection de) /*! Used by the tool chain manager to load user-generated tool chains. - Make sure to call this method when deriving. + Make sure to call this function when deriving. */ bool ToolChain::fromMap(const QVariantMap &data) diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index 71b7b1e244..74f1545317 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -150,7 +150,7 @@ public: virtual ToolChain *clone() const = 0; // Used by the toolchainmanager to save user-generated tool chains. - // Make sure to call this method when deriving! + // Make sure to call this function when deriving! virtual QVariantMap toMap() const; virtual QList<Task> validateKit(const Kit *k) const; protected: @@ -159,7 +159,7 @@ protected: void toolChainUpdated(); - // Make sure to call this method when deriving! + // Make sure to call this function when deriving! virtual bool fromMap(const QVariantMap &data); private: diff --git a/src/plugins/pythoneditor/tools/pythonhighlighter.cpp b/src/plugins/pythoneditor/tools/pythonhighlighter.cpp index 32c59ef6b0..2bb2bd9caa 100644 --- a/src/plugins/pythoneditor/tools/pythonhighlighter.cpp +++ b/src/plugins/pythoneditor/tools/pythonhighlighter.cpp @@ -106,9 +106,9 @@ PythonHighlighter::~PythonHighlighter() /** * @brief Highlighter::highlightBlock highlights single line of Python code * @param text is single line without EOLN symbol. Access to all block data - * can be obtained through inherited currentBlock() method. + * can be obtained through inherited currentBlock() function. * - * This method receives state (int number) from previously highlighted block, + * This function receives state (int number) from previously highlighted block, * scans block using received state and sets initial highlighting for current * block. At the end, it saves internal state in current block. */ diff --git a/src/plugins/pythoneditor/tools/pythonindenter.cpp b/src/plugins/pythoneditor/tools/pythonindenter.cpp index befa7f6e02..e65dd295fe 100644 --- a/src/plugins/pythoneditor/tools/pythonindenter.cpp +++ b/src/plugins/pythoneditor/tools/pythonindenter.cpp @@ -70,8 +70,8 @@ bool PythonIndenter::isElectricCharacter(const QChar &ch) const * @param typedChar Unused * @param tabSettings An IDE tabulation settings * - * Usually this method called once when you begin new line of code by pressing - * Enter. If Indenter reimplements indent() method, than indentBlock() may be + * Usually this function called once when you begin new line of code by pressing + * Enter. If Indenter reimplements indent() function, than indentBlock() may be * called in other cases. */ void PythonIndenter::indentBlock(QTextDocument *document, diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index a5444559d2..139a153af0 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -67,6 +67,8 @@ QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, c data.insert(QLatin1String(QTCORE_VERSION), qt->qtVersionString()); if (qt->isFrameworkBuild()) data.insert(QLatin1String(QTCORE_FRAMEWORKBUILD), true); + data.insert(QLatin1String(QTCORE_CONFIG), qt->configValues()); + data.insert(QLatin1String(QTCORE_QTCONFIG), qt->qtConfigValues()); } if (ProjectExplorer::SysRootKitInformation::hasSysRoot(k)) diff --git a/src/plugins/qbsprojectmanager/qbsconstants.h b/src/plugins/qbsprojectmanager/qbsconstants.h index 9b8cf7c15f..148999ff97 100644 --- a/src/plugins/qbsprojectmanager/qbsconstants.h +++ b/src/plugins/qbsprojectmanager/qbsconstants.h @@ -45,6 +45,8 @@ const char QTCORE_NAMESPACE[] = "Qt.core.namespace"; const char QTCORE_LIBINFIX[] = "Qt.core.libInfix"; const char QTCORE_MKSPEC[] = "Qt.core.mkspecPath"; const char QTCORE_FRAMEWORKBUILD[] = "Qt.core.frameworkBuild"; +const char QTCORE_CONFIG[] = "Qt.core.config"; +const char QTCORE_QTCONFIG[] = "Qt.core.qtConfig"; // Toolchain related settings: diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index 5bfa4ddf61..cdf44807d5 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -152,21 +152,28 @@ ProjectNode *QbsProject::rootProjectNode() const return m_rootProjectNode; } +static void collectFilesForProject(const qbs::ProjectData &project, QSet<QString> &result) +{ + result.insert(project.location().fileName()); + foreach (const qbs::ProductData &prd, project.products()) { + foreach (const qbs::GroupData &grp, prd.groups()) { + foreach (const QString &file, grp.allFilePaths()) + result.insert(file); + result.insert(grp.location().fileName()); + } + result.insert(prd.location().fileName()); + } + foreach (const qbs::ProjectData &subProject, project.subProjects()) + collectFilesForProject(subProject, result); +} + QStringList QbsProject::files(Project::FilesMode fileMode) const { Q_UNUSED(fileMode); + if (!m_rootProjectNode || !m_rootProjectNode->qbsProjectData().isValid()) + return QStringList(); QSet<QString> result; - if (m_rootProjectNode && m_rootProjectNode->qbsProjectData().isValid()) { - foreach (const qbs::ProductData &prd, m_rootProjectNode->qbsProjectData().allProducts()) { - foreach (const qbs::GroupData &grp, prd.groups()) { - foreach (const QString &file, grp.allFilePaths()) - result.insert(file); - result.insert(grp.location().fileName()); - } - result.insert(prd.location().fileName()); - } - result.insert(m_rootProjectNode->qbsProjectData().location().fileName()); - } + collectFilesForProject(m_rootProjectNode->qbsProjectData(), result); return result.toList(); } diff --git a/src/plugins/qmldesigner/components/componentcore/defaultdesigneraction.h b/src/plugins/qmldesigner/components/componentcore/defaultdesigneraction.h index 04d5160b7f..b0610cb863 100644 --- a/src/plugins/qmldesigner/components/componentcore/defaultdesigneraction.h +++ b/src/plugins/qmldesigner/components/componentcore/defaultdesigneraction.h @@ -48,7 +48,7 @@ public: signals: void triggered(bool checked, const SelectionContext &selectionContext); -public slots: //virtual method instead of slot +public slots: //virtual function instead of slot virtual void actionTriggered(bool enable); void setSelectionContext(const SelectionContext &selectionContext); diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorscene.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorscene.cpp index df00f13b0f..a350b29ff5 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorscene.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorscene.cpp @@ -142,7 +142,7 @@ AbstractFormEditorTool* FormEditorScene::currentTool() const return m_editorView->currentTool(); } -//This method calculates the possible parent for reparent +//This function calculates the possible parent for reparent FormEditorItem* FormEditorScene::calulateNewParent(FormEditorItem *formEditorItem) { if (formEditorItem->qmlItemNode().isValid()) { diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp index be51e341bc..e1c67f76be 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp @@ -111,7 +111,7 @@ void FormEditorView::modelAttached(Model *model) } -//This method does the setup of the initial FormEditorItem tree in the scene +//This function does the setup of the initial FormEditorItem tree in the scene void FormEditorView::setupFormEditorItemTree(const QmlItemNode &qmlItemNode) { m_scene->addFormEditorItem(qmlItemNode); diff --git a/src/plugins/qmldesigner/components/pluginmanager/iplugin.h b/src/plugins/qmldesigner/components/pluginmanager/iplugin.h index 97df850e89..9c0cc217dc 100644 --- a/src/plugins/qmldesigner/components/pluginmanager/iplugin.h +++ b/src/plugins/qmldesigner/components/pluginmanager/iplugin.h @@ -36,7 +36,7 @@ namespace QmlDesigner { -// QmlDesigner "base" plugin with initialization method in which +// QmlDesigner "base" plugin with initialization function in which // it can retriece the core via its static accessor and do magic. class IPlugin diff --git a/src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp index cefc0b9987..b5c04086a4 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp @@ -183,7 +183,7 @@ MetaInfo MetaInfo::global() /*! Clears the global meta information object. - This method should be called once on application shutdown to free static data structures. + This function should be called once on application shutdown to free static data structures. */ void MetaInfo::clearGlobal() { diff --git a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp index 70f6863259..94e9bbc018 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp @@ -65,7 +65,7 @@ The object can be invalid - you can check this by calling isValid(). The object is invalid if you ask for meta information for an non-existing qml property. Also the node meta info can become invalid if the enclosing type is deregistered from the meta type system (e.g. -a sub component qml file is deleted). Trying to call any accessor methods on an invalid +a sub component qml file is deleted). Trying to call any accessor functions on an invalid NodeMetaInfo object will result in an InvalidMetaInfoException being thrown. \see QmlDesigner::MetaInfo, QmlDesigner::PropertyMetaInfo, QmlDesigner::EnumeratorMetaInfo diff --git a/src/plugins/qmldesigner/designercore/model/internalnodeabstractproperty.h b/src/plugins/qmldesigner/designercore/model/internalnodeabstractproperty.h index 0ac4c77a4a..eee3b8806a 100644 --- a/src/plugins/qmldesigner/designercore/model/internalnodeabstractproperty.h +++ b/src/plugins/qmldesigner/designercore/model/internalnodeabstractproperty.h @@ -55,7 +55,7 @@ public: virtual bool isValid() const; - using InternalProperty::remove; // keep the virtual remove(...) method around + using InternalProperty::remove; // keep the virtual remove(...) function around protected: InternalNodeAbstractProperty(const PropertyName &name, const InternalNodePointer &propertyOwner); diff --git a/src/plugins/qmldesigner/designercore/model/modelnode.cpp b/src/plugins/qmldesigner/designercore/model/modelnode.cpp index 7925ee468e..7abcc8a4b9 100644 --- a/src/plugins/qmldesigner/designercore/model/modelnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/modelnode.cpp @@ -612,7 +612,7 @@ void ModelNode::destroy() //\} /*! \name Property Manipulation - * This methodes interact with properties. + * This functions interact with properties. */ diff --git a/src/plugins/qmldesigner/designercore/model/modeltotextmerger.h b/src/plugins/qmldesigner/designercore/model/modeltotextmerger.h index 7d177b353c..a8190eb5cd 100644 --- a/src/plugins/qmldesigner/designercore/model/modeltotextmerger.h +++ b/src/plugins/qmldesigner/designercore/model/modeltotextmerger.h @@ -55,7 +55,7 @@ public: ModelToTextMerger(RewriterView *reWriterView); /** - * Note: his method might throw exceptions, as the model works this way. So to + * Note: his function might throw exceptions, as the model works this way. So to * handle rewriting failures, you will also need to catch any exception coming * out. */ diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp index 29cf46d84c..520b07dac7 100644 --- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp +++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp @@ -384,7 +384,7 @@ public: /// When something is changed here, also change Check::checkScopeObjectMember in /// qmljscheck.cpp - /// ### Maybe put this into the context as a helper method. + /// ### Maybe put this into the context as a helper function. bool lookupProperty(const QString &prefix, const UiQualifiedId *id, const Value **property = 0, const ObjectValue **parentObject = 0, QString *name = 0) { QList<const ObjectValue *> scopeObjects = m_scopeChain.qmlScopeObjects(); diff --git a/src/plugins/qmljseditor/qmljsquickfix.h b/src/plugins/qmljseditor/qmljsquickfix.h index ba01ecb4cd..3a22b3f8cc 100644 --- a/src/plugins/qmljseditor/qmljsquickfix.h +++ b/src/plugins/qmljseditor/qmljsquickfix.h @@ -91,7 +91,7 @@ protected: void matchingOperations(const QuickFixInterface &interface, QuickFixOperations &result); /*! - Implement this method to match and create the appropriate + Implement this function to match and create the appropriate QmlJSQuickFixOperation objects. */ virtual void match(const QmlJSQuickFixInterface &interface, TextEditor::QuickFixOperations &result) = 0; diff --git a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp index 775668f7c8..d0fd1c7738 100644 --- a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp @@ -256,7 +256,7 @@ bool QmlProfilerClientManager::isConnected() const void QmlProfilerClientManager::disconnectClient() { // this might be actually be called indirectly by QDDConnectionPrivate::readyRead(), therefore allow - // method to complete before deleting object + // function to complete before deleting object if (d->connection) { d->connection->deleteLater(); d->connection = 0; diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index f8812232de..582ddca23d 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -57,8 +57,6 @@ #include <projectexplorer/localapplicationrunconfiguration.h> #include <texteditor/itexteditor.h> -#include <android/androidconstants.h> - #include <coreplugin/coreconstants.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/icore.h> @@ -400,8 +398,6 @@ void QmlProfilerTool::clearDisplay() static void startRemoteTool(IAnalyzerTool *tool, StartMode mode) { - Q_UNUSED(tool); - Id kitId; quint16 port; Kit *kit = 0; @@ -433,17 +429,11 @@ static void startRemoteTool(IAnalyzerTool *tool, StartMode mode) IDevice::ConstPtr device = DeviceKitInformation::device(kit); if (device) { sp.connParams = device->sshParameters(); - if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE - || device->type() == Android::Constants::ANDROID_DEVICE_TYPE) { - sp.analyzerHost = QLatin1String("localhost"); - } else { - sp.analyzerHost = sp.connParams.host; - } + sp.analyzerHost = device->qmlProfilerHost(); } sp.sysroot = SysRootKitInformation::sysRoot(kit).toString(); sp.analyzerPort = port; - //AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, 0); AnalyzerRunControl *rc = tool->createRunControl(sp, 0); QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt())); diff --git a/src/plugins/qnx/blackberryinstallwizardndkpage.ui b/src/plugins/qnx/blackberryinstallwizardndkpage.ui index 321892e584..133d1ca012 100644 --- a/src/plugins/qnx/blackberryinstallwizardndkpage.ui +++ b/src/plugins/qnx/blackberryinstallwizardndkpage.ui @@ -17,7 +17,7 @@ <item> <widget class="QLabel" name="label"> <property name="text"> - <string>Select NDK Path</string> + <string>Select Native SDK path:</string> </property> </widget> </item> diff --git a/src/plugins/qnx/blackberryinstallwizardpages.cpp b/src/plugins/qnx/blackberryinstallwizardpages.cpp index 39033251d5..d23933f010 100644 --- a/src/plugins/qnx/blackberryinstallwizardpages.cpp +++ b/src/plugins/qnx/blackberryinstallwizardpages.cpp @@ -94,6 +94,7 @@ BlackBerryInstallWizardOptionPage::BlackBerryInstallWizardOptionPage(BlackBerryI , m_envFileChooser(new NdkPathChooser(NdkPathChooser::ManualMode)) , m_data(data) { + setTitle(tr("Options")); connect(m_addButton, SIGNAL(toggled(bool)), this, SLOT(handleOptionChanged())); connect(m_envFileChooser, SIGNAL(pathChanged(QString)), this, SLOT(handlePathChanged(QString))); } @@ -159,6 +160,7 @@ BlackBerryInstallWizardNdkPage::BlackBerryInstallWizardNdkPage(BlackBerryInstall , m_validNdkPath(false) { m_ui->setupUi(this); + setTitle(tr("Native SDK")); m_ui->verticalLayout->addWidget(m_ndkPathChooser); connect(m_ui->ndkPathListWidget, SIGNAL(itemSelectionChanged()), this, SLOT(setNdkPath())); connect(m_ndkPathChooser, SIGNAL(pathChanged(QString)), this, SLOT(setManualNdkPath())); @@ -242,8 +244,9 @@ BlackBerryInstallWizardTargetPage::BlackBerryInstallWizardTargetPage(BlackBerryI , m_targetListProcess(new QProcess(this)) { m_ui->setupUi(this); + setTitle(tr("Target")); - connect(m_targetListProcess, SIGNAL(finished(int, QProcess::ExitStatus)), + connect(m_targetListProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(targetsListProcessFinished())); connect(m_ui->targetsTreeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(setTarget())); } @@ -258,10 +261,10 @@ void BlackBerryInstallWizardTargetPage::initializePage() { // process may be running if going back and forth if (m_targetListProcess->state() == QProcess::Running) { - disconnect(m_targetListProcess, SIGNAL(finished(int, QProcess::ExitStatus)), + disconnect(m_targetListProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(targetsListProcessFinished())); Utils::SynchronousProcess::stopProcess(*m_targetListProcess); - connect(m_targetListProcess, SIGNAL(finished(int, QProcess::ExitStatus)), + connect(m_targetListProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(targetsListProcessFinished())); } @@ -351,8 +354,13 @@ BlackBerryInstallWizardProcessPage::BlackBerryInstallWizardProcessPage(BlackBerr , m_targetProcess(new QProcess(this)) { m_ui->setupUi(this); - connect(m_targetProcess, SIGNAL(finished(int, QProcess::ExitStatus)), - this, SLOT(handleProcessFinished(int, QProcess::ExitStatus))); + if (m_data.mode == BlackBerryInstallerDataHandler::UninstallMode) + setTitle(tr("Uninstalling")); + else + setTitle(tr("Installing")); + + connect(m_targetProcess, SIGNAL(finished(int,QProcess::ExitStatus)), + this, SLOT(handleProcessFinished(int,QProcess::ExitStatus))); } BlackBerryInstallWizardProcessPage::~BlackBerryInstallWizardProcessPage() @@ -383,11 +391,11 @@ void BlackBerryInstallWizardProcessPage::initializePage() } // m_targetProcess could be running if (m_targetProcess->state() == QProcess::Running) { - disconnect(m_targetProcess, SIGNAL(finished(int, QProcess::ExitStatus)), - this, SLOT(handleProcessFinished(int, QProcess::ExitStatus))); + disconnect(m_targetProcess, SIGNAL(finished(int,QProcess::ExitStatus)), + this, SLOT(handleProcessFinished(int,QProcess::ExitStatus))); Utils::SynchronousProcess::stopProcess(*m_targetProcess); - connect(m_targetProcess, SIGNAL(finished(int, QProcess::ExitStatus)), - this, SLOT(handleProcessFinished(int, QProcess::ExitStatus))); + connect(m_targetProcess, SIGNAL(finished(int,QProcess::ExitStatus)), + this, SLOT(handleProcessFinished(int,QProcess::ExitStatus))); } processTarget(); @@ -451,6 +459,7 @@ BlackBerryInstallWizardFinalPage::BlackBerryInstallWizardFinalPage(BlackBerryIns : QWizardPage(parent) , m_data(data) { + setTitle(tr("Summary")); } void BlackBerryInstallWizardFinalPage::initializePage() diff --git a/src/plugins/qt4projectmanager/externaleditors.h b/src/plugins/qt4projectmanager/externaleditors.h index e333d6e5df..e3f85b13d3 100644 --- a/src/plugins/qt4projectmanager/externaleditors.h +++ b/src/plugins/qt4projectmanager/externaleditors.h @@ -50,7 +50,7 @@ namespace Qt4ProjectManager { namespace Internal { /* Convenience parametrizable base class for Qt editors/binaries - * Provides convenience methods that + * Provides convenience functions that * try to retrieve the binary of the editor from the Qt version * of the project the file belongs to, falling back to path search * if none is found. On Mac, the "open" mechanism can be optionally be used. */ @@ -65,7 +65,7 @@ public: virtual QString displayName() const; protected: - // Method pointer for a QtVersion method return a string (command) + // Member function pointer for a QtVersion function return a string (command) typedef QString (QtSupport::BaseQtVersion::*QtVersionCommandAccessor)() const; // Data required to launch the editor diff --git a/src/plugins/qt4projectmanager/qmakeprojectimporter.cpp b/src/plugins/qt4projectmanager/qmakeprojectimporter.cpp index 953e2daed0..f9e0176a1b 100644 --- a/src/plugins/qt4projectmanager/qmakeprojectimporter.cpp +++ b/src/plugins/qt4projectmanager/qmakeprojectimporter.cpp @@ -151,7 +151,7 @@ QList<ProjectExplorer::BuildInfo *> QmakeProjectImporter::import(const Utils::Fi // create info: QmakeBuildInfo *info = new QmakeBuildInfo(factory); - if (makefileBuildConfig.first | QtSupport::BaseQtVersion::DebugBuild) { + if (makefileBuildConfig.first & QtSupport::BaseQtVersion::DebugBuild) { info->type = ProjectExplorer::BuildConfiguration::Debug; info->displayName = QCoreApplication::translate("Qt4ProjectManager::Internal::QmakeProjectImporter", "Debug"); } else { diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp index ee27f181c5..8be72bff5b 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.cpp +++ b/src/plugins/qt4projectmanager/qt4nodes.cpp @@ -297,7 +297,7 @@ struct InternalNode // * file2 // * path2 // * file1 - // The method first creates a tree that looks like the directory structure, i.e. + // The function first creates a tree that looks like the directory structure, i.e. // * / // * absolute // * path diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index d1d9cd6625..98ca503fb1 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -815,10 +815,11 @@ void BaseQtVersion::ensureMkSpecParsed() const void BaseQtVersion::parseMkSpec(ProFileEvaluator *evaluator) const { - QStringList configValues = evaluator->values(QLatin1String("CONFIG")); + m_configValues = evaluator->values(QLatin1String("CONFIG")); + m_qtConfigValues = evaluator->values(QLatin1String("QT_CONFIG")); m_defaultConfigIsDebugAndRelease = false; m_frameworkBuild = false; - foreach (const QString &value, configValues) { + foreach (const QString &value, m_configValues) { if (value == QLatin1String("debug")) m_defaultConfigIsDebug = true; else if (value == QLatin1String("release")) @@ -1050,6 +1051,18 @@ QString BaseQtVersion::examplesPath() const return qmakeProperty("QT_INSTALL_EXAMPLES"); } +QStringList BaseQtVersion::configValues() const +{ + ensureMkSpecParsed(); + return m_configValues; +} + +QStringList BaseQtVersion::qtConfigValues() const +{ + ensureMkSpecParsed(); + return m_qtConfigValues; +} + QList<HeaderPath> BaseQtVersion::systemHeaderPathes(const Kit *k) const { Q_UNUSED(k); diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h index 6093488f04..6ff0b22bf0 100644 --- a/src/plugins/qtsupport/baseqtversion.h +++ b/src/plugins/qtsupport/baseqtversion.h @@ -36,6 +36,7 @@ #include <projectexplorer/abi.h> +#include <QStringList> #include <QVariantMap> namespace Utils { @@ -235,6 +236,9 @@ public: bool hasDebugBuild() const; bool hasReleaseBuild() const; + QStringList configValues() const; + QStringList qtConfigValues() const; + protected: BaseQtVersion(); BaseQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString()); @@ -279,6 +283,9 @@ private: mutable bool m_qmakeIsExecutable; mutable bool m_hasQtAbis; + mutable QStringList m_configValues; + mutable QStringList m_qtConfigValues; + QString m_displayName; QString m_autodetectionSource; mutable Utils::FileName m_sourcePath; diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index 6eda6cab25..197babdbcf 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -110,6 +110,11 @@ public: void setupQtVersions() { + if (!QtVersionManager::isLoaded()) { + connect(QtVersionManager::instance(), SIGNAL(qtVersionsLoaded()), this, SLOT(qtVersionManagerLoaded())); + return; + } + beginResetModel(); clear(); @@ -173,6 +178,11 @@ public slots: QVariant variant = data(modelIndex, Qt::UserRole + 2); return variant; } + void qtVersionManagerLoaded() + { + disconnect(QtVersionManager::instance(), SIGNAL(qtVersionsLoaded()), this, SLOT(qtVersionManagerLoaded())); + setupQtVersions(); + } }; ExamplesListModel::ExamplesListModel(QObject *parent) : @@ -700,9 +710,11 @@ void ExamplesListModel::ensureInitialized() const void ExamplesListModel::filterForQtById(int id) { - m_uniqueQtId = id; - setUniqueQtVersionIdSetting(id); - updateExamples(); + if (QtVersionManager::isLoaded()) { + m_uniqueQtId = id; + setUniqueQtVersionIdSetting(id); + updateExamples(); + } } ExamplesListModelFilter::ExamplesListModelFilter(ExamplesListModel *sourceModel, QObject *parent) : @@ -716,6 +728,7 @@ ExamplesListModelFilter::ExamplesListModelFilter(ExamplesListModel *sourceModel, connect(this, SIGNAL(showTutorialsOnlyChanged()), SLOT(updateFilter())); connect(sourceModel, SIGNAL(qtVersionsChanged()), SLOT(handleQtVersionsChanged())); setSourceModel(m_sourceModel); + m_qtVersionModel->setupQtVersions(); } void ExamplesListModelFilter::updateFilter() diff --git a/src/plugins/qtsupport/qtversionmanager.h b/src/plugins/qtsupport/qtversionmanager.h index 8b80ff80fe..e043f05247 100644 --- a/src/plugins/qtsupport/qtversionmanager.h +++ b/src/plugins/qtsupport/qtversionmanager.h @@ -77,7 +77,7 @@ public: // Note: DO NOT STORE THIS POINTER! // The QtVersionManager will delete it at random times and you will - // need to get a new pointer by calling this method again! + // need to get a new pointer by calling this function again! static BaseQtVersion *version(int id); static BaseQtVersion *qtVersionForQMakeBinary(const Utils::FileName &qmakePath); diff --git a/src/plugins/remotelinux/linuxdeviceprocess.cpp b/src/plugins/remotelinux/linuxdeviceprocess.cpp index 2dd8e792a7..029aa6e3bb 100644 --- a/src/plugins/remotelinux/linuxdeviceprocess.cpp +++ b/src/plugins/remotelinux/linuxdeviceprocess.cpp @@ -56,7 +56,7 @@ QString LinuxDeviceProcess::fullCommandLine() const { QString fullCommandLine; foreach (const QString &filePath, rcFilesToSource()) - fullCommandLine += QString::fromLatin1("test -f %1 && source %1;").arg(filePath); + fullCommandLine += QString::fromLatin1("test -f %1 && . %1;").arg(filePath); if (!m_workingDir.isEmpty()) { fullCommandLine.append(QLatin1String("cd ")).append(quote(m_workingDir)) .append(QLatin1String(" && ")); diff --git a/src/plugins/subversion/subversioncontrol.cpp b/src/plugins/subversion/subversioncontrol.cpp index 3b11ef8aca..200105bb3b 100644 --- a/src/plugins/subversion/subversioncontrol.cpp +++ b/src/plugins/subversion/subversioncontrol.cpp @@ -146,6 +146,11 @@ bool SubversionControl::managesDirectory(const QString &directory, QString *topL return m_plugin->managesDirectory(directory, topLevel); } +bool SubversionControl::managesFile(const QString &workingDirectory, const QString &fileName) const +{ + return m_plugin->managesFile(workingDirectory, fileName); +} + bool SubversionControl::vcsAnnotate(const QString &file, int line) { const QFileInfo fi(file); diff --git a/src/plugins/subversion/subversioncontrol.h b/src/plugins/subversion/subversioncontrol.h index d7b3a5ca44..ce7c54dfb2 100644 --- a/src/plugins/subversion/subversioncontrol.h +++ b/src/plugins/subversion/subversioncontrol.h @@ -47,6 +47,7 @@ public: Core::Id id() const; bool managesDirectory(const QString &directory, QString *topLevel = 0) const; + bool managesFile(const QString &workingDirectory, const QString &fileName) const; bool isConfigured() const; bool supportsOperation(Operation operation) const; diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index d41c1b2428..de57be400e 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -545,10 +545,10 @@ void SubversionDiffParameterWidget::triggerReRun() emit reRunDiff(effectiveParameters); } -static inline void setDiffBaseDirectory(Core::IEditor *editor, const QString &db) +static inline void setWorkingDirectory(Core::IEditor *editor, const QString &wd) { if (VcsBase::VcsBaseEditorWidget *ve = qobject_cast<VcsBase::VcsBaseEditorWidget*>(editor->widget())) - ve->setDiffBaseDirectory(db); + ve->setWorkingDirectory(wd); } void SubversionPlugin::svnDiff(const QString &workingDir, const QStringList &files, QString diffname) @@ -590,12 +590,12 @@ void SubversionPlugin::svnDiff(const Subversion::Internal::SubversionDiffParamet if (Core::IEditor *existingEditor = VcsBase::VcsBaseEditorWidget::locateEditorByTag(tag)) { existingEditor->document()->setContents(response.stdOut.toUtf8()); Core::EditorManager::activateEditor(existingEditor); - setDiffBaseDirectory(existingEditor, p.workingDir); + setWorkingDirectory(existingEditor, p.workingDir); return; } const QString title = QString::fromLatin1("svn diff %1").arg(diffName); Core::IEditor *editor = showOutputInEditor(title, response.stdOut, VcsBase::DiffOutput, source, codec); - setDiffBaseDirectory(editor, p.workingDir); + setWorkingDirectory(editor, p.workingDir); VcsBase::VcsBaseEditorWidget::tagEditor(editor, tag); SubversionEditor *diffEditorWidget = qobject_cast<SubversionEditor *>(editor->widget()); QTC_ASSERT(diffEditorWidget, return); @@ -940,12 +940,12 @@ void SubversionPlugin::annotateCurrentFile() vcsAnnotate(state.currentFileTopLevel(), state.relativeCurrentFile()); } -void SubversionPlugin::annotateVersion(const QString &file, +void SubversionPlugin::annotateVersion(const QString &workingDirectory, + const QString &file, const QString &revision, int lineNr) { - const QFileInfo fi(file); - vcsAnnotate(fi.absolutePath(), fi.fileName(), revision, lineNr); + vcsAnnotate(workingDirectory, file, revision, lineNr); } void SubversionPlugin::vcsAnnotate(const QString &workingDir, const QString &file, @@ -1083,7 +1083,7 @@ SubversionResponse const QStringList &arguments, int timeOut, unsigned flags, - QTextCodec *outputCodec) + QTextCodec *outputCodec) const { const bool hasAuth = m_settings.hasAuthentication(); return runSvn(workingDir, @@ -1142,7 +1142,7 @@ SubversionPlugin::Version SubversionPlugin::svnVersion() SubversionResponse SubversionPlugin::runSvn(const QString &workingDir, const QString &userName, const QString &password, const QStringList &arguments, int timeOut, - unsigned flags, QTextCodec *outputCodec) + unsigned flags, QTextCodec *outputCodec) const { const QString executable = m_settings.binaryPath(); SubversionResponse response; @@ -1177,8 +1177,8 @@ Core::IEditor *SubversionPlugin::showOutputInEditor(const QString &title, const << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec); QString s = title; Core::IEditor *editor = Core::EditorManager::openEditorWithContents(id, &s, output.toUtf8()); - connect(editor, SIGNAL(annotateRevisionRequested(QString,QString,int)), - this, SLOT(annotateVersion(QString,QString,int))); + connect(editor, SIGNAL(annotateRevisionRequested(QString,QString,QString,int)), + this, SLOT(annotateVersion(QString,QString,QString,int))); SubversionEditor *e = qobject_cast<SubversionEditor*>(editor->widget()); if (!e) return 0; @@ -1354,6 +1354,15 @@ bool SubversionPlugin::managesDirectory(const QString &directory, QString *topLe return true; } +bool SubversionPlugin::managesFile(const QString &workingDirectory, const QString &fileName) const +{ + QStringList args; + args << QLatin1String("status") << fileName; + SubversionResponse response = + runSvn(workingDirectory, args, m_settings.timeOutMs(), 0); + return response.stdOut.isEmpty() || response.stdOut.at(0) != QLatin1Char('?'); +} + // Check whether SVN management subdirs exist. bool SubversionPlugin::checkSVNSubDir(const QDir &directory, const QString &fileName) const { diff --git a/src/plugins/subversion/subversionplugin.h b/src/plugins/subversion/subversionplugin.h index f0664cc5c6..82940f1ae6 100644 --- a/src/plugins/subversion/subversionplugin.h +++ b/src/plugins/subversion/subversionplugin.h @@ -96,6 +96,7 @@ public: bool vcsDelete(const QString &workingDir, const QString &fileName); bool vcsMove(const QString &workingDir, const QString &from, const QString &to); bool managesDirectory(const QString &directory, QString *topLevel = 0) const; + bool managesFile(const QString &workingDirectory, const QString &fileName) const; bool vcsCheckout(const QString &directory, const QByteArray &url); QString vcsGetRepositoryURL(const QString &directory); @@ -131,7 +132,7 @@ private slots: void revertAll(); void filelogCurrentFile(); void annotateCurrentFile(); - void annotateVersion(const QString &file, const QString &revision, int lineNumber); + void annotateVersion(const QString &workingDirectory, const QString &file, const QString &revision, int lineNumber); void projectStatus(); void describe(const QString &source, const QString &changeNr); void slotDescribe(); @@ -161,12 +162,12 @@ private: // Run using the settings' authentication options. SubversionResponse runSvn(const QString &workingDir, const QStringList &arguments, int timeOut, - unsigned flags, QTextCodec *outputCodec = 0); + unsigned flags, QTextCodec *outputCodec = 0) const; // Run using custom authentication options. SubversionResponse runSvn(const QString &workingDir, const QString &userName, const QString &password, const QStringList &arguments, int timeOut, - unsigned flags, QTextCodec *outputCodec = 0); + unsigned flags, QTextCodec *outputCodec = 0) const; void filelog(const QString &workingDir, const QString &file = QString(), diff --git a/src/plugins/texteditor/basehoverhandler.cpp b/src/plugins/texteditor/basehoverhandler.cpp index 8acdc55811..cecb9c1457 100644 --- a/src/plugins/texteditor/basehoverhandler.cpp +++ b/src/plugins/texteditor/basehoverhandler.cpp @@ -37,9 +37,17 @@ #include <QPoint> -using namespace TextEditor; using namespace Core; +namespace TextEditor { + +static BaseTextEditorWidget *baseTextEditor(ITextEditor *editor) +{ + if (!editor) + return 0; + return qobject_cast<BaseTextEditorWidget *>(editor->widget()); +} + BaseHoverHandler::BaseHoverHandler(QObject *parent) : QObject(parent), m_diagnosticTooltip(false) { // Listen for editor opened events in order to connect to tooltip/helpid requests @@ -94,13 +102,19 @@ void BaseHoverHandler::updateContextHelpId(TextEditor::ITextEditor *editor, int } void BaseHoverHandler::setToolTip(const QString &tooltip) -{ m_toolTip = tooltip; } +{ + m_toolTip = tooltip; +} const QString &BaseHoverHandler::toolTip() const -{ return m_toolTip; } +{ + return m_toolTip; +} void BaseHoverHandler::appendToolTip(const QString &extension) -{ m_toolTip.append(extension); } +{ + m_toolTip.append(extension); +} void BaseHoverHandler::addF1ToToolTip() { @@ -120,10 +134,14 @@ bool BaseHoverHandler::isDiagnosticTooltip() const } void BaseHoverHandler::setLastHelpItemIdentified(const HelpItem &help) -{ m_lastHelpItemIdentified = help; } +{ + m_lastHelpItemIdentified = help; +} const HelpItem &BaseHoverHandler::lastHelpItemIdentified() const -{ return m_lastHelpItemIdentified; } +{ + return m_lastHelpItemIdentified; +} void BaseHoverHandler::clear() { @@ -162,9 +180,4 @@ void BaseHoverHandler::operateTooltip(ITextEditor *editor, const QPoint &point) Utils::ToolTip::show(point, Utils::TextContent(m_toolTip), editor->widget()); } -BaseTextEditorWidget *BaseHoverHandler::baseTextEditor(ITextEditor *editor) -{ - if (!editor) - return 0; - return qobject_cast<BaseTextEditorWidget *>(editor->widget()); -} +} // namespace TextEditor diff --git a/src/plugins/texteditor/basehoverhandler.h b/src/plugins/texteditor/basehoverhandler.h index 59e999c8d9..b0c77f4f27 100644 --- a/src/plugins/texteditor/basehoverhandler.h +++ b/src/plugins/texteditor/basehoverhandler.h @@ -52,9 +52,10 @@ class BaseTextEditorWidget; class TEXTEDITOR_EXPORT BaseHoverHandler : public QObject { Q_OBJECT + public: BaseHoverHandler(QObject *parent = 0); - virtual ~BaseHoverHandler(); + ~BaseHoverHandler(); private slots: void editorOpened(Core::IEditor *editor); @@ -74,8 +75,6 @@ protected: void setLastHelpItemIdentified(const HelpItem &help); const HelpItem &lastHelpItemIdentified() const; - static BaseTextEditorWidget *baseTextEditor(ITextEditor *editor); - private: void clear(); void process(ITextEditor *editor, int pos); diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 06d6e6401e..beb49cb46d 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -6520,11 +6520,11 @@ int BaseTextEditorWidget::rowCount() const } /** - Helper method to transform a selected text. If nothing is selected at the moment + Helper function to transform a selected text. If nothing is selected at the moment the word under the cursor is used. - The type of the transformation is determined by the method pointer given. + The type of the transformation is determined by the function pointer given. - @param method pointer to the QString method to use for the transformation + @param method pointer to the QString function to use for the transformation @see uppercaseSelection, lowercaseSelection */ diff --git a/src/plugins/texteditor/basetextmark.cpp b/src/plugins/texteditor/basetextmark.cpp index dbef43c04c..dd5832a7bb 100644 --- a/src/plugins/texteditor/basetextmark.cpp +++ b/src/plugins/texteditor/basetextmark.cpp @@ -136,7 +136,7 @@ BaseTextMark::BaseTextMark(const QString &fileName, int lineNumber) { } -// we need two phase initilization, since we are calling virtual methods +// we need two phase initilization, since we are calling virtual functions // of BaseTextMark in add() and also accessing widthFactor // which might be set in the derived constructor void BaseTextMark::init() diff --git a/src/plugins/texteditor/codeassist/iassistinterface.cpp b/src/plugins/texteditor/codeassist/iassistinterface.cpp index 51fe2a615a..2f3ec8d923 100644 --- a/src/plugins/texteditor/codeassist/iassistinterface.cpp +++ b/src/plugins/texteditor/codeassist/iassistinterface.cpp @@ -90,7 +90,7 @@ IAssistInterface::~IAssistInterface() Detaches the interface. If it is necessary to take any special care in order to allow this interface to be run in a separate thread \a destination this needs to be done - in this method. + in this function. */ /*! diff --git a/src/plugins/texteditor/generichighlighter/highlighter.cpp b/src/plugins/texteditor/generichighlighter/highlighter.cpp index 06106e9703..787b1fc1b8 100644 --- a/src/plugins/texteditor/generichighlighter/highlighter.cpp +++ b/src/plugins/texteditor/generichighlighter/highlighter.cpp @@ -416,7 +416,7 @@ void Highlighter::applyFormat(int offset, QTextCharFormat format = formatForCategory(formatId); if (itemData->isCustomized()) { // Please notice that the following are applied every time for item data which have - // customizations. The configureFormats method could be used to provide a "one time" + // customizations. The configureFormats function could be used to provide a "one time" // configuration, but it would probably require to traverse all item data from all // definitions available/loaded (either to set the values or for some "notifying" // strategy). This is because the highlighter does not really know on which diff --git a/src/plugins/texteditor/highlighterutils.h b/src/plugins/texteditor/highlighterutils.h index dd6bc5343d..8e9fba0f44 100644 --- a/src/plugins/texteditor/highlighterutils.h +++ b/src/plugins/texteditor/highlighterutils.h @@ -33,9 +33,9 @@ #include <QString> #include "texteditor_global.h" -/* These methods were originally a part of TextEditor::Highlighter, +/* These functions were originally a part of TextEditor::Highlighter, * but due to a very hackish test of that generic highlighter, - * there methods must be outside. */ + * there functions must be outside. */ namespace Core { class MimeType; diff --git a/src/plugins/texteditor/quickfix.h b/src/plugins/texteditor/quickfix.h index d4317aab6c..349c003f2e 100644 --- a/src/plugins/texteditor/quickfix.h +++ b/src/plugins/texteditor/quickfix.h @@ -81,7 +81,7 @@ public: /*! Perform this quick-fix's operation. - Subclasses should implement this method to do the actual changes. + Subclasses should implement this function to do the actual changes. */ virtual void perform() = 0; diff --git a/src/plugins/texteditor/syntaxhighlighter.cpp b/src/plugins/texteditor/syntaxhighlighter.cpp index 1cf9359c37..8066f8d7f7 100644 --- a/src/plugins/texteditor/syntaxhighlighter.cpp +++ b/src/plugins/texteditor/syntaxhighlighter.cpp @@ -693,7 +693,7 @@ static bool byStartOfRange(const QTextLayout::FormatRange &range, const QTextLay } // The formats is passed in by reference in order to prevent unnecessary copying of its items. -// After this method returns, the list is modified, and should be considered invalidated! +// After this function returns, the list is modified, and should be considered invalidated! void SyntaxHighlighter::setExtraAdditionalFormats(const QTextBlock& block, QList<QTextLayout::FormatRange> &formats) { diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp index e795b3ab3b..3a98d51e60 100644 --- a/src/plugins/texteditor/texteditorsettings.cpp +++ b/src/plugins/texteditor/texteditorsettings.cpp @@ -150,8 +150,8 @@ TextEditorSettings::TextEditorSettings(QObject *parent) formatDescr.append(FormatDescription(C_FUNCTION, tr("Function"), tr("Name of a function."), functionFormat)); functionFormat.setItalic(true); - formatDescr.append(FormatDescription(C_VIRTUAL_METHOD, tr("Virtual Method"), - tr("Name of method declared as virtual."), + formatDescr.append(FormatDescription(C_VIRTUAL_METHOD, tr("Virtual Function"), + tr("Name of function declared as virtual."), functionFormat)); formatDescr.append(FormatDescription(C_BINDING, tr("QML Binding"), diff --git a/src/plugins/valgrind/callgrind/callgrindparser.h b/src/plugins/valgrind/callgrind/callgrindparser.h index acf4524312..275eaa2481 100644 --- a/src/plugins/valgrind/callgrind/callgrindparser.h +++ b/src/plugins/valgrind/callgrind/callgrindparser.h @@ -58,7 +58,7 @@ public: explicit Parser(QObject *parent = 0); ~Parser(); - // get and take ownership of the parsing results. If this method is not called the repository + // get and take ownership of the parsing results. If this function is not called the repository // will be destroyed when the parser is destroyed. Subsequent calls return null. ParseData *takeData(); diff --git a/src/plugins/valgrind/callgrind/callgrindrunner.cpp b/src/plugins/valgrind/callgrind/callgrindrunner.cpp index e0e37e0810..b5e4822868 100644 --- a/src/plugins/valgrind/callgrind/callgrindrunner.cpp +++ b/src/plugins/valgrind/callgrind/callgrindrunner.cpp @@ -79,7 +79,7 @@ void CallgrindRunner::processFinished(int ret, QProcess::ExitStatus status) triggerParse(); m_controller->setValgrindProcess(0); - ValgrindRunner::processFinished(ret, status); // call base class method + ValgrindRunner::processFinished(ret, status); // call base class function } bool CallgrindRunner::isPaused() const diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index 9621f9cb87..d39eb81974 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -668,7 +668,7 @@ QWidget *CallgrindToolPrivate::createWidgets() // load external XML log file action = new QAction(this); action->setIcon(QIcon(QLatin1String(Core::Constants::ICON_OPENFILE))); - action->setToolTip(tr("Load External XML Log File.")); + action->setToolTip(tr("Load External XML Log File")); connect(action, SIGNAL(triggered(bool)), this, SLOT(loadExternalXmlLogFile())); layout->addWidget(createToolButton(action)); m_loadExternalLogFile = action; diff --git a/src/plugins/valgrind/memcheck/memcheckrunner.cpp b/src/plugins/valgrind/memcheck/memcheckrunner.cpp index cb3608f01c..6827f6b47d 100644 --- a/src/plugins/valgrind/memcheck/memcheckrunner.cpp +++ b/src/plugins/valgrind/memcheck/memcheckrunner.cpp @@ -130,7 +130,7 @@ bool MemcheckRunner::start() QVBoxLayout *layout = new QVBoxLayout; QLabel *description = new QLabel; description->setWordWrap(true); - description->setText(tr("More than one network interface was found on your machine. Please select which one you want to use for remote analysis.")); + description->setText(tr("More than one network interface was found on your machine. Please select the one you want to use for remote analysis.")); layout->addWidget(description); QListWidget *list = new QListWidget; foreach (const QHostAddress &address, possibleHostAddresses) @@ -151,7 +151,7 @@ bool MemcheckRunner::start() dlg.setLayout(layout); if (dlg.exec() != QDialog::Accepted) { - emit processErrorReceived(tr("No Network Interface was chosen for remote analysis"), QProcess::FailedToStart); + emit processErrorReceived(tr("No network interface was chosen for remote analysis."), QProcess::FailedToStart); return false; } diff --git a/src/plugins/valgrind/memcheckerrorview.cpp b/src/plugins/valgrind/memcheckerrorview.cpp index 83b9a7b421..fdd8791bda 100644 --- a/src/plugins/valgrind/memcheckerrorview.cpp +++ b/src/plugins/valgrind/memcheckerrorview.cpp @@ -93,7 +93,7 @@ private slots: void openLinkInEditor(const QString &link); private: - // the constness of this method is a necessary lie because it is called from paint() const. + // the constness of this function is a necessary lie because it is called from paint() const. QWidget *createDetailsWidget(const QModelIndex &errorIndex, QWidget *parent) const; static const int s_itemMargin = 2; @@ -430,7 +430,7 @@ void MemcheckErrorDelegate::copy() void MemcheckErrorDelegate::openLinkInEditor(const QString &link) { - const int pathStart = strlen("file://"); + const int pathStart = int(sizeof("file://")) - 1; const int pathEnd = link.lastIndexOf(QLatin1Char(':')); const QString path = link.mid(pathStart, pathEnd - pathStart); const int line = link.mid(pathEnd + 1).toInt(0); diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 8641aa53d0..2ed52c0745 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -380,7 +380,7 @@ QWidget *MemcheckTool::createWidgets() // Load external XML log file action = new QAction(this); action->setIcon(QIcon(QLatin1String(Core::Constants::ICON_OPENFILE))); - action->setToolTip(tr("Load External XML Log File.")); + action->setToolTip(tr("Load External XML Log File")); connect(action, SIGNAL(triggered(bool)), this, SLOT(loadExternalXmlLogFile())); button = new QToolButton; button->setDefaultAction(action); @@ -532,7 +532,7 @@ void MemcheckTool::parserError(const Valgrind::XmlProtocol::Error &error) void MemcheckTool::internalParserError(const QString &errorString) { QMessageBox::critical(m_errorView, tr("Internal Error"), - tr("Error occurred parsing valgrind output: %1").arg(errorString)); + tr("Error occurred parsing Valgrind output: %1").arg(errorString)); } void MemcheckTool::clearErrorView() diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp index b36d5230c0..337fee3a09 100644 --- a/src/plugins/valgrind/valgrindengine.cpp +++ b/src/plugins/valgrind/valgrindengine.cpp @@ -97,7 +97,7 @@ bool ValgrindRunControl::startEngine() #if VALGRIND_DEBUG_OUTPUT emit outputReceived(tr("Valgrind options: %1").arg(toolArguments().join(QLatin1Char(' '))), DebugFormat); emit outputReceived(tr("Working directory: %1").arg(sp.workingDirectory), DebugFormat); - emit outputReceived(tr("Commandline arguments: %1").arg(sp.debuggeeArgs), DebugFormat); + emit outputReceived(tr("Command line arguments: %1").arg(sp.debuggeeArgs), DebugFormat); #endif ValgrindRunner *run = runner(); @@ -173,7 +173,7 @@ void ValgrindRunControl::handleProgressFinished() void ValgrindRunControl::runnerFinished() { - appendMessage(tr("** Analyzing finished **\n"), NormalMessageFormat); + appendMessage(tr("Analyzing finished.\n"), NormalMessageFormat); emit finished(); m_progress->reportFinished(); @@ -200,11 +200,11 @@ void ValgrindRunControl::receiveProcessError(const QString &message, QProcess::P if (error == QProcess::FailedToStart) { const QString valgrind = m_settings->valgrindExecutable(); if (!valgrind.isEmpty()) - appendMessage(tr("** Error: \"%1\" could not be started: %2 **\n").arg(valgrind).arg(message), ErrorMessageFormat); + appendMessage(tr("Error: \"%1\" could not be started: %2\n").arg(valgrind).arg(message), ErrorMessageFormat); else - appendMessage(tr("** Error: no valgrind executable set **\n"), ErrorMessageFormat); + appendMessage(tr("Error: no Valgrind executable set.\n"), ErrorMessageFormat); } else if (m_isStopping && error == QProcess::Crashed) { // process gets killed on stop - appendMessage(tr("** Process Terminated **\n"), ErrorMessageFormat); + appendMessage(tr("Process terminated.\n"), ErrorMessageFormat); } else { appendMessage(QString::fromLatin1("** %1 **\n").arg(message), ErrorMessageFormat); } diff --git a/src/plugins/valgrind/valgrindplugin.cpp b/src/plugins/valgrind/valgrindplugin.cpp index aaa566d3c9..f7392831e3 100644 --- a/src/plugins/valgrind/valgrindplugin.cpp +++ b/src/plugins/valgrind/valgrindplugin.cpp @@ -111,7 +111,7 @@ bool ValgrindPlugin::initialize(const QStringList &, QString *) "\"callgrind\" tool to record function calls when a program runs."); QString memcheckToolTip = tr("Valgrind Analyze Memory uses the " - "\"memcheck\" tool to find memory leaks"); + "\"memcheck\" tool to find memory leaks."); if (!Utils::HostOsInfo::isWindowsHost()) { action = new ValgrindAction; @@ -173,7 +173,7 @@ void ValgrindPlugin::extensionsInitialized() Context analyzerContext = Context(Analyzer::Constants::C_ANALYZEMODE); editorContextMenu->addSeparator(analyzerContext); - QAction *action = new QAction(tr("Profile Costs of this Function and its Callees"), this); + QAction *action = new QAction(tr("Profile Costs of This Function and Its Callees"), this); action->setIcon(QIcon(QLatin1String(Analyzer::Constants::ANALYZER_CONTROL_START_ICON))); connect(action, SIGNAL(triggered()), m_callgrindTool, SLOT(handleShowCostsOfFunction())); Command *cmd = ActionManager::registerAction(action, "Analyzer.Callgrind.ShowCostsOfFunction", diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp index feb4c5588b..442313d87e 100644 --- a/src/plugins/vcsbase/vcsbaseclient.cpp +++ b/src/plugins/vcsbase/vcsbaseclient.cpp @@ -90,7 +90,8 @@ public: VcsBaseClientPrivate(VcsBaseClient *client, VcsBaseClientSettings *settings); void statusParser(const QString &text); - void annotateRevision(QString source, QString change, int lineNumber); + void annotateRevision(const QString &workingDirectory, const QString &file, + QString change, int lineNumber); void saveSettings(); void bindCommandToEditor(Command *cmd, VcsBaseEditorWidget *editor); @@ -125,15 +126,15 @@ void VcsBaseClientPrivate::statusParser(const QString &text) emit m_client->parsedStatus(lineInfoList); } -void VcsBaseClientPrivate::annotateRevision(QString source, QString change, int lineNumber) +void VcsBaseClientPrivate::annotateRevision(const QString &workingDirectory, const QString &file, + QString change, int lineNumber) { // This might be invoked with a verbose revision description // "SHA1 author subject" from the annotation context menu. Strip the rest. const int blankPos = change.indexOf(QLatin1Char(' ')); if (blankPos != -1) change.truncate(blankPos); - const QFileInfo fi(source); - m_client->annotate(fi.absolutePath(), fi.fileName(), change, lineNumber); + m_client->annotate(workingDirectory, file, change, lineNumber); } void VcsBaseClientPrivate::saveSettings() @@ -275,7 +276,7 @@ bool VcsBaseClient::synchronousPush(const QString &workingDir, bool VcsBaseClient::vcsFullySynchronousExec(const QString &workingDir, const QStringList &args, - QByteArray *output) + QByteArray *output) const { QProcess vcsProcess; if (!workingDir.isEmpty()) @@ -354,7 +355,7 @@ void VcsBaseClient::diff(const QString &workingDir, const QStringList &files, const QString source = VcsBase::VcsBaseEditorWidget::getSource(workingDir, files); VcsBase::VcsBaseEditorWidget *editor = createVcsEditor(kind, title, source, true, vcsCmdString.toLatin1().constData(), id); - editor->setDiffBaseDirectory(workingDir); + editor->setWorkingDirectory(workingDir); VcsBaseEditorParameterWidget *paramWidget = createDiffEditor(workingDir, files, extraOptions); if (paramWidget != 0) { @@ -574,8 +575,8 @@ VcsBase::VcsBaseEditorWidget *VcsBaseClient::createVcsEditor(Core::Id kind, QStr outputEditor = Core::EditorManager::openEditorWithContents(kind, &title, progressMsg.toUtf8()); outputEditor->document()->setProperty(registerDynamicProperty, dynamicPropertyValue); baseEditor = VcsBase::VcsBaseEditorWidget::getVcsBaseEditor(outputEditor); - connect(baseEditor, SIGNAL(annotateRevisionRequested(QString,QString,int)), - this, SLOT(annotateRevision(QString,QString,int))); + connect(baseEditor, SIGNAL(annotateRevisionRequested(QString,QString,QString,int)), + this, SLOT(annotateRevision(QString,QString,QString,int))); QTC_ASSERT(baseEditor, return 0); baseEditor->setSource(source); if (setSourceCodec) diff --git a/src/plugins/vcsbase/vcsbaseclient.h b/src/plugins/vcsbase/vcsbaseclient.h index f4c9bf957f..9734e4829c 100644 --- a/src/plugins/vcsbase/vcsbaseclient.h +++ b/src/plugins/vcsbase/vcsbaseclient.h @@ -166,7 +166,7 @@ protected: // Fully synchronous VCS execution (QProcess-based) bool vcsFullySynchronousExec(const QString &workingDir, const QStringList &args, - QByteArray *output); + QByteArray *output) const; // Synchronous VCS execution using Utils::SynchronousProcess, with // log windows updating (using VcsBasePlugin::runVcs with flags) Utils::SynchronousProcessResponse vcsSynchronousExec(const QString &workingDir, @@ -194,7 +194,7 @@ private: VcsBaseClientPrivate *d; Q_PRIVATE_SLOT(d, void statusParser(QString)) - Q_PRIVATE_SLOT(d, void annotateRevision(QString, QString, int)) + Q_PRIVATE_SLOT(d, void annotateRevision(QString, QString, QString, int)) Q_PRIVATE_SLOT(d, void saveSettings()) Q_PRIVATE_SLOT(d, void commandFinishedGotoLine(QWidget *)) }; diff --git a/src/plugins/vcsbase/vcsbaseclientsettings.cpp b/src/plugins/vcsbase/vcsbaseclientsettings.cpp index a5eaae69f5..783f082e48 100644 --- a/src/plugins/vcsbase/vcsbaseclientsettings.cpp +++ b/src/plugins/vcsbase/vcsbaseclientsettings.cpp @@ -31,6 +31,7 @@ #include <utils/environment.h> #include <utils/hostosinfo.h> +#include <utils/qtcassert.h> #include <QSettings> #include <QVariant> @@ -228,6 +229,9 @@ VcsBaseClientSettings::~VcsBaseClientSettings() void VcsBaseClientSettings::writeSettings(QSettings *settings) const { + QTC_ASSERT(!settingsGroup().isEmpty(), return); + + settings->remove(settingsGroup()); settings->beginGroup(settingsGroup()); foreach (const QString &key, keys()) settings->setValue(key, value(key)); diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index 0c415cf8eb..fe72592fb1 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -158,7 +158,8 @@ public: signals: void describeRequested(const QString &source, const QString &change); - void annotateRevisionRequested(const QString &source, const QString &change, int line); + void annotateRevisionRequested(const QString &workingDirectory, const QString &file, + const QString &change, int line); private: Core::Id m_id; @@ -562,7 +563,7 @@ public: const VcsBaseEditorParameters *m_parameters; QString m_source; - QString m_diffBaseDirectory; + QString m_workingDirectory; QRegExp m_diffFilePattern; QRegExp m_logEntryPattern; @@ -683,6 +684,12 @@ bool VcsBaseEditorWidget::supportChangeLinks() const } } +QString VcsBaseEditorWidget::fileNameForLine(int line) const +{ + Q_UNUSED(line); + return source(); +} + void VcsBaseEditorWidget::init() { d->m_editor = editor(); @@ -778,14 +785,14 @@ void VcsBaseEditorWidget::setFileLogAnnotateEnabled(bool e) d->m_fileLogAnnotateEnabled = e; } -QString VcsBaseEditorWidget::diffBaseDirectory() const +QString VcsBaseEditorWidget::workingDirectory() const { - return d->m_diffBaseDirectory; + return d->m_workingDirectory; } -void VcsBaseEditorWidget::setDiffBaseDirectory(const QString &bd) +void VcsBaseEditorWidget::setWorkingDirectory(const QString &wd) { - d->m_diffBaseDirectory = bd; + d->m_workingDirectory = wd; } QTextCodec *VcsBaseEditorWidget::codec() const @@ -818,8 +825,8 @@ TextEditor::BaseTextEditor *VcsBaseEditorWidget::createEditor() // Pass on signals. connect(this, SIGNAL(describeRequested(QString,QString)), editor, SIGNAL(describeRequested(QString,QString))); - connect(this, SIGNAL(annotateRevisionRequested(QString,QString,int)), - editor, SIGNAL(annotateRevisionRequested(QString,QString,int))); + connect(this, SIGNAL(annotateRevisionRequested(QString,QString,QString,int)), + editor, SIGNAL(annotateRevisionRequested(QString,QString,QString,int))); return editor; } @@ -1369,8 +1376,8 @@ QString VcsBaseEditorWidget::findDiffFile(const QString &f) const // 1) Try base dir const QChar slash = QLatin1Char('/'); - if (!d->m_diffBaseDirectory.isEmpty()) { - const QFileInfo baseFileInfo(d->m_diffBaseDirectory + slash + f); + if (!d->m_workingDirectory.isEmpty()) { + const QFileInfo baseFileInfo(d->m_workingDirectory + slash + f); if (baseFileInfo.isFile()) return baseFileInfo.absoluteFilePath(); } @@ -1412,9 +1419,16 @@ void VcsBaseEditorWidget::addDiffActions(QMenu *, const DiffChunk &) void VcsBaseEditorWidget::slotAnnotateRevision() { - if (const QAction *a = qobject_cast<const QAction *>(sender())) - emit annotateRevisionRequested(source(), a->data().toString(), - editor()->currentLine()); + if (const QAction *a = qobject_cast<const QAction *>(sender())) { + const int currentLine = editor()->currentLine(); + const QString fileName = fileNameForLine(currentLine); + QString workingDirectory = d->m_workingDirectory; + if (workingDirectory.isEmpty()) + workingDirectory = QFileInfo(fileName).absolutePath(); + emit annotateRevisionRequested(workingDirectory, + QDir(workingDirectory).relativeFilePath(fileName), + a->data().toString(), currentLine); + } } QStringList VcsBaseEditorWidget::annotationPreviousVersions(const QString &) const @@ -1448,8 +1462,8 @@ bool VcsBaseEditorWidget::canApplyDiffChunk(const DiffChunk &dc) const // (passing '-R' for revert), assuming we got absolute paths from the VCS plugins. bool VcsBaseEditorWidget::applyDiffChunk(const DiffChunk &dc, bool revert) const { - return VcsBasePlugin::runPatch(dc.asPatch(d->m_diffBaseDirectory), - d->m_diffBaseDirectory, 0, revert); + return VcsBasePlugin::runPatch(dc.asPatch(d->m_workingDirectory), + d->m_workingDirectory, 0, revert); } QString VcsBaseEditorWidget::fileNameFromDiffSpecification(const QTextBlock &inBlock, QString *header) const diff --git a/src/plugins/vcsbase/vcsbaseeditor.h b/src/plugins/vcsbase/vcsbaseeditor.h index ae2587c88a..7c0654dae6 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.h +++ b/src/plugins/vcsbase/vcsbaseeditor.h @@ -90,7 +90,7 @@ public: class VCSBASE_EXPORT VcsBaseEditorWidget : public TextEditor::BaseTextEditorWidget { Q_PROPERTY(QString source READ source WRITE setSource) - Q_PROPERTY(QString diffBaseDirectory READ diffBaseDirectory WRITE setDiffBaseDirectory) + Q_PROPERTY(QString workingDirectory READ workingDirectory WRITE setWorkingDirectory) Q_PROPERTY(QTextCodec *codec READ codec WRITE setCodec) Q_PROPERTY(QString annotateRevisionTextFormat READ annotateRevisionTextFormat WRITE setAnnotateRevisionTextFormat) Q_PROPERTY(QString copyRevisionTextFormat READ copyRevisionTextFormat WRITE setCopyRevisionTextFormat) @@ -107,6 +107,7 @@ protected: // Pattern for log entry. hash/revision number must be in the first capture group void setLogEntryPattern(const QRegExp &pattern); virtual bool supportChangeLinks() const; + virtual QString fileNameForLine(int line) const; public: virtual void init(); @@ -144,8 +145,8 @@ public: void setCodec(QTextCodec *); // Base directory for diff views - QString diffBaseDirectory() const; - void setDiffBaseDirectory(const QString &d); + QString workingDirectory() const; + void setWorkingDirectory(const QString &wd); bool isModified() const; @@ -202,7 +203,8 @@ signals: // handled by the editor manager for convenience. They are emitted // for LogOutput/AnnotateOutput content types. void describeRequested(const QString &source, const QString &change); - void annotateRevisionRequested(const QString &source, const QString &change, int lineNumber); + void annotateRevisionRequested(const QString &workingDirectory, const QString &file, + const QString &change, int lineNumber); void diffChunkApplied(const VcsBase::DiffChunk &dc); void diffChunkReverted(const VcsBase::DiffChunk &dc); diff --git a/src/plugins/vcsbase/vcsbaseplugin.h b/src/plugins/vcsbase/vcsbaseplugin.h index 5799f8bf99..ce379754f6 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.h +++ b/src/plugins/vcsbase/vcsbaseplugin.h @@ -200,7 +200,7 @@ protected: // Sets the current submit editor for this specific version control plugin. // The plugin automatically checks if the submit editor is closed and calls // submitEditorAboutToClose(). - // The method raiseSubmitEditor can be used to check for a running submit editor and raise it. + // The function raiseSubmitEditor can be used to check for a running submit editor and raise it. void setSubmitEditor(VcsBaseSubmitEditor *submitEditor); // Current submit editor set through setSubmitEditor, if it wasn't closed inbetween VcsBaseSubmitEditor *submitEditor() const; diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index 6b0b3bce48..202645a5d4 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -353,7 +353,7 @@ bool WelcomePlugin::initialize(const QStringList & /* arguments */, QString * /* /*! Notification that all extensions that this plugin depends on have been initialized. The dependencies are defined in the plugins .qwp file. - Normally this method is used for things that rely on other plugins to have + Normally this function is used for things that rely on other plugins to have added objects to the plugin manager, that implement interfaces that we're interested in. These objects can now be requested through the PluginManagerInterface. diff --git a/src/tools/3rdparty/iossim/iossim.pro b/src/tools/3rdparty/iossim/iossim.pro index 2e06970c59..63d21886b5 100644 --- a/src/tools/3rdparty/iossim/iossim.pro +++ b/src/tools/3rdparty/iossim/iossim.pro @@ -40,9 +40,9 @@ include(../../../rpath.pri) OBJECTIVE_SOURCES += \ main.mm \ - nsprintf.m \ - nsstringexpandPath.m \ - iphonesimulator.m + nsprintf.mm \ + nsstringexpandPath.mm \ + iphonesimulator.mm HEADERS += \ iphonesimulator.h \ diff --git a/src/tools/3rdparty/iossim/iossim.qbs b/src/tools/3rdparty/iossim/iossim.qbs index eab1a9969d..d79667bb2a 100644 --- a/src/tools/3rdparty/iossim/iossim.qbs +++ b/src/tools/3rdparty/iossim/iossim.qbs @@ -11,9 +11,9 @@ QtcTool { files: [ "main.mm", - "nsprintf.m", - "nsstringexpandpath.m", - "iphonesimulator.m", + "nsprintf.mm", + "nsstringexpandpath.mm", + "iphonesimulator.mm", "iphonesimulator.h", "nsprintf.h", "nsstringexpandpath.h", diff --git a/src/tools/3rdparty/iossim/iphonesimulator.m b/src/tools/3rdparty/iossim/iphonesimulator.mm index e3aca2b3de..c746775314 100644 --- a/src/tools/3rdparty/iossim/iphonesimulator.m +++ b/src/tools/3rdparty/iossim/iphonesimulator.mm @@ -131,11 +131,11 @@ NSString *deviceIpadRetina = @"iPad (Retina)"; if (shouldStartDebugger) { char*args[4] = { NULL, NULL, (char*)[[[mySession simulatedApplicationPID] description] UTF8String], NULL }; if (useGDB) { - args[0] = "gdb"; - args[1] = "program"; + args[0] = strdup("gdb"); + args[1] = strdup("program"); } else { - args[0] = "lldb"; - args[1] = "--attach-pid"; + args[0] = strdup("lldb"); + args[1] = strdup("--attach-pid"); } // The parent process must live on to process the stdout/stderr fifos, // so start the debugger as a child process. diff --git a/src/tools/3rdparty/iossim/nsprintf.m b/src/tools/3rdparty/iossim/nsprintf.mm index b7413f593c..b7413f593c 100644 --- a/src/tools/3rdparty/iossim/nsprintf.m +++ b/src/tools/3rdparty/iossim/nsprintf.mm diff --git a/src/tools/3rdparty/iossim/nsstringexpandpath.m b/src/tools/3rdparty/iossim/nsstringexpandpath.mm index 53f43e3c12..53f43e3c12 100644 --- a/src/tools/3rdparty/iossim/nsstringexpandpath.m +++ b/src/tools/3rdparty/iossim/nsstringexpandpath.mm diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 648bd9b7f5..01f2cbbca4 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -4786,6 +4786,24 @@ void tst_Dumpers::dumper_data() % Check("v.x", "1", "int") % Check("n.x", "10", "int") % Check("n.y", "20", "int"); + + + QTest::newRow("stdint") + << Data("#include <stdint.h>\n", + "uint8_t u8 = 64;\n" + "int8_t s8 = 65;\n" + "uint16_t u16 = 66;\n" + "int16_t s16 = 67;\n" + "uint32_t u32 = 68;\n" + "int32_t s32 = 69;\n" + "unused(&u8, &s8, &u16, &s16, &u32, &s32);\n") + % Check("u8", "64", "uint8_t") + % Check("s8", "65", "int8_t") + % Check("u16", "66", "uint16_t") + % Check("s16", "67", "int16_t") + % Check("u32", "68", "uint32_t") + % Check("s32", "69", "int32_t"); + } int main(int argc, char *argv[]) diff --git a/tests/manual/cplusplus-tools/main.cpp b/tests/manual/cplusplus-tools/main.cpp index 8d0dec110d..b55a542181 100644 --- a/tests/manual/cplusplus-tools/main.cpp +++ b/tests/manual/cplusplus-tools/main.cpp @@ -185,7 +185,7 @@ void testTypeHierarchy() /* Switch declaration/definition - - Use methods from Dummy. + - Use functions from Dummy. */ /* diff --git a/tests/manual/debugger/simple/simple_test_app.cpp b/tests/manual/debugger/simple/simple_test_app.cpp index c8efcbee88..76960dfa24 100644 --- a/tests/manual/debugger/simple/simple_test_app.cpp +++ b/tests/manual/debugger/simple/simple_test_app.cpp @@ -192,6 +192,7 @@ void dummyStatement(...) {} #include <vector> #include <stdarg.h> +#include <stdint.h> #include "../simple/deep/deep/simple_test_app.h" @@ -4709,6 +4710,16 @@ namespace basic { dummyStatement(&u64, &s64, &u32, &s32, &u64s, &s64s, &u32s, &s32s); } + void testStdInt() + { + uint8_t u8 = 64; + int8_t s8 = 65; + BREAK_HERE; + // Check u8 64 uint8_t + // Check u8 65 int8_t + + dummyStatement(&u8, &s8); + } void testArray1() { @@ -5477,6 +5488,7 @@ namespace basic { { testInheritance(); testInt(); + testStdInt(); testReference1(); testReference2(); testReference3("hello"); diff --git a/tests/system/suite_tools/tst_designer_autocomplete/test.py b/tests/system/suite_tools/tst_designer_autocomplete/test.py index e8c7ce5c1c..8e03f0e646 100644 --- a/tests/system/suite_tools/tst_designer_autocomplete/test.py +++ b/tests/system/suite_tools/tst_designer_autocomplete/test.py @@ -63,6 +63,7 @@ def main(): type(editor, "-") snooze(1) type(editor, ">") + snooze(1) nativeType("%s" % buttonName[0]) test.verify(waitFor("object.exists(':popupFrame_TextEditor::GenericProposalWidget')", 1500), "Verify that GenericProposalWidget is being shown.") diff --git a/tests/tools/qml-ast2dot/main.cpp b/tests/tools/qml-ast2dot/main.cpp index 3213ba0e76..f268e90246 100644 --- a/tests/tools/qml-ast2dot/main.cpp +++ b/tests/tools/qml-ast2dot/main.cpp @@ -147,7 +147,7 @@ protected: _stack.removeLast(); } -protected: // visiting methods: +protected: // visiting functions: virtual bool visit(UiImport *ast) { terminal(ast->importToken); |