aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--qbs/modules/qtc/qtc.qbs2
-rw-r--r--qtcreator.pri2
-rw-r--r--qtcreator.pro15
-rwxr-xr-xscripts/createDistPackage.py76
-rw-r--r--src/libs/clangsupport/clangpathwatcher.h2
-rw-r--r--src/libs/clangsupport/clangsupport_global.h6
-rw-r--r--src/libs/clangsupport/filepathcache.h2
-rw-r--r--src/libs/utils/mimetypes/mimeprovider.cpp7
-rw-r--r--src/plugins/bookmarks/bookmark.cpp5
-rw-r--r--src/plugins/bookmarks/bookmarkmanager.cpp2
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeeditor.cpp16
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeeditor.h2
-rw-r--r--src/plugins/coreplugin/icontext.h5
-rw-r--r--src/plugins/designer/designercontext.cpp4
-rw-r--r--src/plugins/designer/designercontext.h2
-rw-r--r--src/plugins/diffeditor/diffeditorcontroller.cpp5
-rw-r--r--src/plugins/diffeditor/diffeditorcontroller.h8
-rw-r--r--src/plugins/diffeditor/diffeditorplugin.cpp39
-rw-r--r--src/plugins/git/gitclient.cpp7
-rw-r--r--src/plugins/help/helpplugin.cpp14
-rw-r--r--src/plugins/help/helpplugin.h3
-rw-r--r--src/plugins/help/helpwidget.cpp1
-rw-r--r--src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp8
-rw-r--r--src/plugins/qmldesigner/components/formeditor/formeditorwidget.h4
-rw-r--r--src/plugins/qmldesigner/components/integration/designdocument.cpp8
-rw-r--r--src/plugins/qmldesigner/components/integration/designdocument.h4
-rw-r--r--src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp8
-rw-r--r--src/plugins/qmldesigner/components/navigator/navigatorwidget.h4
-rw-r--r--src/plugins/qmldesigner/components/texteditor/texteditorview.cpp16
-rw-r--r--src/plugins/qmldesigner/components/texteditor/texteditorview.h6
-rw-r--r--src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp4
-rw-r--r--src/plugins/qmldesigner/components/texteditor/texteditorwidget.h2
-rw-r--r--src/plugins/qmldesigner/designercore/include/abstractview.h4
-rw-r--r--src/plugins/qmldesigner/designercore/include/viewmanager.h2
-rw-r--r--src/plugins/qmldesigner/designercore/model/abstractview.cpp9
-rw-r--r--src/plugins/qmldesigner/designercore/model/viewmanager.cpp4
-rw-r--r--src/plugins/qmldesigner/designmodecontext.cpp16
-rw-r--r--src/plugins/qmldesigner/designmodecontext.h8
-rw-r--r--src/plugins/qmldesigner/designmodewidget.cpp7
-rw-r--r--src/plugins/qmldesigner/designmodewidget.h2
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertool.cpp8
-rw-r--r--src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp2
-rw-r--r--src/plugins/texteditor/texteditor.cpp8
-rw-r--r--src/plugins/texteditor/texteditor.h4
-rw-r--r--src/tools/clangbackend/source/clangcodemodelserver.cpp4
-rw-r--r--tests/unit/unittest/clangtooltipinfo-test.cpp3
47 files changed, 236 insertions, 136 deletions
diff --git a/README.md b/README.md
index 2313fce261..960a50fd4e 100644
--- a/README.md
+++ b/README.md
@@ -74,7 +74,7 @@ For detailed information on the supported compilers, see
an outdated version 5.8 which cannot be used for Qt.
5. In the working directory, check out the respective branch of Qt from
- <https://code.qt.io/cgit/qt/qt5.git> (we recommend the latest released version).
+ <https://code.qt.io/cgit/qt/qt5.git> (we recommend the highest released version).
6. Check out Qt Creator (master branch or latest version, see
<https://code.qt.io/cgit/qt-creator/qt-creator.git>).
diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs
index de49d790ad..416e27e4e8 100644
--- a/qbs/modules/qtc/qtc.qbs
+++ b/qbs/modules/qtc/qtc.qbs
@@ -17,7 +17,7 @@ Module {
property string qtcreator_compat_version: ide_compat_version_major + '.'
+ ide_compat_version_minor + '.' + ide_compat_version_release
- property string qtcreator_copyright_year: '2017'
+ property string qtcreator_copyright_year: '2018'
property string qtcreator_copyright_string: "(C) " + qtcreator_copyright_year + " The Qt Company Ltd"
property string ide_display_name: 'Qt Creator'
diff --git a/qtcreator.pri b/qtcreator.pri
index 1f8020b791..a53b1fe9ed 100644
--- a/qtcreator.pri
+++ b/qtcreator.pri
@@ -5,7 +5,7 @@ QTCREATOR_VERSION = 4.6.82
QTCREATOR_COMPAT_VERSION = 4.6.82
VERSION = $$QTCREATOR_VERSION
QTCREATOR_DISPLAY_VERSION = 4.7.0-beta1
-QTCREATOR_COPYRIGHT_YEAR = 2017
+QTCREATOR_COPYRIGHT_YEAR = 2018
BINARY_ARTIFACTS_BRANCH = master
isEmpty(IDE_DISPLAY_NAME): IDE_DISPLAY_NAME = Qt Creator
diff --git a/qtcreator.pro b/qtcreator.pro
index b5f48709cd..d8a95fc222 100644
--- a/qtcreator.pro
+++ b/qtcreator.pro
@@ -110,7 +110,6 @@ linux {
macx {
APPBUNDLE = "$$OUT_PWD/bin/Qt Creator.app"
BINDIST_SOURCE = "$$OUT_PWD/bin/Qt Creator.app"
- BINDIST_INSTALLER_SOURCE = $$BINDIST_SOURCE
deployqt.commands = $$PWD/scripts/deployqtHelper_mac.sh \"$${APPBUNDLE}\" \"$$[QT_INSTALL_BINS]\" \"$$[QT_INSTALL_TRANSLATIONS]\" \"$$[QT_INSTALL_PLUGINS]\" \"$$[QT_INSTALL_IMPORTS]\" \"$$[QT_INSTALL_QML]\"
codesign.commands = codesign --deep -s \"$(SIGNING_IDENTITY)\" $(SIGNING_FLAGS) \"$${APPBUNDLE}\"
dmg.commands = $$PWD/scripts/makedmg.sh $$OUT_PWD/bin $${BASENAME}.dmg
@@ -118,7 +117,7 @@ macx {
QMAKE_EXTRA_TARGETS += codesign dmg
} else {
BINDIST_SOURCE = "$(INSTALL_ROOT)$$QTC_PREFIX"
- BINDIST_INSTALLER_SOURCE = "$$BINDIST_SOURCE/*"
+ BINDIST_EXCLUDE_ARG = "--exclude-toplevel"
deployqt.commands = python -u $$PWD/scripts/deployqt.py -i \"$(INSTALL_ROOT)$$QTC_PREFIX\" \"$(QMAKE)\"
deployqt.depends = install
win32 {
@@ -138,10 +137,12 @@ isEmpty(INSTALLER_ARCHIVE_FROM_ENV) {
INSTALLER_ARCHIVE = $$OUT_PWD/$$(INSTALLER_ARCHIVE)
}
-#bindist.depends = deployqt
-bindist.commands = 7z a -mx9 $$OUT_PWD/$${BASENAME}.7z \"$$BINDIST_SOURCE\"
-#bindist_installer.depends = deployqt
-bindist_installer.commands = 7z a -mx9 $${INSTALLER_ARCHIVE} \"$$BINDIST_INSTALLER_SOURCE\"
+INSTALLER_ARCHIVE_DEBUG = $$INSTALLER_ARCHIVE
+INSTALLER_ARCHIVE_DEBUG ~= s/(.*)[.]7z/\1-debug.7z
+
+bindist.commands = python -u $$PWD/scripts/createDistPackage.py $$OUT_PWD/$${BASENAME}.7z \"$$BINDIST_SOURCE\"
+bindist_installer.commands = python -u $$PWD/scripts/createDistPackage.py $$BINDIST_EXCLUDE_ARG $${INSTALLER_ARCHIVE} \"$$BINDIST_SOURCE\"
+bindist_debug.commands = python -u $$PWD/scripts/createDistPackage.py --debug $$BINDIST_EXCLUDE_ARG $${INSTALLER_ARCHIVE_DEBUG} \"$$BINDIST_SOURCE\"
win32 {
deployqt.commands ~= s,/,\\\\,g
@@ -149,4 +150,4 @@ win32 {
bindist_installer.commands ~= s,/,\\\\,g
}
-QMAKE_EXTRA_TARGETS += deployqt bindist bindist_installer
+QMAKE_EXTRA_TARGETS += deployqt bindist bindist_installer bindist_debug
diff --git a/scripts/createDistPackage.py b/scripts/createDistPackage.py
new file mode 100755
index 0000000000..fc6e7b7aaa
--- /dev/null
+++ b/scripts/createDistPackage.py
@@ -0,0 +1,76 @@
+#!/usr/bin/env python
+############################################################################
+#
+# Copyright (C) 2018 The Qt Company Ltd.
+# Contact: https://www.qt.io/licensing/
+#
+# 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 The Qt Company. For licensing terms
+# and conditions see https://www.qt.io/terms-conditions. For further
+# information use the contact form at https://www.qt.io/contact-us.
+#
+# GNU General Public License Usage
+# Alternatively, this file may be used under the terms of the GNU
+# General Public License version 3 as published by the Free Software
+# Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+# included in the packaging of this file. Please review the following
+# information to ensure the GNU General Public License requirements will
+# be met: https://www.gnu.org/licenses/gpl-3.0.html.
+#
+############################################################################
+
+import argparse
+import os
+import shutil
+import subprocess
+import tempfile
+
+import common
+
+def parse_arguments():
+ parser = argparse.ArgumentParser(description="Create Qt Creator package, filtering out debug information files.")
+ parser.add_argument('--7z', help='path to 7z binary',
+ default='7z.exe' if common.is_windows_platform() else '7z',
+ metavar='<7z_binary>', dest='sevenzip')
+ parser.add_argument('--debug', help='package only the files with debug information',
+ dest='debug', action='store_true', default=False)
+ parser.add_argument('--exclude-toplevel', help='do not include the toplevel source directory itself in the resulting archive, only its contents',
+ dest='exclude_toplevel', action='store_true', default=False)
+ parser.add_argument('target_archive', help='output 7z file to create')
+ parser.add_argument('source_directory', help='source directory with the Qt Creator installation')
+ return parser.parse_args()
+
+def is_debug_file(filepath):
+ if common.is_mac_platform():
+ return filepath.endswith('.dSYM') or '.dSYM/' in filepath
+ elif common.is_linux_platform():
+ return filepath.endswith('.debug')
+ else:
+ return filepath.endswith('.pdb')
+
+def is_debug(path, filenames):
+ return [fn for fn in filenames if is_debug_file(os.path.join(path, fn))]
+
+def is_not_debug(path, filenames):
+ files = [fn for fn in filenames if os.path.isfile(os.path.join(path, fn))]
+ return [fn for fn in files if not is_debug_file(os.path.join(path, fn))]
+
+def main():
+ arguments = parse_arguments()
+ tempdir_base = tempfile.mkdtemp()
+ tempdir = os.path.join(tempdir_base, os.path.basename(arguments.source_directory))
+ try:
+ common.copytree(arguments.source_directory, tempdir, symlinks=True,
+ ignore=(is_not_debug if arguments.debug else is_debug))
+ zip_source = os.path.join(tempdir, '*') if arguments.exclude_toplevel else tempdir
+ subprocess.check_call([arguments.sevenzip, 'a', '-mx9',
+ arguments.target_archive, zip_source])
+ finally:
+ shutil.rmtree(tempdir_base)
+if __name__ == "__main__":
+ main()
diff --git a/src/libs/clangsupport/clangpathwatcher.h b/src/libs/clangsupport/clangpathwatcher.h
index 610e42cccf..9339c56d51 100644
--- a/src/libs/clangsupport/clangpathwatcher.h
+++ b/src/libs/clangsupport/clangpathwatcher.h
@@ -77,7 +77,7 @@ using IdCache = StringCache<Utils::SmallString,
template <typename FileSystemWatcher,
typename Timer>
-class CLANGSUPPORT_EXPORT ClangPathWatcher : public ClangPathWatcherInterface
+class CLANGSUPPORT_GCCEXPORT ClangPathWatcher : public ClangPathWatcherInterface
{
public:
ClangPathWatcher(FilePathCachingInterface &pathCache,
diff --git a/src/libs/clangsupport/clangsupport_global.h b/src/libs/clangsupport/clangsupport_global.h
index 34f65cdcad..67830143f6 100644
--- a/src/libs/clangsupport/clangsupport_global.h
+++ b/src/libs/clangsupport/clangsupport_global.h
@@ -39,6 +39,12 @@
# define CLANGSUPPORT_EXPORT Q_DECL_IMPORT
#endif
+#ifdef Q_CC_GNU
+# define CLANGSUPPORT_GCCEXPORT __attribute__((visibility("default")))
+#else
+# define CLANGSUPPORT_GCCEXPORT
+#endif
+
#ifndef CLANGBACKENDPROCESSPATH
# define CLANGBACKENDPROCESSPATH ""
#endif
diff --git a/src/libs/clangsupport/filepathcache.h b/src/libs/clangsupport/filepathcache.h
index 81bc3f40cc..ebdd2a8aac 100644
--- a/src/libs/clangsupport/filepathcache.h
+++ b/src/libs/clangsupport/filepathcache.h
@@ -36,7 +36,7 @@
namespace ClangBackEnd {
template <typename FilePathStorage>
-class CLANGSUPPORT_EXPORT FilePathCache
+class CLANGSUPPORT_GCCEXPORT FilePathCache
{
using DirectoryPathCache = StringCache<Utils::PathString,
int,
diff --git a/src/libs/utils/mimetypes/mimeprovider.cpp b/src/libs/utils/mimetypes/mimeprovider.cpp
index 68f69a2ed2..151da05458 100644
--- a/src/libs/utils/mimetypes/mimeprovider.cpp
+++ b/src/libs/utils/mimetypes/mimeprovider.cpp
@@ -802,7 +802,12 @@ void MimeXMLProvider::ensureLoaded()
// if (!fdoXmlFound) {
// // We could instead install the file as part of installing Qt?
- allFiles.prepend(QLatin1String(":/qt-project.org/qmime/freedesktop.org.xml"));
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
+ const char freedesktopOrgXml[] = ":/qt-project.org/qmime/packages/freedesktop.org.xml";
+#else
+ const char freedesktopOrgXml[] = ":/qt-project.org/qmime/freedesktop.org.xml";
+#endif
+ allFiles.prepend(QLatin1String(freedesktopOrgXml));
// }
m_nameMimeTypeMap.clear();
diff --git a/src/plugins/bookmarks/bookmark.cpp b/src/plugins/bookmarks/bookmark.cpp
index dd8f71fb03..e35b702b8f 100644
--- a/src/plugins/bookmarks/bookmark.cpp
+++ b/src/plugins/bookmarks/bookmark.cpp
@@ -79,8 +79,9 @@ void Bookmark::move(int line)
void Bookmark::updateBlock(const QTextBlock &block)
{
- if (m_lineText != block.text()) {
- m_lineText = block.text();
+ const QString &lineText = block.text().trimmed();
+ if (m_lineText != lineText) {
+ m_lineText = lineText;
m_manager->updateBookmark(this);
}
}
diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp
index 3ced12e179..0977134fbd 100644
--- a/src/plugins/bookmarks/bookmarkmanager.cpp
+++ b/src/plugins/bookmarks/bookmarkmanager.cpp
@@ -198,7 +198,7 @@ void BookmarkDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
QString lineText = index.data(BookmarkManager::Note).toString().trimmed();
if (lineText.isEmpty())
- lineText = index.data(BookmarkManager::LineText).toString().trimmed();
+ lineText = index.data(BookmarkManager::LineText).toString();
painter->drawText(6, opt.rect.top() + fm.ascent() + fm.height() + 6, lineText);
diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp
index afb8a62d53..a197345419 100644
--- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp
@@ -61,7 +61,7 @@ namespace Internal {
// CMakeEditor
//
-QString CMakeEditor::contextHelpId() const
+void CMakeEditor::contextHelpId(const HelpIdCallback &callback) const
{
int pos = position();
@@ -71,8 +71,10 @@ QString CMakeEditor::contextHelpId() const
if (pos < 0)
break;
chr = characterAt(pos);
- if (chr == QLatin1Char('('))
- return QString();
+ if (chr == QLatin1Char('(')) {
+ callback(QString());
+ return;
+ }
} while (chr.unicode() != QChar::ParagraphSeparator);
++pos;
@@ -95,11 +97,13 @@ QString CMakeEditor::contextHelpId() const
}
// Not a command
- if (chr != QLatin1Char('('))
- return QString();
+ if (chr != QLatin1Char('(')) {
+ callback(QString());
+ return;
+ }
QString command = textAt(begin, end - begin).toLower();
- return QLatin1String("command/") + command;
+ callback(QLatin1String("command/") + command);
}
//
diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.h b/src/plugins/cmakeprojectmanager/cmakeeditor.h
index 93151db547..364fb48c02 100644
--- a/src/plugins/cmakeprojectmanager/cmakeeditor.h
+++ b/src/plugins/cmakeprojectmanager/cmakeeditor.h
@@ -38,7 +38,7 @@ class CMakeEditor : public TextEditor::BaseTextEditor
Q_OBJECT
public:
- QString contextHelpId() const override;
+ void contextHelpId(const HelpIdCallback &callback) const override;
friend class CMakeEditorWidget;
};
diff --git a/src/plugins/coreplugin/icontext.h b/src/plugins/coreplugin/icontext.h
index 0baf9eee23..486223c664 100644
--- a/src/plugins/coreplugin/icontext.h
+++ b/src/plugins/coreplugin/icontext.h
@@ -33,6 +33,8 @@
#include <QPointer>
#include <QWidget>
+#include <functional>
+
namespace Core {
class CORE_EXPORT Context
@@ -71,7 +73,8 @@ public:
virtual Context context() const { return m_context; }
virtual QWidget *widget() const { return m_widget; }
- virtual QString contextHelpId() const { return m_contextHelpId; }
+ using HelpIdCallback = std::function<void(const QString &id)>;
+ virtual void contextHelpId(const HelpIdCallback &callback) const { callback(m_contextHelpId); }
virtual void setContext(const Context &context) { m_context = context; }
virtual void setWidget(QWidget *widget) { m_widget = widget; }
diff --git a/src/plugins/designer/designercontext.cpp b/src/plugins/designer/designercontext.cpp
index f9407149d3..bff77559b1 100644
--- a/src/plugins/designer/designercontext.cpp
+++ b/src/plugins/designer/designercontext.cpp
@@ -45,10 +45,10 @@ DesignerContext::DesignerContext(const Core::Context &context,
setWidget(widget);
}
-QString DesignerContext::contextHelpId() const
+void DesignerContext::contextHelpId(const HelpIdCallback &callback) const
{
const QDesignerFormEditorInterface *core = FormEditorW::designerEditor();
- return core->integration()->contextHelpId();
+ callback(core->integration()->contextHelpId());
}
} // namespace Internal
diff --git a/src/plugins/designer/designercontext.h b/src/plugins/designer/designercontext.h
index 5802d2cf3b..3259951e7d 100644
--- a/src/plugins/designer/designercontext.h
+++ b/src/plugins/designer/designercontext.h
@@ -37,7 +37,7 @@ public:
QWidget *widget,
QObject *parent = nullptr);
- QString contextHelpId() const override;
+ void contextHelpId(const HelpIdCallback &callback) const override;
};
} // namespace Internal
diff --git a/src/plugins/diffeditor/diffeditorcontroller.cpp b/src/plugins/diffeditor/diffeditorcontroller.cpp
index f75f462005..c64da4562d 100644
--- a/src/plugins/diffeditor/diffeditorcontroller.cpp
+++ b/src/plugins/diffeditor/diffeditorcontroller.cpp
@@ -71,9 +71,10 @@ QString DiffEditorController::revisionFromDescription() const
return m_document->description().mid(7, 12);
}
-QString DiffEditorController::makePatch(bool revert, bool addPrefix) const
+QString DiffEditorController::makePatch(PatchOptions options) const
{
- return m_document->makePatch(m_diffFileIndex, m_chunkIndex, revert, addPrefix);
+ return m_document->makePatch(m_diffFileIndex, m_chunkIndex,
+ options & Revert, options & AddPrefix);
}
Core::IDocument *DiffEditorController::findOrCreateDocument(const QString &vcsId,
diff --git a/src/plugins/diffeditor/diffeditorcontroller.h b/src/plugins/diffeditor/diffeditorcontroller.h
index b6c8fd77a6..ebe1151ce1 100644
--- a/src/plugins/diffeditor/diffeditorcontroller.h
+++ b/src/plugins/diffeditor/diffeditorcontroller.h
@@ -53,7 +53,13 @@ public:
QString revisionFromDescription() const;
- QString makePatch(bool revert, bool addPrefix = false) const;
+ enum PatchOption {
+ NoOption = 0,
+ Revert = 1,
+ AddPrefix = 2
+ };
+ Q_DECLARE_FLAGS(PatchOptions, PatchOption)
+ QString makePatch(PatchOptions options) const;
static Core::IDocument *findOrCreateDocument(const QString &vcsId,
const QString &displayName);
diff --git a/src/plugins/diffeditor/diffeditorplugin.cpp b/src/plugins/diffeditor/diffeditorplugin.cpp
index 6d6aa0715c..c3bfbdb094 100644
--- a/src/plugins/diffeditor/diffeditorplugin.cpp
+++ b/src/plugins/diffeditor/diffeditorplugin.cpp
@@ -618,8 +618,6 @@ static inline QString _(const char *string) { return QString::fromLatin1(string)
void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
{
QTest::addColumn<ChunkData>("sourceChunk");
- QTest::addColumn<QString>("leftFileName");
- QTest::addColumn<QString>("rightFileName");
QTest::addColumn<bool>("lastChunk");
QTest::addColumn<QString>("patchText");
@@ -635,8 +633,6 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
"-ABCD\n"
" EFGH\n";
QTest::newRow("Simple not a last chunk") << chunk
- << fileName
- << fileName
<< false
<< patchText;
@@ -649,8 +645,6 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
"\\ No newline at end of file\n";
QTest::newRow("Simple last chunk") << chunk
- << fileName
- << fileName
<< true
<< patchText;
@@ -666,8 +660,6 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
"\\ No newline at end of file\n";
QTest::newRow("EOL in last line removed") << chunk
- << fileName
- << fileName
<< true
<< patchText;
@@ -679,8 +671,6 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
"-\n";
QTest::newRow("Last empty line removed") << chunk
- << fileName
- << fileName
<< false
<< patchText;
@@ -698,8 +688,6 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
"\\ No newline at end of file\n";
QTest::newRow("Two last EOLs removed") << chunk
- << fileName
- << fileName
<< true
<< patchText;
@@ -715,8 +703,6 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
"+ABCD\n";
QTest::newRow("EOL to last line added") << chunk
- << fileName
- << fileName
<< true
<< patchText;
@@ -728,8 +714,6 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
"+\n";
QTest::newRow("Last empty line added") << chunk
- << fileName
- << fileName
<< false
<< patchText;
@@ -743,8 +727,6 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
"+EFGH\n";
QTest::newRow("Last line with a newline modified") << chunk
- << fileName
- << fileName
<< false
<< patchText;
@@ -759,8 +741,6 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
"+EFGH\n"
" \n";
QTest::newRow("Not a last line with a newline modified") << chunk
- << fileName
- << fileName
<< false
<< patchText;
@@ -776,8 +756,6 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
"\\ No newline at end of file\n";
QTest::newRow("Last line without a newline modified") << chunk
- << fileName
- << fileName
<< true
<< patchText;
@@ -788,8 +766,6 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
"-ABCD\n"
"+EFGH\n";
QTest::newRow("Not a last line without a newline modified") << chunk
- << fileName
- << fileName
<< false
<< patchText;
@@ -807,8 +783,6 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
QTest::newRow("Last but one line modified, last line without a newline")
<< chunk
- << fileName
- << fileName
<< true
<< patchText;
@@ -822,8 +796,6 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
QTest::newRow("Last but one line modified, last line with a newline")
<< chunk
- << fileName
- << fileName
<< false
<< patchText;
@@ -842,8 +814,6 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
QTest::newRow("Blank line followed by No newline")
<< chunk
- << fileName
- << fileName
<< true
<< patchText;
}
@@ -851,12 +821,11 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch_data()
void DiffEditor::Internal::DiffEditorPlugin::testMakePatch()
{
QFETCH(ChunkData, sourceChunk);
- QFETCH(QString, leftFileName);
- QFETCH(QString, rightFileName);
QFETCH(bool, lastChunk);
QFETCH(QString, patchText);
- const QString result = DiffUtils::makePatch(sourceChunk, leftFileName, rightFileName, lastChunk);
+ const QString fileName = "a.txt";
+ const QString result = DiffUtils::makePatch(sourceChunk, fileName, fileName, lastChunk);
QCOMPARE(result, patchText);
@@ -867,8 +836,8 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch()
QCOMPARE(resultList.count(), 1);
for (int i = 0; i < resultList.count(); i++) {
const FileData &resultFileData = resultList.at(i);
- QCOMPARE(resultFileData.leftFileInfo.fileName, leftFileName);
- QCOMPARE(resultFileData.rightFileInfo.fileName, rightFileName);
+ QCOMPARE(resultFileData.leftFileInfo.fileName, fileName);
+ QCOMPARE(resultFileData.rightFileInfo.fileName, fileName);
QCOMPARE(resultFileData.chunks.count(), 1);
for (int j = 0; j < resultFileData.chunks.count(); j++) {
const ChunkData &resultChunkData = resultFileData.chunks.at(j);
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index a5111435af..5e7ee1e226 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -617,7 +617,8 @@ void GitClient::slotStageChunk()
if (m_contextController.isNull())
return;
- const QString patch = m_contextController->makePatch(false, true);
+ DiffEditorController::PatchOptions options = DiffEditorController::AddPrefix;
+ const QString patch = m_contextController->makePatch(options);
if (patch.isEmpty())
return;
@@ -629,7 +630,9 @@ void GitClient::slotUnstageChunk()
if (m_contextController.isNull())
return;
- const QString patch = m_contextController->makePatch(true, true);
+ DiffEditorController::PatchOptions options = DiffEditorController::AddPrefix;
+ options |= DiffEditorController::Revert;
+ const QString patch = m_contextController->makePatch(options);
if (patch.isEmpty())
return;
diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp
index 2057059483..de85ae9968 100644
--- a/src/plugins/help/helpplugin.cpp
+++ b/src/plugins/help/helpplugin.cpp
@@ -194,7 +194,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
Context(kToolTipHelpContext, Core::Constants::C_GLOBAL));
ActionManager::actionContainer(Core::Constants::M_HELP)->addAction(cmd, Core::Constants::G_HELP_HELP);
cmd->setDefaultKeySequence(QKeySequence(Qt::Key_F1));
- connect(action, &QAction::triggered, this, &HelpPlugin::showContextHelp);
+ connect(action, &QAction::triggered, this, &HelpPlugin::requestContextHelp);
action = new QAction(tr("Technical Support"), this);
cmd = ActionManager::registerAction(action, "Help.TechSupport");
@@ -349,6 +349,7 @@ HelpViewer *HelpPlugin::externalHelpViewer()
if (m_externalWindow)
return m_externalWindow->currentViewer();
doSetupIfNeeded();
+ // Deletion for this widget is taken care of in HelpPlugin::aboutToShutdown().
m_externalWindow = createHelpWidget(Context(Constants::C_HELP_EXTERNAL),
HelpWidget::ExternalWindow);
if (m_externalWindowState.isNull()) {
@@ -535,6 +536,8 @@ void HelpPlugin::showInHelpViewer(const QUrl &url, HelpViewer *viewer)
viewer->stop();
viewer->setSource(url);
ICore::raiseWindow(viewer);
+ // Show the parent top-level-widget in case it was closed previously.
+ viewer->window()->show();
}
HelpViewer *HelpPlugin::viewerForContextHelp()
@@ -570,14 +573,19 @@ static QUrl findBestLink(const QMap<QString, QUrl> &links, QString *highlightId)
return source;
}
-void HelpPlugin::showContextHelp()
+void HelpPlugin::requestContextHelp()
{
// Find out what to show
QString contextHelpId = Utils::ToolTip::contextHelpId();
IContext *context = ICore::currentContextObject();
if (contextHelpId.isEmpty() && context)
- contextHelpId = context->contextHelpId();
+ context->contextHelpId([this](const QString &id) { showContextHelp(id); });
+ else
+ showContextHelp(contextHelpId);
+}
+void HelpPlugin::showContextHelp(const QString &contextHelpId)
+{
// get the viewer after getting the help id,
// because a new window might be opened and therefore focus be moved
HelpViewer *viewer = viewerForContextHelp();
diff --git a/src/plugins/help/helpplugin.h b/src/plugins/help/helpplugin.h
index 52eb5a7370..5fdcfa8715 100644
--- a/src/plugins/help/helpplugin.h
+++ b/src/plugins/help/helpplugin.h
@@ -76,7 +76,8 @@ public:
private:
void modeChanged(Core::Id mode, Core::Id old);
- void showContextHelp();
+ void requestContextHelp();
+ void showContextHelp(const QString &contextHelpId);
void activateIndex();
void activateContents();
diff --git a/src/plugins/help/helpwidget.cpp b/src/plugins/help/helpwidget.cpp
index feb6c3ffa4..79336520f0 100644
--- a/src/plugins/help/helpwidget.cpp
+++ b/src/plugins/help/helpwidget.cpp
@@ -127,7 +127,6 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
static int windowId = 0;
Core::ICore::registerWindow(this,
Core::Context(Core::Id("Help.Window.").withSuffix(++windowId)));
- setAttribute(Qt::WA_DeleteOnClose);
setAttribute(Qt::WA_QuitOnClose, false); // don't prevent Qt Creator from closing
}
if (style != SideBarWidget) {
diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp
index 012f1162ad..059261c3a2 100644
--- a/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp
@@ -334,12 +334,12 @@ double FormEditorWidget::containerPadding() const
}
-QString FormEditorWidget::contextHelpId() const
+void FormEditorWidget::contextHelpId(const Core::IContext::HelpIdCallback &callback) const
{
if (m_formEditorView)
- return m_formEditorView->contextHelpId();
-
- return QString();
+ m_formEditorView->contextHelpId(callback);
+ else
+ callback(QString());
}
void FormEditorWidget::setRootItemRect(const QRectF &rect)
diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorwidget.h b/src/plugins/qmldesigner/components/formeditor/formeditorwidget.h
index 261816ddff..96d354afbb 100644
--- a/src/plugins/qmldesigner/components/formeditor/formeditorwidget.h
+++ b/src/plugins/qmldesigner/components/formeditor/formeditorwidget.h
@@ -26,6 +26,8 @@
#include <documentwarningwidget.h>
+#include <coreplugin/icontext.h>
+
#include <QWidget>
#include <QPointer>
@@ -62,7 +64,7 @@ public:
double spacing() const;
double containerPadding() const;
- QString contextHelpId() const;
+ void contextHelpId(const Core::IContext::HelpIdCallback &callback) const;
void setRootItemRect(const QRectF &rect);
QRectF rootItemRect() const;
diff --git a/src/plugins/qmldesigner/components/integration/designdocument.cpp b/src/plugins/qmldesigner/components/integration/designdocument.cpp
index 2235e984a1..068915d13c 100644
--- a/src/plugins/qmldesigner/components/integration/designdocument.cpp
+++ b/src/plugins/qmldesigner/components/integration/designdocument.cpp
@@ -651,12 +651,12 @@ void DesignDocument::updateCurrentProject()
viewManager().setNodeInstanceViewProject(currentProject);
}
-QString DesignDocument::contextHelpId() const
+void DesignDocument::contextHelpId(const Core::IContext::HelpIdCallback &callback) const
{
if (view())
- return view()->contextHelpId();
-
- return QString();
+ view()->contextHelpId(callback);
+ else
+ callback(QString());
}
} // namespace QmlDesigner
diff --git a/src/plugins/qmldesigner/components/integration/designdocument.h b/src/plugins/qmldesigner/components/integration/designdocument.h
index e4048dae26..a7f657ff30 100644
--- a/src/plugins/qmldesigner/components/integration/designdocument.h
+++ b/src/plugins/qmldesigner/components/integration/designdocument.h
@@ -31,6 +31,8 @@
#include <componenttextmodifier.h>
#include <subcomponentmanager.h>
+#include <coreplugin/icontext.h>
+
#include <QObject>
#include <QString>
@@ -75,7 +77,7 @@ public:
Model *currentModel() const;
Model *documentModel() const;
- QString contextHelpId() const;
+ void contextHelpId(const Core::IContext::HelpIdCallback &callback) const;
QList<DocumentMessage> qmlParseWarnings() const;
bool hasQmlParseWarnings() const;
QList<DocumentMessage> qmlParseErrors() const;
diff --git a/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp b/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp
index 6f7995a185..6926f7a9b3 100644
--- a/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp
+++ b/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp
@@ -130,12 +130,12 @@ QList<QToolButton *> NavigatorWidget::createToolBarWidgets()
return buttons;
}
-QString NavigatorWidget::contextHelpId() const
+void NavigatorWidget::contextHelpId(const Core::IContext::HelpIdCallback &callback) const
{
if (navigatorView())
- return navigatorView()->contextHelpId();
-
- return QString();
+ navigatorView()->contextHelpId(callback);
+ else
+ callback(QString());
}
NavigatorView *NavigatorWidget::navigatorView() const
diff --git a/src/plugins/qmldesigner/components/navigator/navigatorwidget.h b/src/plugins/qmldesigner/components/navigator/navigatorwidget.h
index 45e8b19c9b..95f1643b84 100644
--- a/src/plugins/qmldesigner/components/navigator/navigatorwidget.h
+++ b/src/plugins/qmldesigner/components/navigator/navigatorwidget.h
@@ -25,6 +25,8 @@
#pragma once
+#include <coreplugin/icontext.h>
+
#include <QFrame>
#include <QPointer>
@@ -46,7 +48,7 @@ public:
void setTreeModel(QAbstractItemModel *model);
QTreeView *treeView() const;
QList<QToolButton *> createToolBarWidgets();
- QString contextHelpId() const;
+ void contextHelpId(const Core::IContext::HelpIdCallback &callback) const;
signals:
void leftButtonClicked();
diff --git a/src/plugins/qmldesigner/components/texteditor/texteditorview.cpp b/src/plugins/qmldesigner/components/texteditor/texteditorview.cpp
index 31fb93a03d..495f6762ca 100644
--- a/src/plugins/qmldesigner/components/texteditor/texteditorview.cpp
+++ b/src/plugins/qmldesigner/components/texteditor/texteditorview.cpp
@@ -150,19 +150,17 @@ WidgetInfo TextEditorView::widgetInfo()
return createWidgetInfo(m_widget.get(), 0, "TextEditor", WidgetInfo::CentralPane, 0, tr("Text Editor"), DesignerWidgetFlags::IgnoreErrors);
}
-QString TextEditorView::contextHelpId() const
+void TextEditorView::contextHelpId(const Core::IContext::HelpIdCallback &callback) const
{
- return AbstractView::contextHelpId();
+ AbstractView::contextHelpId(callback);
}
-QString TextEditorView::qmlJSEditorHelpId() const
+void TextEditorView::qmlJSEditorHelpId(const Core::IContext::HelpIdCallback &callback) const
{
- if (m_widget->textEditor()) {
- QString contextHelpId = m_widget->textEditor()->contextHelpId();
- if (!contextHelpId.isEmpty())
- return m_widget->textEditor()->contextHelpId();
- }
- return QString();
+ if (m_widget->textEditor())
+ m_widget->textEditor()->contextHelpId(callback);
+ else
+ callback(QString());
}
void TextEditorView::nodeIdChanged(const ModelNode& /*node*/, const QString &/*newId*/, const QString &/*oldId*/)
diff --git a/src/plugins/qmldesigner/components/texteditor/texteditorview.h b/src/plugins/qmldesigner/components/texteditor/texteditorview.h
index 01ac15f219..ea7766115a 100644
--- a/src/plugins/qmldesigner/components/texteditor/texteditorview.h
+++ b/src/plugins/qmldesigner/components/texteditor/texteditorview.h
@@ -24,6 +24,8 @@
****************************************************************************/
#pragma once
+#include <coreplugin/icontext.h>
+
#include <abstractview.h>
#include <memory>
@@ -67,9 +69,9 @@ public:
// TextEditorView
WidgetInfo widgetInfo() override;
- QString contextHelpId() const override;
+ void contextHelpId(const Core::IContext::HelpIdCallback &callback) const override;
- QString qmlJSEditorHelpId() const;
+ void qmlJSEditorHelpId(const Core::IContext::HelpIdCallback &callback) const;
TextEditor::BaseTextEditor *textEditor();
diff --git a/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp b/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp
index f46df03687..8c0e715ba9 100644
--- a/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp
+++ b/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp
@@ -94,9 +94,9 @@ void TextEditorWidget::setTextEditor(TextEditor::BaseTextEditor *textEditor)
oldEditor->deleteLater();
}
-QString TextEditorWidget::contextHelpId() const
+void TextEditorWidget::contextHelpId(const Core::IContext::HelpIdCallback &callback) const
{
- return m_textEditorView->contextHelpId();
+ m_textEditorView->contextHelpId(callback);
}
void TextEditorWidget::updateSelectionByCursorPosition()
diff --git a/src/plugins/qmldesigner/components/texteditor/texteditorwidget.h b/src/plugins/qmldesigner/components/texteditor/texteditorwidget.h
index 7ab245adbb..5dceef8c02 100644
--- a/src/plugins/qmldesigner/components/texteditor/texteditorwidget.h
+++ b/src/plugins/qmldesigner/components/texteditor/texteditorwidget.h
@@ -50,7 +50,7 @@ public:
return m_textEditor.get();
}
- QString contextHelpId() const;
+ void contextHelpId(const Core::IContext::HelpIdCallback &callback) const;
void jumpTextCursorToSelectedModelNode();
void gotoCursorPosition(int line, int column);
diff --git a/src/plugins/qmldesigner/designercore/include/abstractview.h b/src/plugins/qmldesigner/designercore/include/abstractview.h
index 8b085f9137..a55d874a52 100644
--- a/src/plugins/qmldesigner/designercore/include/abstractview.h
+++ b/src/plugins/qmldesigner/designercore/include/abstractview.h
@@ -34,6 +34,8 @@
#include <rewritertransaction.h>
#include <commondefines.h>
+#include <coreplugin/icontext.h>
+
#include <QObject>
#include <QPointer>
@@ -255,7 +257,7 @@ public:
virtual bool hasWidget() const;
virtual WidgetInfo widgetInfo();
- virtual QString contextHelpId() const;
+ virtual void contextHelpId(const Core::IContext::HelpIdCallback &callback) const;
void activateTimelineRecording(const ModelNode &mutator);
void deactivateTimelineRecording();
diff --git a/src/plugins/qmldesigner/designercore/include/viewmanager.h b/src/plugins/qmldesigner/designercore/include/viewmanager.h
index b1a8077202..d6123d73d5 100644
--- a/src/plugins/qmldesigner/designercore/include/viewmanager.h
+++ b/src/plugins/qmldesigner/designercore/include/viewmanager.h
@@ -95,7 +95,7 @@ public:
void toggleStatesViewExpanded();
- QString qmlJSEditorHelpId() const;
+ void qmlJSEditorHelpId(const Core::IContext::HelpIdCallback &callback) const;
DesignDocument *currentDesignDocument() const;
private: // functions
diff --git a/src/plugins/qmldesigner/designercore/model/abstractview.cpp b/src/plugins/qmldesigner/designercore/model/abstractview.cpp
index 36875422e0..1649a17a4a 100644
--- a/src/plugins/qmldesigner/designercore/model/abstractview.cpp
+++ b/src/plugins/qmldesigner/designercore/model/abstractview.cpp
@@ -561,14 +561,13 @@ WidgetInfo AbstractView::widgetInfo()
return createWidgetInfo();
}
-QString AbstractView::contextHelpId() const
+void AbstractView::contextHelpId(const Core::IContext::HelpIdCallback &callback) const
{
- QString helpId;
-
#ifndef QMLDESIGNER_TEST
- helpId = QmlDesignerPlugin::instance()->viewManager().qmlJSEditorHelpId();
+ QmlDesignerPlugin::instance()->viewManager().qmlJSEditorHelpId(callback);
+#else
+ callback(QString());
#endif
- return helpId;
}
void AbstractView::activateTimelineRecording(const ModelNode &mutator)
diff --git a/src/plugins/qmldesigner/designercore/model/viewmanager.cpp b/src/plugins/qmldesigner/designercore/model/viewmanager.cpp
index 32e1398bd3..16078ecb73 100644
--- a/src/plugins/qmldesigner/designercore/model/viewmanager.cpp
+++ b/src/plugins/qmldesigner/designercore/model/viewmanager.cpp
@@ -411,9 +411,9 @@ void ViewManager::toggleStatesViewExpanded()
d->statesEditorView.toggleStatesViewExpanded();
}
-QString ViewManager::qmlJSEditorHelpId() const
+void ViewManager::qmlJSEditorHelpId(const Core::IContext::HelpIdCallback &callback) const
{
- return d->textEditorView.qmlJSEditorHelpId();
+ d->textEditorView.qmlJSEditorHelpId(callback);
}
Model *ViewManager::currentModel() const
diff --git a/src/plugins/qmldesigner/designmodecontext.cpp b/src/plugins/qmldesigner/designmodecontext.cpp
index 82b583e827..42d0f04bf6 100644
--- a/src/plugins/qmldesigner/designmodecontext.cpp
+++ b/src/plugins/qmldesigner/designmodecontext.cpp
@@ -40,9 +40,9 @@ DesignModeContext::DesignModeContext(QWidget *widget)
setContext(Core::Context(Constants::C_QMLDESIGNER, Constants::C_QT_QUICK_TOOLS_MENU));
}
-QString DesignModeContext::contextHelpId() const
+void DesignModeContext::contextHelpId(const HelpIdCallback &callback) const
{
- return qobject_cast<DesignModeWidget *>(m_widget)->contextHelpId();
+ qobject_cast<DesignModeWidget *>(m_widget)->contextHelpId(callback);
}
FormEditorContext::FormEditorContext(QWidget *widget)
@@ -52,9 +52,9 @@ FormEditorContext::FormEditorContext(QWidget *widget)
setContext(Core::Context(Constants::C_QMLFORMEDITOR, Constants::C_QT_QUICK_TOOLS_MENU));
}
-QString FormEditorContext::contextHelpId() const
+void FormEditorContext::contextHelpId(const HelpIdCallback &callback) const
{
- return qobject_cast<FormEditorWidget *>(m_widget)->contextHelpId();
+ qobject_cast<FormEditorWidget *>(m_widget)->contextHelpId(callback);
}
NavigatorContext::NavigatorContext(QWidget *widget)
@@ -64,9 +64,9 @@ NavigatorContext::NavigatorContext(QWidget *widget)
setContext(Core::Context(Constants::C_QMLNAVIGATOR, Constants::C_QT_QUICK_TOOLS_MENU));
}
-QString NavigatorContext::contextHelpId() const
+void NavigatorContext::contextHelpId(const HelpIdCallback &callback) const
{
- return qobject_cast<NavigatorWidget *>(m_widget)->contextHelpId();
+ qobject_cast<NavigatorWidget *>(m_widget)->contextHelpId(callback);
}
TextEditorContext::TextEditorContext(QWidget *widget)
@@ -76,9 +76,9 @@ TextEditorContext::TextEditorContext(QWidget *widget)
setContext(Core::Context(Constants::C_QMLTEXTEDITOR, Constants::C_QT_QUICK_TOOLS_MENU));
}
-QString TextEditorContext::contextHelpId() const
+void TextEditorContext::contextHelpId(const HelpIdCallback &callback) const
{
- return qobject_cast<TextEditorWidget *>(m_widget)->contextHelpId();
+ qobject_cast<TextEditorWidget *>(m_widget)->contextHelpId(callback);
}
}
diff --git a/src/plugins/qmldesigner/designmodecontext.h b/src/plugins/qmldesigner/designmodecontext.h
index 0f7e1ee794..aa3fc142d8 100644
--- a/src/plugins/qmldesigner/designmodecontext.h
+++ b/src/plugins/qmldesigner/designmodecontext.h
@@ -39,7 +39,7 @@ class DesignModeContext : public Core::IContext
public:
DesignModeContext(QWidget *widget);
- QString contextHelpId() const;
+ void contextHelpId(const Core::IContext::HelpIdCallback &callback) const;
};
class FormEditorContext : public Core::IContext
@@ -48,7 +48,7 @@ class FormEditorContext : public Core::IContext
public:
FormEditorContext(QWidget *widget);
- QString contextHelpId() const;
+ void contextHelpId(const Core::IContext::HelpIdCallback &callback) const;
};
class NavigatorContext : public Core::IContext
@@ -57,7 +57,7 @@ class NavigatorContext : public Core::IContext
public:
NavigatorContext(QWidget *widget);
- QString contextHelpId() const;
+ void contextHelpId(const Core::IContext::HelpIdCallback &callback) const;
};
class TextEditorContext : public Core::IContext
@@ -66,7 +66,7 @@ class TextEditorContext : public Core::IContext
public:
TextEditorContext(QWidget *widget);
- QString contextHelpId() const;
+ void contextHelpId(const Core::IContext::HelpIdCallback &callback) const;
};
}
diff --git a/src/plugins/qmldesigner/designmodewidget.cpp b/src/plugins/qmldesigner/designmodewidget.cpp
index 216ad00074..cbe845240c 100644
--- a/src/plugins/qmldesigner/designmodewidget.cpp
+++ b/src/plugins/qmldesigner/designmodewidget.cpp
@@ -531,11 +531,12 @@ void DesignModeWidget::showInternalTextEditor()
m_centralTabWidget->switchTo(viewManager().widget("TextEditor"));
}
-QString DesignModeWidget::contextHelpId() const
+void DesignModeWidget::contextHelpId(const Core::IContext::HelpIdCallback &callback) const
{
if (currentDesignDocument())
- return currentDesignDocument()->contextHelpId();
- return QString();
+ currentDesignDocument()->contextHelpId(callback);
+ else
+ callback(QString());
}
void DesignModeWidget::initialize()
diff --git a/src/plugins/qmldesigner/designmodewidget.h b/src/plugins/qmldesigner/designmodewidget.h
index 50a8fd6461..ce585a381b 100644
--- a/src/plugins/qmldesigner/designmodewidget.h
+++ b/src/plugins/qmldesigner/designmodewidget.h
@@ -62,7 +62,7 @@ public:
explicit DesignModeWidget(QWidget *parent = 0);
~DesignModeWidget();
- QString contextHelpId() const;
+ void contextHelpId(const Core::IContext::HelpIdCallback &callback) const;
void initialize();
diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp
index a688299530..4dab938907 100644
--- a/src/plugins/qmlprofiler/qmlprofilertool.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp
@@ -373,10 +373,16 @@ void QmlProfilerTool::finalizeRunControl(QmlProfilerRunner *runWorker)
}
}
- connect(runControl, &RunControl::stopped, this, [this, runControl] {
+ auto handleStop = [this, runControl]() {
d->m_toolBusy = false;
updateRunActions();
disconnect(d->m_stopAction, &QAction::triggered, runControl, &RunControl::initiateStop);
+ };
+
+ connect(runControl, &RunControl::stopped, this, handleStop);
+ connect(runControl, &RunControl::finished, this, [this, runControl, handleStop] {
+ if (d->m_toolBusy)
+ handleStop();
});
connect(d->m_stopAction, &QAction::triggered, runControl, &RunControl::initiateStop);
diff --git a/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp b/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp
index f596169cf1..d268045066 100644
--- a/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp
+++ b/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp
@@ -50,6 +50,7 @@ void QmlProfilerToolTest::testAttachToWaitingApplication()
connect(&server, &QTcpServer::newConnection, this, [&]() {
connection.reset(server.nextPendingConnection());
fakeDebugServer(connection.data());
+ server.close();
});
QTimer timer;
@@ -68,6 +69,7 @@ void QmlProfilerToolTest::testAttachToWaitingApplication()
QTRY_VERIFY(connection);
QTRY_VERIFY(runControl->isRunning());
+ QTRY_VERIFY(profilerTool.clientManager()->isConnected());
connection.reset();
QTRY_VERIFY(runControl->isStopped());
diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp
index 2c6403df22..505c4325ae 100644
--- a/src/plugins/texteditor/texteditor.cpp
+++ b/src/plugins/texteditor/texteditor.cpp
@@ -7913,9 +7913,9 @@ void TextEditorWidgetPrivate::updateCursorPosition()
q->ensureCursorVisible();
}
-QString BaseTextEditor::contextHelpId() const
+void BaseTextEditor::contextHelpId(const HelpIdCallback &callback) const
{
- return editorWidget()->contextHelpId();
+ editorWidget()->contextHelpId(callback);
}
void BaseTextEditor::setContextHelpId(const QString &id)
@@ -7924,11 +7924,11 @@ void BaseTextEditor::setContextHelpId(const QString &id)
editorWidget()->setContextHelpId(id);
}
-QString TextEditorWidget::contextHelpId()
+void TextEditorWidget::contextHelpId(const IContext::HelpIdCallback &callback)
{
if (d->m_contextHelpId.isEmpty() && !d->m_hoverHandlers.isEmpty())
d->m_contextHelpId = d->m_hoverHandlers.first()->contextHelpId(this, textCursor().position());
- return d->m_contextHelpId;
+ callback(d->m_contextHelpId);
}
void TextEditorWidget::setContextHelpId(const QString &id)
diff --git a/src/plugins/texteditor/texteditor.h b/src/plugins/texteditor/texteditor.h
index c98a84df00..ff7193b025 100644
--- a/src/plugins/texteditor/texteditor.h
+++ b/src/plugins/texteditor/texteditor.h
@@ -129,7 +129,7 @@ public:
bool restoreState(const QByteArray &state) override;
QWidget *toolBar() override;
- QString contextHelpId() const override; // from IContext
+ void contextHelpId(const HelpIdCallback &callback) const override; // from IContext
void setContextHelpId(const QString &id) override;
int currentLine() const override;
@@ -533,7 +533,7 @@ public:
QChar characterAt(int pos) const;
QString textAt(int from, int to) const;
- QString contextHelpId();
+ void contextHelpId(const Core::IContext::HelpIdCallback &callback);
void setContextHelpId(const QString &id);
static TextEditorWidget *currentTextEditorWidget();
diff --git a/src/tools/clangbackend/source/clangcodemodelserver.cpp b/src/tools/clangbackend/source/clangcodemodelserver.cpp
index 609ac1da85..d3e873d732 100644
--- a/src/tools/clangbackend/source/clangcodemodelserver.cpp
+++ b/src/tools/clangbackend/source/clangcodemodelserver.cpp
@@ -201,7 +201,7 @@ void ClangCodeModelServer::registerUnsavedFilesForEditor(const RegisterUnsavedFi
void ClangCodeModelServer::unregisterUnsavedFilesForEditor(const UnregisterUnsavedFilesForEditorMessage &message)
{
- qWarning() << "##### registerUnsavedFilesForEditor";
+ qCDebug(serverLog) << "########## registerUnsavedFilesForEditor";
TIME_SCOPE_DURATION("ClangCodeModelServer::unregisterUnsavedFilesForEditor");
try {
@@ -214,7 +214,7 @@ void ClangCodeModelServer::unregisterUnsavedFilesForEditor(const UnregisterUnsav
void ClangCodeModelServer::completeCode(const ClangBackEnd::CompleteCodeMessage &message)
{
- qWarning() << "##### completeCode";
+ qCDebug(serverLog) << "########## completeCode";
TIME_SCOPE_DURATION("ClangCodeModelServer::completeCode");
try {
diff --git a/tests/unit/unittest/clangtooltipinfo-test.cpp b/tests/unit/unittest/clangtooltipinfo-test.cpp
index 4f6c980649..acaa3e18d7 100644
--- a/tests/unit/unittest/clangtooltipinfo-test.cpp
+++ b/tests/unit/unittest/clangtooltipinfo-test.cpp
@@ -289,7 +289,8 @@ TEST_F(ToolTipInfo, TemplateTypeFromNonParameter)
TEST_F(ToolTipInfo, IncludeDirective)
{
- ::ToolTipInfo expected(Utf8StringLiteral(TESTDATA_DIR"/tooltipinfo.h"));
+ ::ToolTipInfo expected(
+ QDir::toNativeSeparators(Utf8StringLiteral(TESTDATA_DIR "/tooltipinfo.h")));
expected.setQdocIdCandidates({Utf8StringLiteral("tooltipinfo.h")});
expected.setQdocMark(Utf8StringLiteral("tooltipinfo.h"));
expected.setQdocCategory(::ToolTipInfo::Brief);