diff --git a/dist/changes-2.5.0 b/dist/changes-2.5.0 index 3ead4dc4b28b9c58872eafd153aa082ba57aa068..4296f6ffc0ed612b193a20e2b8a223b8f7f17dae 100644 --- a/dist/changes-2.5.0 +++ b/dist/changes-2.5.0 @@ -10,6 +10,8 @@ git log --cherry-pick --pretty=oneline v2.4.0...origin/2.5 General * Add a keyboard shortcut (Alt) to the locator to display the full path to a located file (QTCREATORBUG-3805) + * Add "Search Again" to recent searches (QTCREATORBUG-621) + * Allow multiple parallel searches (QTCREATORBUG-6101) Editing * Use the QML/JS editor for opening json files (QTCREATORBUG-4639) @@ -28,10 +30,36 @@ Editing * Fix layout update when folding/unfolding regions (QTCREATORBUG-6666) * Fix position of code-assist popup when cursor is outside viewport (QTCREATORBUG-6843) + * Add experimental plugin for showing "TODO"s in files + [by Dmitry Savchenko] + * Add "Open with" context menu in resource editor (QTCREATORBUG-4224) + * Add task indicators in the left margin of a line Managing Projects + * Add facility to change multiple environment variables in the + build and run settings at the same time Debugging + * Improve display of vtables and dynamic types (QTCREATORBUG-6933 et al) + * Adjust QDir and QFileInfo gdb pretty printer after Qt 4.8 changes + and various others for Qt 5.0 + * Adjust std::map dumper for gcc 4.6 + * Adjust to new *stopped output notifications of gdb 7.4 + * Add pretty printers for std::shared_ptr, std::unique_ptr, std::array, + std::complex, boost::posix_time::{ptime,time_duration}, + boost::gregorian::date + * Improve remote debugging facilities including new convenience + dialogs like "Attach to Running Remote Process" + * Improve per-type and per-variable selection of display formats + * Add display variants for map-like types (std::map, QMap, QHash etc) + * Make "gdb startup script" directly editable + * Improve expansion behaviour of pinned tooltips (QTCREATORBUG-6554) + * Prevent automatic loading of incompatible dumpers + * Make Shift-F5 exit when debugging a core file (QTCREATORBUG-6111) + * Make popping up the output pane optional (QTCREATORBUG-6764) + * Make entering commands in the log view more convenient + * Re-enable debugging of Python scripts + * Add pretty-printing for D arrays and strings Debugging QML/JS * Relocate breakpoints to next executable code @@ -39,6 +67,8 @@ Debugging QML/JS * Spruce up the script console for evaluating QML/JS expressions Analyzing Code + * Fix message for "incompatible" builds (QTCREATORBUG-7011) + * Fix suppression dialog (QTCREATORBUG-6500) C++ Support * Fix completion and the dot-to-arrow conversion not triggering reliably @@ -76,6 +106,11 @@ C++ Support * Add "rearrange parameter list" refactoring action [by Bojan Petrovic] * Add indent/unindent actions shortcut [by Adam Treat] * Improve sorting of completion items (QTCREATORBUG-6404) + * Improve C++11 lambda support, including formatting + * Fix "go to definition" of macros (QTCREATORBUG-2240, QTCREATORBUG-6175, + QTCREATORBUG-6848, QTCREATORBUG-7008, QTCREATORBUG-7009) + * Fix completion by not adding parentheses when completing dereferenced + function QML/JS Support * Add correct scoping for signal handlers; enables completion of signal @@ -102,7 +137,9 @@ Help Platform Specific Mac - * Pass architecture and bit width from the tool chain build setting to Qmake (QTCREATORBUG-6088) + * Fix adding Qt version on Mac OS X Lion (QTCREATORBUG-6222) + * Pass architecture and bit width from the tool chain build setting + to qmake (QTCREATORBUG-6088) Linux (GNOME and KDE) @@ -115,8 +152,17 @@ Remote Linux Support Qt Designer FakeVim + * Implement Ctrl-a, Ctrl-x, &, gm, `., '., :<x>%, ciw. + * Add handling of number key block + * Fix cursor column after up/down in replace mode + * Fix case sensitivity of parsing of codes like "<Esc>" in mappings + * Overhaul register handling + * Add old-style settings of for 'bs' (QTCREATORBUG-6640) + * Fix off-by-one error when creating a single line range (QTCREATORBUG-6630) Version control plugins + * Rename the ScmGit plugin to Git + * Rename the VCSBase plugin to VcsBase Additional credits go to: diff --git a/doc/config/qt-html-templates-online.qdocconf b/doc/config/qt-html-templates-online.qdocconf index 723fcceff340167edc417c0dffec08f17098e498..9fe93e211d91d6261ce9b72d4c08df9929fdfc6e 100644 --- a/doc/config/qt-html-templates-online.qdocconf +++ b/doc/config/qt-html-templates-online.qdocconf @@ -105,21 +105,24 @@ HTML.footer = \ " </div> \n" \ " <div class=\"footer\">\n" \ " <p>\n" \ - " <acronym title=\"Copyright\">©</acronym> 2008-2012 Nokia Corporation and/or its\n" \ - " subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \ - " in Finland and/or other countries worldwide.</p>\n" \ " <p>\n" \ - " All other trademarks are property of their respective owners. <a title=\"Privacy Policy\"\n" \ - " href=\"http://qt.nokia.com/about/privacy-policy\">Privacy Policy</a></p>\n" \ + " <acronym title=\"Copyright\">©</acronym> 2012 Nokia Corporation and/or its\n" \ + " subsidiaries. Documentation contributions included herein are the copyrights of\n" \ + " their respective owners.</p>\n" \ " <br />\n" \ " <p>\n" \ - " Licensees holding valid Qt Commercial licenses may use this document in accordance with the" \ - " Qt Commercial License Agreement provided with the Software or, alternatively, in accordance" \ - " with the terms contained in a written agreement between you and Nokia.</p>\n" \ + " The documentation provided herein is licensed under the terms of the\n" \ + " <a href=\"http://www.gnu.org/licenses/fdl.html\">GNU Free Documentation\n" \ + " License version 1.3</a> as published by the Free Software Foundation.</p>\n" \ " <p>\n" \ - " Alternatively, this document may be used under the terms of the <a href=\"http://www.gnu.org/licenses/fdl.html\">GNU\n" \ - " Free Documentation License version 1.3</a>\n" \ - " as published by the Free Software Foundation.</p>\n" \ + " Documentation sources may be obtained from <a href=\"http://www.qt-project.org\">\n" \ + " www.qt-project.org</a>.</p>\n" \ + " <br />\n" \ + " <p>\n" \ + " Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \ + " in Finland and/or other countries worldwide. All other trademarks are property\n" \ + " of their respective owners. <a title=\"Privacy Policy\"\n" \ + " href=\"http://en.gitorious.org/privacy_policy/\">Privacy Policy</a></p>\n" \ " </div>\n" \ "\n" \ " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n" \ diff --git a/doc/config/qt-html-templates.qdocconf b/doc/config/qt-html-templates.qdocconf index a44e4ea6868fba853e3670111b1aff37dee27771..cb0ff9db59bb69165d0e8848155e63d25baf6aaf 100644 --- a/doc/config/qt-html-templates.qdocconf +++ b/doc/config/qt-html-templates.qdocconf @@ -23,22 +23,24 @@ HTML.footer = \ " </div>\n" \ "</div> \n" \ "<div class=\"footer\">\n" \ - " <p>\n" \ - " <acronym title=\"Copyright\">©</acronym> 2008-2012 Nokia Corporation and/or its\n" \ - " subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \ - " in Finland and/or other countries worldwide.</p>\n" \ - " <p>\n" \ - " All other trademarks are property of their respective owners. <a title=\"Privacy Policy\"\n" \ - " href=\"http://qt.nokia.com/about/privacy-policy\">Privacy Policy</a></p>\n" \ - " <br />\n" \ - " <p>\n" \ - " Licensees holding valid Qt Commercial licenses may use this document in accordance with the" \ - " Qt Commercial License Agreement provided with the Software or, alternatively, in accordance" \ - " with the terms contained in a written agreement between you and Nokia.</p>\n" \ - " <p>\n" \ - " Alternatively, this document may be used under the terms of the <a href=\"http://www.gnu.org/licenses/fdl.html\">GNU\n" \ - " Free Documentation License version 1.3</a>\n" \ - " as published by the Free Software Foundation.</p>\n" \ + " <p>\n" \ + " <acronym title=\"Copyright\">©</acronym> 2012 Nokia Corporation and/or its\n" \ + " subsidiaries. Documentation contributions included herein are the copyrights of\n" \ + " their respective owners.</p>\n" \ + " <br />\n" \ + " <p>\n" \ + " The documentation provided herein is licensed under the terms of the\n" \ + " <a href=\"http://www.gnu.org/licenses/fdl.html\">GNU Free Documentation\n" \ + " License version 1.3</a> as published by the Free Software Foundation.</p>\n" \ + " <p>\n" \ + " Documentation sources may be obtained from <a href=\"http://www.qt-project.org\">\n" \ + " www.qt-project.org</a>.</p>\n" \ + " <br />\n" \ + " <p>\n" \ + " Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \ + " in Finland and/or other countries worldwide. All other trademarks are property\n" \ + " of their respective owners. <a title=\"Privacy Policy\"\n" \ + " href=\"http://en.gitorious.org/privacy_policy/\">Privacy Policy</a></p>\n" \ "</div>\n" \ # Files not referenced in any qdoc file. diff --git a/doc/images/qtcreator-ssh-key-configuration.png b/doc/images/qtcreator-ssh-key-configuration.png index 138fa94b4e43c9b782c7a8742d5014163293ea45..862a2183c7f8e602e1443198395a97f54acd4667 100644 Binary files a/doc/images/qtcreator-ssh-key-configuration.png and b/doc/images/qtcreator-ssh-key-configuration.png differ diff --git a/doc/src/linux-mobile/linuxdev-keys.qdocinc b/doc/src/linux-mobile/linuxdev-keys.qdocinc index d904d91fc783be4dcd673f7f032c4e6582991d67..dbb15bbbeeed6eae1ba2f1fcf556fee61da66ee2 100644 --- a/doc/src/linux-mobile/linuxdev-keys.qdocinc +++ b/doc/src/linux-mobile/linuxdev-keys.qdocinc @@ -10,16 +10,15 @@ \o Select \gui {Tools > Options > Linux Devices > Device Configurations > Generate SSH Key}. - \o Click \gui {Generate SSH Key}. - \image qtcreator-ssh-key-configuration.png "SSH Key Configuration dialog" - \o Click \gui {Save Public Key} to select the location to save the - public key. + \o In the \gui {Private key file} field, select the location to save + the private key. - \o Click \gui {Save Private Key} to specify the location to save the - private key. + The \gui {Public key file} field displays the location to save the + corresponding public key. - \o Click \gui Close to close the dialog. + \o Select \gui {Generate And Save Key Pair} to generate and save the + keys at the specified locations. \endlist diff --git a/scripts/deployqt.py b/scripts/deployqt.py index 2c1fa96d13487ed884e1faa45dbf7b4617e433f9..cf1b008e05fd8166a9d7ef8bba7a1a4d3aca4166 100755 --- a/scripts/deployqt.py +++ b/scripts/deployqt.py @@ -37,10 +37,10 @@ import shutil from glob import glob ignoreErrors = False -is_debug_build = False +debug_build = False def usage(): - print "Usage: %s <creator_install_dir> [qmake_path]" % os.path.basename(sys.argv[0]) + print "Usage: %s <creator_install_dir> [qmake_path]" % os.path.basename(sys.argv[0]) def which(program): def is_exe(fpath): @@ -64,15 +64,15 @@ def which(program): return None -def check_debug(fpath): +def is_debug(fpath): # bootstrap exception if fpath.endswith('QtCore4d.dll'): return True output = subprocess.check_output(['dumpbin', '/imports', fpath]) return output.find('QtCored4.dll') != -1 -def check_debug_build(install_dir): - return check_debug(os.path.join(install_dir, 'bin', 'qtcreator.exe')) +def is_debug_build(install_dir): + return is_debug(os.path.join(install_dir, 'bin', 'qtcreator.exe')) def op_failed(details = None): if details != None: @@ -117,24 +117,23 @@ def fix_rpaths(chrpath_bin, install_dir): filenames = [filename for filename in filenames if check_unix_library_helper(dirpath, filename)] fix_rpaths_helper(chrpath_bin, install_dir, dirpath, filenames) -def ignore_pattern_helper(filename): - ignore_patterns = ['.lib', '.pdb', '.exp', '.ilk', '.dll'] +def windows_debug_files_filter(filename): + ignore_patterns = ['.lib', '.pdb', '.exp', '.ilk'] for ip in ignore_patterns: if filename.endswith(ip): - return False - return True + return True + return False def copy_ignore_patterns_helper(dir, filenames): if not sys.platform.startswith('win'): return filenames - useful = filter(ignore_pattern_helper, filenames) - if is_debug_build: - dlls = filter(lambda filename: filename.endswith('.dll') and check_debug(os.path.join(dir, filename)), filenames) + if debug_build: + wrong_dlls = filter(lambda filename: filename.endswith('.dll') and not is_debug(os.path.join(dir, filename)), filenames) else: - dlls = filter(lambda filename: filename.endswith('.dll') and not check_debug(os.path.join(dir, filename)), filenames) + wrong_dlls = filter(lambda filename: filename.endswith('.dll') and is_debug(os.path.join(dir, filename)), filenames) - filenames = useful + dlls + filenames = wrong_dlls + filter(windows_debug_files_filter, filenames) return filenames def copy_qt_libs(install_dir, qt_libs_dir, qt_plugin_dir, qt_import_dir, plugins, imports): @@ -151,10 +150,10 @@ def copy_qt_libs(install_dir, qt_libs_dir, qt_plugin_dir, qt_import_dir, plugins dest = os.path.join(install_dir, 'lib', 'qtcreator') if sys.platform.startswith('win'): - if is_debug_build: - libraries = filter(lambda library: check_debug(library), libraries) + if debug_build: + libraries = filter(lambda library: is_debug(library), libraries) else: - libraries = filter(lambda library: not check_debug(library), libraries) + libraries = filter(lambda library: not is_debug(library), libraries) for library in libraries: print library, '->', dest @@ -186,7 +185,7 @@ def copy_qt_libs(install_dir, qt_libs_dir, qt_plugin_dir, qt_import_dir, plugins shutil.copytree(os.path.join(qt_import_dir, qtimport), target, ignore=copy_ignore_func, symlinks=True) def copy_translations(install_dir, qt_tr_dir, tr_catalogs): - langs=[] + langs = [] tr_dir = os.path.join(install_dir, 'share', 'qtcreator', 'translations') p = re.compile(r'_(.*).qm') for dirpath, dirnames, filenames in os.walk(tr_dir): @@ -210,11 +209,9 @@ def readQmakeVar(qmake_bin, var): return pipe.read().rstrip('\n') def main(): - generateMode = False try: opts, args = getopt.gnu_getopt(sys.argv[1:], 'hi', ['help', 'ignore-errors']) except: - print str(err) usage() sys.exit(2) for o, a in opts: @@ -227,10 +224,10 @@ def main(): print "Note: Ignoring all errors" if len(args) < 1: - usage() - sys.exit(2) + usage() + sys.exit(2) - install_dir=args[0] + install_dir = args[0] qmake_bin = 'qmake' if len(args) > 1: @@ -238,8 +235,8 @@ def main(): qmake_bin = which(qmake_bin) if qmake_bin == None: - print "Cannot find required binary 'qmake'." - sys.exit(2) + print "Cannot find required binary 'qmake'." + sys.exit(2) if not sys.platform.startswith('win'): chrpath_bin = which('chrpath') @@ -257,14 +254,14 @@ def main(): tr_catalogs = ['assistant', 'designer', 'qt', 'qt_help'] if sys.platform.startswith('win'): - global is_debug_build - is_debug_build = check_debug_build(install_dir) + global debug_build + debug_build = is_debug_build(install_dir) copy_qt_libs(install_dir, QT_INSTALL_LIBS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, plugins, imports) copy_translations(install_dir, QT_INSTALL_TRANSLATIONS, tr_catalogs) if not sys.platform.startswith('win'): - fix_rpaths(chrpath_bin ,install_dir) + fix_rpaths(chrpath_bin, install_dir) if __name__ == "__main__": if sys.platform == 'darwin': diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 32357b03a56af081f8bc4b7058db6decf94d985f..e5bc37137e111076c9f1d9c4e508b6617ba2e7b8 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -18916,7 +18916,7 @@ Hinweis: Unter Umständen wird die lokale Datei gelöscht.</translation> </message> <message> <source>Start and Debug Remote Application...</source> - <translation>Starte und Debugge externe Anwendung...</translation> + <translation>Starte und Debugge entfernte Anwendung...</translation> </message> <message> <source>Attach to Remote Debug Server...</source> diff --git a/share/qtcreator/welcomescreen/develop.qml b/share/qtcreator/welcomescreen/develop.qml index c106084ca76ff7ace52860645ab04406bae4eba9..0dac47a88330e8e01b8a5e4ca7f2e62785be4866 100644 --- a/share/qtcreator/welcomescreen/develop.qml +++ b/share/qtcreator/welcomescreen/develop.qml @@ -66,12 +66,13 @@ Rectangle { Rectangle { width: 1 - height: line.height + height: Math.max(Math.min(recentProjects.contentHeight + 120, recentProjects.height), sessions.height) color: "#c4c4c4" anchors.left: sessions.right anchors.leftMargin: -1 anchors.top: sessions.top - + visible: !sessions.scrollBarVisible + id: sessionLine } RecentProjects { @@ -96,11 +97,12 @@ Rectangle { Rectangle { id: line width: 1 - height: Math.min(recentProjects.contentHeight + 120, recentProjects.height) + height: sessionLine.height color: "#c4c4c4" anchors.left: recentProjects.right anchors.leftMargin: -1 anchors.top: recentProjects.top + visible: !recentProjects.scrollBarVisible } Text { diff --git a/share/qtcreator/welcomescreen/widgets/RecentProjects.qml b/share/qtcreator/welcomescreen/widgets/RecentProjects.qml index e3b6c853389055a2925125728a7bb9e2942a39f7..74c01bb2c0f3772e5926d7f0732932759f9d7ce8 100644 --- a/share/qtcreator/welcomescreen/widgets/RecentProjects.qml +++ b/share/qtcreator/welcomescreen/widgets/RecentProjects.qml @@ -34,7 +34,8 @@ import QtQuick 1.0 import qtcomponents 1.0 ScrollArea { - //id: projectList + property bool scrollBarVisible: projectList.verticalScrollBar.visible + id: projectList property alias model: repeater.model Behavior on verticalScrollBar.opacity { diff --git a/share/qtcreator/welcomescreen/widgets/Sessions.qml b/share/qtcreator/welcomescreen/widgets/Sessions.qml index db970a2a144a1a25d5a313f884ea03d558f7616a..ac8970c7666808c5d368bbb41cb1e6fb7641358e 100644 --- a/share/qtcreator/welcomescreen/widgets/Sessions.qml +++ b/share/qtcreator/welcomescreen/widgets/Sessions.qml @@ -38,6 +38,8 @@ Item { property int topMargin: 6 height: Math.min(root.contentHeight + topMargin, parent.height - 260) + property alias scrollBarVisible: vscrollbar.visible + ListView { id: root diff --git a/share/qtcreator/welcomescreen/widgets/images/icons/delete.png b/share/qtcreator/welcomescreen/widgets/images/icons/delete.png index 3e4d8bb940d0e1c520f847e4153644776c44a004..0c88462ae8412cc4dad49b457f3839e24fcf7a12 100644 Binary files a/share/qtcreator/welcomescreen/widgets/images/icons/delete.png and b/share/qtcreator/welcomescreen/widgets/images/icons/delete.png differ diff --git a/share/qtcreator/welcomescreen/widgets/images/icons/rename.png b/share/qtcreator/welcomescreen/widgets/images/icons/rename.png index 5de1ad11406179b332047540e31badc774cc1cdc..b55560aacdf02bc54b88a1158216e301d7e6bd60 100644 Binary files a/share/qtcreator/welcomescreen/widgets/images/icons/rename.png and b/share/qtcreator/welcomescreen/widgets/images/icons/rename.png differ diff --git a/share/qtcreator/welcomescreen/widgets/images/info.png b/share/qtcreator/welcomescreen/widgets/images/info.png index 52f0881a9050f6ac6463b948abe5959020d43c10..74e5a2e0b7ea981462b6dbb2ae7a81beb800b79d 100644 Binary files a/share/qtcreator/welcomescreen/widgets/images/info.png and b/share/qtcreator/welcomescreen/widgets/images/info.png differ diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index 0c0f7c2e93d46b34138bf4523d7acd8f4222dffe..ec617ff929851e9efe4c9d7ac0507b1b49dfef17 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -473,7 +473,7 @@ const Macro *Document::findMacroDefinitionAt(unsigned line) const const Document::MacroUse *Document::findMacroUseAt(unsigned offset) const { foreach (const Document::MacroUse &use, _macroUses) { - if (use.contains(offset)) + if (use.contains(offset) && (offset < use.begin() + use.macro().name().length())) return &use; } return 0; @@ -482,7 +482,7 @@ const Document::MacroUse *Document::findMacroUseAt(unsigned offset) const const Document::UndefinedMacroUse *Document::findUndefinedMacroUseAt(unsigned offset) const { foreach (const Document::UndefinedMacroUse &use, _undefinedMacroUses) { - if (use.contains(offset)) + if (use.contains(offset) && (offset < use.begin() + use.name().length())) return &use; } return 0; diff --git a/src/libs/qmljs/qmljsinterpreter.cpp b/src/libs/qmljs/qmljsinterpreter.cpp index b9fdb64e8598fdc9d9f82836e5a7da02f420f272..8f9ba9ebbced7d38fffb96354a63f19f15de6d6e 100644 --- a/src/libs/qmljs/qmljsinterpreter.cpp +++ b/src/libs/qmljs/qmljsinterpreter.cpp @@ -1285,7 +1285,7 @@ CppQmlTypesLoader::BuiltinObjects CppQmlTypesLoader::loadQmlTypes(const QFileInf if (!warning.isEmpty()) { warnings->append(TypeDescriptionReader::tr( "Warnings while loading qmltypes from %1:\n%2").arg( - qmlTypeFile.absoluteFilePath(), error)); + qmlTypeFile.absoluteFilePath(), warning)); } } diff --git a/src/libs/qmljs/qmljstypedescriptionreader.cpp b/src/libs/qmljs/qmljstypedescriptionreader.cpp index a59584d334fccd886b11f48455c77d76a61c1bbc..a0f96cdb5bf886370e81798e70d63b231664c4cc 100644 --- a/src/libs/qmljs/qmljstypedescriptionreader.cpp +++ b/src/libs/qmljs/qmljstypedescriptionreader.cpp @@ -218,7 +218,7 @@ void TypeDescriptionReader::readComponent(UiObjectDefinition *ast) fmo->setAttachedTypeName(readStringBinding(script)); } else { addWarning(script->firstSourceLocation(), - "Expected only name, prototype, defaultProperty, attachedType, exports" + "Expected only name, prototype, defaultProperty, attachedType, exports " "and exportMetaObjectRevisions script bindings"); } } else { diff --git a/src/plugins/bineditor/bineditor.cpp b/src/plugins/bineditor/bineditor.cpp index 46e3347577cd7cf7191f98b2ce0bda88111fa980..68eca4ea7317c9440a9d69bfd63e692df8467378 100644 --- a/src/plugins/bineditor/bineditor.cpp +++ b/src/plugins/bineditor/bineditor.cpp @@ -386,28 +386,40 @@ bool BinEditor::save(QString *errorString, const QString &oldFileName, const QSt void BinEditor::setSizes(quint64 startAddr, int range, int blockSize) { - m_blockSize = blockSize; + int newBlockSize = blockSize; QTC_ASSERT((blockSize/m_bytesPerLine) * m_bytesPerLine == blockSize, blockSize = (blockSize/m_bytesPerLine + 1) * m_bytesPerLine); - m_emptyBlock = QByteArray(blockSize, '\0'); - m_modifiedData.clear(); - m_requests.clear(); - // Users can edit data in the range // [startAddr - range/2, startAddr + range/2]. - m_baseAddr = quint64(range/2) > startAddr ? 0 : startAddr - range/2; - m_baseAddr = (m_baseAddr / blockSize) * blockSize; + quint64 newBaseAddr = quint64(range/2) > startAddr ? 0 : startAddr - range/2; + newBaseAddr = (newBaseAddr / blockSize) * blockSize; - const quint64 maxRange = Q_UINT64_C(0xffffffffffffffff) - m_baseAddr + 1; - m_size = m_baseAddr != 0 && quint64(range) >= maxRange + const quint64 maxRange = Q_UINT64_C(0xffffffffffffffff) - newBaseAddr + 1; + int newSize = newBaseAddr != 0 && quint64(range) >= maxRange ? maxRange : range; - m_addressBytes = (m_baseAddr + m_size < quint64(1) << 32 - && m_baseAddr + m_size >= m_baseAddr) ? 4 : 8; + int newAddressBytes = (newBaseAddr + newSize < quint64(1) << 32 + && newBaseAddr + newSize >= newBaseAddr) ? 4 : 8; + + + + if (newBlockSize == m_blockSize + && newBaseAddr == m_baseAddr + && newSize == m_size + && newAddressBytes == m_addressBytes) + return; + + m_blockSize = blockSize; + m_emptyBlock = QByteArray(blockSize, '\0'); + m_modifiedData.clear(); + m_requests.clear(); + + m_baseAddr = newBaseAddr; + m_size = newSize; + m_addressBytes = newAddressBytes; m_unmodifiedState = 0; m_undoStack.clear(); m_redoStack.clear(); - init(); setCursorPosition(startAddr - m_baseAddr); diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp index 37c8b58de85b9be0801362076406c15d8831af8b..9a26c4a1cbea66ea34b32ba93a2b4e6aa7a9972a 100644 --- a/src/plugins/bineditor/bineditorplugin.cpp +++ b/src/plugins/bineditor/bineditorplugin.cpp @@ -234,10 +234,10 @@ public: if (offset >= static_cast<quint64>(file.size())) return false; if (file.open(QIODevice::ReadOnly)) { + file.close(); m_fileName = fileName; m_editor->setSizes(offset, file.size()); m_editor->editor()->setDisplayName(QFileInfo(fileName).fileName()); - file.close(); return true; } QString errStr = tr("Cannot open %1: %2").arg( @@ -258,11 +258,11 @@ private slots: int blockSize = m_editor->dataBlockSize(); file.seek(block * blockSize); QByteArray data = file.read(blockSize); + file.close(); const int dataSize = data.size(); if (dataSize != blockSize) data += QByteArray(blockSize - dataSize, 0); m_editor->addData(block, data); - file.close(); } else { QMessageBox::critical(Core::ICore::mainWindow(), tr("File Error"), tr("Cannot open %1: %2").arg( diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp index 94c943d578eb54aa947b0167ff4f05da70d340e4..9d6da9f2ff2fddeb4583745b72a7c06d995bdd6d 100644 --- a/src/plugins/cpaster/cpasterplugin.cpp +++ b/src/plugins/cpaster/cpasterplugin.cpp @@ -253,7 +253,7 @@ void CodepasterPlugin::post(QString data, const QString &mimeType) const QString username = m_settings->username; - PasteView view(m_protocols, mimeType, 0); + PasteView view(m_protocols, mimeType, ICore::mainWindow()); view.setProtocol(m_settings->protocol); const FileDataList diffChunks = splitDiffToFiles(data); diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 4bf4a4fc40b79e64d28f94838dd01b5d76889bfa..e6149b9bacd1cc7e68837b0e0203156fc4518b0f 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -707,11 +707,14 @@ const Macro *CPPEditorWidget::findCanonicalMacro(const QTextCursor &cursor, Docu int line, col; convertPosition(cursor.position(), &line, &col); - if (const Macro *macro = doc->findMacroDefinitionAt(line)) - return macro; - - if (const Document::MacroUse *use = doc->findMacroUseAt(cursor.position())) + if (const Macro *macro = doc->findMacroDefinitionAt(line)) { + QTextCursor macroCursor = cursor; + const QByteArray name = identifierUnderCursor(¯oCursor).toLatin1(); + if (macro->name() == name) + return macro; + } else if (const Document::MacroUse *use = doc->findMacroUseAt(cursor.position())) { return &use->macro(); + } return 0; } @@ -722,12 +725,13 @@ void CPPEditorWidget::findUsages() info.snapshot = CppModelManagerInterface::instance()->snapshot(); info.snapshot.insert(info.doc); - CanonicalSymbol cs(this, info); - Symbol *canonicalSymbol = cs(textCursor()); - if (canonicalSymbol) { - m_modelManager->findUsages(canonicalSymbol, cs.context()); - } else if (const Macro *macro = findCanonicalMacro(textCursor(), info.doc)) { + if (const Macro *macro = findCanonicalMacro(textCursor(), info.doc)) { m_modelManager->findMacroUsages(*macro); + } else { + CanonicalSymbol cs(this, info); + Symbol *canonicalSymbol = cs(textCursor()); + if (canonicalSymbol) + m_modelManager->findUsages(canonicalSymbol, cs.context()); } } @@ -1381,6 +1385,25 @@ CPPEditorWidget::Link CPPEditorWidget::findLinkAt(const QTextCursor &cursor, tc.setPosition(endOfToken); } + // Handle macro uses + const Macro *macro = doc->findMacroDefinitionAt(line); + if (macro) { + QTextCursor macroCursor = cursor; + const QByteArray name = identifierUnderCursor(¯oCursor).toLatin1(); + if (macro->name() == name) + return link; //already on definition! + } else { + const Document::MacroUse *use = doc->findMacroUseAt(endOfToken - 1); + if (use && use->macro().fileName() != QLatin1String("<configuration>")) { + const Macro ¯o = use->macro(); + link.fileName = macro.fileName(); + link.line = macro.line(); + link.begin = use->begin(); + link.end = use->end(); + return link; + } + } + // Find the last symbol up to the cursor position Scope *scope = doc->scopeAt(line, column); if (!scope) diff --git a/src/plugins/cpptools/cppcompletionassist.cpp b/src/plugins/cpptools/cppcompletionassist.cpp index 5e59fa0401a88ef7f52e69dd0538fa579b316397..e7f41b2b7331691f72bdf2de4745878ddfbee247 100644 --- a/src/plugins/cpptools/cppcompletionassist.cpp +++ b/src/plugins/cpptools/cppcompletionassist.cpp @@ -198,6 +198,26 @@ bool CppAssistProposalItem::prematurelyApplies(const QChar &typedChar) const return false; } +static bool isDereferenced(TextEditor::BaseTextEditor *editor, int basePosition) +{ + QTextCursor cursor = editor->editorWidget()->textCursor(); + cursor.setPosition(basePosition); + + BackwardsScanner scanner(cursor); + for (int pos = scanner.startToken()-1; pos >= 0; pos--) { + switch (scanner[pos].kind()) { + case T_COLON_COLON: + case T_IDENTIFIER: + //Ignore scope specifiers + break; + + case T_AMPER: return true; + default: return false; + } + } + return false; +} + void CppAssistProposalItem::applyContextualContent(TextEditor::BaseTextEditor *editor, int basePosition) const { @@ -249,7 +269,7 @@ void CppAssistProposalItem::applyContextualContent(TextEditor::BaseTextEditor *e extraChars += QLatin1Char('<'); } #endif - } else if (! function->isAmbiguous()) { + } else if (!isDereferenced(editor, basePosition) && ! function->isAmbiguous()) { // When the user typed the opening parenthesis, he'll likely also type the closing one, // in which case it would be annoying if we put the cursor after the already automatically // inserted closing parenthesis. diff --git a/src/plugins/debugger/watchdata.cpp b/src/plugins/debugger/watchdata.cpp index d8112360b0083c814eb9bdc0dc02f073c4200f60..8d6ed6bce5a0c90db4691f871c5d089415c85f30 100644 --- a/src/plugins/debugger/watchdata.cpp +++ b/src/plugins/debugger/watchdata.cpp @@ -83,10 +83,11 @@ bool isIntType(const QByteArray &type) case 'c': return type == "char"; case 'i': - return type == "int" || type == "int64"; + return type == "int"; case 'l': return type == "long" - || type.startsWith("long "); + || type == "long int" + || type == "long unsigned int"; case 'p': return type == "ptrdiff_t"; case 'q': @@ -100,10 +101,24 @@ bool isIntType(const QByteArray &type) || type == "size_t" || type == "std::size_t" || type == "std::ptrdiff_t" - || type.startsWith("signed "); + || (type.startsWith("signed") && + ( type == "signed char" + || type == "signed short" + || type == "signed short int" + || type == "signed long" + || type == "signed long int" + || type == "signed long long" + || type == "signed long long int")); case 'u': return type == "unsigned" - || type.startsWith("unsigned "); + || (type.startsWith("unsigned") && + ( type == "unsigned char" + || type == "unsigned short" + || type == "unsigned short int" + || type == "unsigned long" + || type == "unsigned long int" + || type == "unsigned long long" + || type == "unsigned long long int")); default: return false; } diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 720a2232c3eb14d60fb62402c9d400c23743bd67..4eca5a194807d85fdb3413a38d7e58f6a7c0bf26 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -378,8 +378,9 @@ static QString reformatCharacter(int code, int format) const QString codeS = reformatInteger(code, format); if (code < 0) // Append unsigned value. return codeS + QLatin1String(" / ") + reformatInteger(256 + code, format); - if (code >= 32 && code < 128) - return codeS + QLatin1String(" '") + QChar(code) + QLatin1Char('\''); + const QChar c = QLatin1Char(code); + if (c.isPrint()) + return codeS + QLatin1String(" '") + c + QLatin1Char('\''); switch (code) { case 0: return codeS + QLatin1String(" '\\0'"); @@ -402,7 +403,7 @@ static QString quoteUnprintable(const QString &str) if (WatchHandler::unprintableBase() == -1) { foreach (const QChar c, str) { int u = c.unicode(); - if (u >= 32 && u < 127) + if (c.isPrint()) encoded += c; else if (u == '\r') encoded += QLatin1String("\\r"); @@ -473,9 +474,6 @@ QString WatchModel::formattedValue(const WatchData &data) const return value; } - const QByteArray qtNamespace = engine()->qtNamespace(); - int format = itemFormat(data); - if (isIntType(data.type)) { if (value.isEmpty()) return value; @@ -483,7 +481,9 @@ QString WatchModel::formattedValue(const WatchData &data) const const QChar firstChar = value.at(0); if (!firstChar.isDigit() && firstChar != QLatin1Char('-')) return value; + // Append quoted, printable character also for decimal. + const int format = itemFormat(data); if (data.type.endsWith("char")) { bool ok; const int code = value.toInt(&ok); @@ -504,8 +504,10 @@ QString WatchModel::formattedValue(const WatchData &data) const if (!isPointerType(data.type) && !data.isVTablePointer()) { bool ok = false; qulonglong integer = value.toULongLong(&ok, 0); - if (ok) - return reformatInteger(integer, format); + if (ok) { + const int format = itemFormat(data); + return reformatInteger(integer, format); + } } return translate(value); @@ -1087,8 +1089,9 @@ void WatchModel::insertData(const WatchData &data) if (WatchItem *oldItem = findItem(data.iname, parent)) { bool hadChildren = oldItem->hasChildren; // Overwrite old entry. + bool hasChanged = oldItem->hasChanged(data); oldItem->setData(data); - oldItem->changed = data.hasChanged(*oldItem); + oldItem->changed = hasChanged; oldItem->generation = m_generationCounter; QModelIndex idx = watchIndex(oldItem); emit dataChanged(idx, idx.sibling(idx.row(), 2)); diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index 06e18efd7e364e2e381c3b29875f072f71077e8e..0350bb03e48f9807ba235f1ae866489a13338a57 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -631,8 +631,6 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev) mi0.data(LocalsTypeFormatRole).toInt(); const int individualFormat = mi0.data(LocalsIndividualFormatRole).toInt(); - const int effectiveIndividualFormat = - individualFormat == -1 ? typeFormat : individualFormat; const int unprintableBase = handler->unprintableBase(); QMenu formatMenu; @@ -667,16 +665,18 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev) QAction *dummy = formatMenu.addAction( tr("Change Display for Object Named \"%1\":").arg(mi0.data().toString())); dummy->setEnabled(false); - clearIndividualFormatAction - = formatMenu.addAction(spacer + tr("Use Display Format Based on Type")); - //clearIndividualFormatAction->setEnabled(individualFormat != -1); + QString msg = (individualFormat == -1 && typeFormat != -1) + ? tr("Use Format for Type (Currently %1)") + .arg(alternativeFormats.at(typeFormat)) + : tr("Use Display Format Based on Type "); + clearIndividualFormatAction = formatMenu.addAction(spacer + msg); clearIndividualFormatAction->setCheckable(true); - clearIndividualFormatAction->setChecked(effectiveIndividualFormat == -1); + clearIndividualFormatAction->setChecked(individualFormat == -1); for (int i = 0; i != alternativeFormats.size(); ++i) { const QString format = spacer + alternativeFormats.at(i); QAction *act = new QAction(format, &formatMenu); act->setCheckable(true); - if (i == effectiveIndividualFormat) + if (i == individualFormat) act->setChecked(true); formatMenu.addAction(act); individualFormatActions.append(act); diff --git a/src/plugins/git/clonewizard.cpp b/src/plugins/git/clonewizard.cpp index 46441dff47fb9c733416b45f14ddc25eacfd0bb9..c8923d2f8dd305a55dec2474c28f6e182e413780 100644 --- a/src/plugins/git/clonewizard.cpp +++ b/src/plugins/git/clonewizard.cpp @@ -83,8 +83,14 @@ QSharedPointer<VcsBase::AbstractCheckoutJob> CloneWizard::createJob(const QList< QString *checkoutPath) { // Collect parameters for the clone command. - const CloneWizardPage *cwp = qobject_cast<const CloneWizardPage *>(parameterPages.front()); - QTC_ASSERT(cwp, return QSharedPointer<VcsBase::AbstractCheckoutJob>()) + const CloneWizardPage *cwp = 0; + foreach (QWizardPage *wp, parameterPages) { + cwp = qobject_cast<const CloneWizardPage *>(wp); + if (cwp) + break; + } + + QTC_ASSERT(cwp, return QSharedPointer<VcsBase::AbstractCheckoutJob>()); return cwp->createCheckoutJob(checkoutPath); } diff --git a/src/plugins/imageviewer/imageviewerfile.cpp b/src/plugins/imageviewer/imageviewerfile.cpp index 2db2908262bd6b203e2e25ce84e158cb3ace1efe..46caff8e6f914b93488b31e9c213f87749d0afd1 100644 --- a/src/plugins/imageviewer/imageviewerfile.cpp +++ b/src/plugins/imageviewer/imageviewerfile.cpp @@ -89,6 +89,8 @@ bool ImageViewerFile::save(QString *errorString, const QString &fileName, bool a void ImageViewerFile::rename(const QString &newName) { d->fileName = newName; + d->editor->setDisplayName(QFileInfo(d->fileName).fileName()); + emit changed(); } QString ImageViewerFile::fileName() const diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 4c09b36ea8f45fe1eb5f0159d42b9c6a2e5a2b4e..a73f04eb959c55f58e8619bb691c7fa69c63554a 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -546,21 +546,24 @@ QList<ToolChain *> MsvcToolChainFactory::autoDetect() if (folder.isEmpty()) continue; - const QString sdkVcVarsBat = folder + QLatin1String("bin\\SetEnv.cmd"); - if (!QFileInfo(sdkVcVarsBat).exists()) + QDir dir(folder); + if (!dir.cd(QLatin1String("bin"))) + continue; + QFileInfo fi(dir, QLatin1String("SetEnv.cmd")); + if (!fi.exists()) continue; - QList<ToolChain *> tmp; + QList<ToolChain *> tmp; tmp.append(new MsvcToolChain(generateDisplayName(name, MsvcToolChain::WindowsSDK, MsvcToolChain::s32), findAbiOfMsvc(MsvcToolChain::WindowsSDK, MsvcToolChain::s32, version), - sdkVcVarsBat, QLatin1String("/x86"), true)); + fi.absoluteFilePath(), QLatin1String("/x86"), true)); // Add all platforms tmp.append(new MsvcToolChain(generateDisplayName(name, MsvcToolChain::WindowsSDK, MsvcToolChain::s64), findAbiOfMsvc(MsvcToolChain::WindowsSDK, MsvcToolChain::s64, version), - sdkVcVarsBat, QLatin1String("/x64"), true)); + fi.absoluteFilePath(), QLatin1String("/x64"), true)); tmp.append(new MsvcToolChain(generateDisplayName(name, MsvcToolChain::WindowsSDK, MsvcToolChain::ia64), findAbiOfMsvc(MsvcToolChain::WindowsSDK, MsvcToolChain::ia64, version), - sdkVcVarsBat, QLatin1String("/ia64"), true)); + fi.absoluteFilePath(), QLatin1String("/ia64"), true)); // Make sure the default is front. if (folder == defaultSdkPath) results = tmp + results; diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp index 766519ee10e291d9c8f81bb926820957bc84c503..002eb5fd1aef8a3a32f1d3ce30a49f5f493b85a2 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.cpp +++ b/src/plugins/qt4projectmanager/qt4nodes.cpp @@ -257,6 +257,11 @@ Qt4PriFileNode::Qt4PriFileNode(Qt4Project *project, Qt4ProFileNode* qt4ProFileNo setIcon(qt4NodeStaticData()->projectIcon); } +Qt4PriFileNode::~Qt4PriFileNode() +{ + watchFolders(QSet<QString>()); +} + void Qt4PriFileNode::scheduleUpdate() { QtSupport::ProFileCacheManager::instance()->discardFile(m_projectFilePath); diff --git a/src/plugins/qt4projectmanager/qt4nodes.h b/src/plugins/qt4projectmanager/qt4nodes.h index dfaec5e67b26659ec87e4b88b9d6bec0bea796c3..8df585e1acb13e2dcee91f5ea00761be068a962e 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.h +++ b/src/plugins/qt4projectmanager/qt4nodes.h @@ -129,6 +129,7 @@ class QT4PROJECTMANAGER_EXPORT Qt4PriFileNode : public ProjectExplorer::ProjectN public: Qt4PriFileNode(Qt4Project *project, Qt4ProFileNode* qt4ProFileNode, const QString &filePath); + ~Qt4PriFileNode(); void update(ProFile *includeFileExact, QtSupport::ProFileReader *readerExact, ProFile *includeFileCumlative, QtSupport::ProFileReader *readerCumalative); diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.cpp b/src/plugins/qt4projectmanager/qt4projectmanager.cpp index a57a903b3fcb67ef3010016003970ce8ffcc7898..5a0c459f3484f9883fff4be4fa29445426fa79f3 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanager.cpp @@ -201,7 +201,7 @@ void Qt4Manager::updateVariable(const QByteArray &variable) return; } QString value; - QtSupport::BaseQtVersion *qtv; + const QtSupport::BaseQtVersion *qtv = 0; if (Qt4BaseTarget *t = qt4pro->activeTarget()) { if (Qt4BuildConfiguration *bc = t->activeQt4BuildConfiguration()) qtv = bc->qtVersion(); diff --git a/src/plugins/texteditor/basetextdocumentlayout.cpp b/src/plugins/texteditor/basetextdocumentlayout.cpp index 0166d19a4fea37620b271c8a1409f7efeca1c9a0..66ac014c9b55745f306d54d53b75e127e09b5c10 100644 --- a/src/plugins/texteditor/basetextdocumentlayout.cpp +++ b/src/plugins/texteditor/basetextdocumentlayout.cpp @@ -84,7 +84,7 @@ bool DocumentMarker::addMark(TextEditor::ITextMark *mark) userData->addMark(mark); m_marksCache.append(mark); mark->updateLineNumber(blockNumber + 1); - QTC_CHECK(mark->lineNumber() == blockNumber + 1); + QTC_CHECK(mark->lineNumber() == blockNumber + 1); // Checks that the base class is called mark->updateBlock(block); documentLayout->hasMarks = true; documentLayout->maxMarkWidthFactor = qMax(mark->widthFactor(), @@ -716,14 +716,14 @@ void BaseTextDocumentLayout::documentClosing() void BaseTextDocumentLayout::updateMarksLineNumber() { + // Note: the breakpointmanger deletes breakpoint marks and readds them + // if it doesn't agree with our updating QTextBlock block = document()->begin(); int blockNumber = 0; while (block.isValid()) { if (const TextBlockUserData *userData = testUserData(block)) - foreach (ITextMark *mrk, userData->marks()) { + foreach (ITextMark *mrk, userData->marks()) mrk->updateLineNumber(blockNumber + 1); - QTC_CHECK(mrk->lineNumber() == blockNumber +1); - } block = block.next(); ++blockNumber; } diff --git a/src/plugins/vcsbase/basecheckoutwizard.cpp b/src/plugins/vcsbase/basecheckoutwizard.cpp index 6876130588f2449ec7f75818fca6ce362420ff20..b19c281c1ea3cf670a329371ebf991e30ff44887 100644 --- a/src/plugins/vcsbase/basecheckoutwizard.cpp +++ b/src/plugins/vcsbase/basecheckoutwizard.cpp @@ -219,8 +219,7 @@ QString BaseCheckoutWizard::openProject(const QString &path, QString *errorMessa void BaseCheckoutWizard::slotProgressPageShown() { const QSharedPointer<AbstractCheckoutJob> job = createJob(d->parameterPages, &(d->checkoutPath)); - if (!job.isNull()) - d->dialog->start(job); + d->dialog->start(job); } } // namespace VcsBase diff --git a/src/plugins/vcsbase/checkoutprogresswizardpage.cpp b/src/plugins/vcsbase/checkoutprogresswizardpage.cpp index 21994dce78399fbe00f50a5f3418633722164a75..f7d0dd466fea936d595c5290fc779fc38e50cc28 100644 --- a/src/plugins/vcsbase/checkoutprogresswizardpage.cpp +++ b/src/plugins/vcsbase/checkoutprogresswizardpage.cpp @@ -69,6 +69,11 @@ CheckoutProgressWizardPage::~CheckoutProgressWizardPage() void CheckoutProgressWizardPage::start(const QSharedPointer<AbstractCheckoutJob> &job) { + if (job.isNull()) { + ui->logPlainTextEdit->setPlainText(tr("No job running, please abort.")); + return; + } + QTC_ASSERT(m_state != Running, return) m_job = job; connect(job.data(), SIGNAL(output(QString)), ui->logPlainTextEdit, SLOT(appendPlainText(QString)));