From b9924e2b4b3544ea494925576a421cd9a5fce94f Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 13 Jun 2019 13:16:35 +0200 Subject: Fix perfresourcecounter test If qrand() generates a 0, the obtain() is ignored as that is the invalid ID. Change-Id: I608f2687a6ca9a40d905c665a3585bffc1ea5695 Reviewed-by: Christian Stenger --- src/plugins/perfprofiler/tests/perfresourcecounter_test.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/perfprofiler/tests/perfresourcecounter_test.cpp b/src/plugins/perfprofiler/tests/perfresourcecounter_test.cpp index 87d905c880..f242725c35 100644 --- a/src/plugins/perfprofiler/tests/perfresourcecounter_test.cpp +++ b/src/plugins/perfprofiler/tests/perfresourcecounter_test.cpp @@ -140,9 +140,10 @@ void PerfResourceCounterTest::testUnitSized() QList ids; for (int i = 0; i < 10000; ++i) { counter.request(1); - int id = qrand(); + const int id = qrand(); counter.obtain(id); - ids.append(id); + if (id != 0) // Otherwise it's the invalid ID and that means the allocation "failed". + ids.append(id); QCOMPARE(counter.currentTotal(), ids.length()); } QCOMPARE(sum(container), counter.currentTotal()); -- cgit v1.2.3 From e3690ad7ac6d749c8a489676163864f5abbf99d7 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 14 Jun 2019 15:11:57 +0200 Subject: ProjectTree: Fix crash when project has no rootProjectNode Fix a crash that is triggered by a project returning to a state where it has no rootProjectNode. This can happen when parsing fails and Creator should fall back to displaying the project name and its main project file as it does before any parsing had been done. Unfortunately the hasNode function returned false in this case, so the project model was never updated and the removed project nodes stuck around, triggering a crash. Change-Id: I7616e576773dc52fb6fdff39b9f0a7c7729eac71 Reviewed-by: hjk Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/projecttree.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plugins/projectexplorer/projecttree.cpp b/src/plugins/projectexplorer/projecttree.cpp index 27344989c2..5e853e6a78 100644 --- a/src/plugins/projectexplorer/projecttree.cpp +++ b/src/plugins/projectexplorer/projecttree.cpp @@ -393,9 +393,15 @@ void ProjectTree::applyTreeManager(FolderNode *folder) bool ProjectTree::hasNode(const Node *node) { return Utils::contains(SessionManager::projects(), [node](const Project *p) { - return p && p->rootProjectNode() && ( - p->containerNode() == node - || p->rootProjectNode()->findNode([node](const Node *n) { return n == node; })); + if (!p) + return false; + if (p->containerNode() == node) + return true; + // When parsing fails we have a living container node but no rootProjectNode. + ProjectNode *pn = p->rootProjectNode(); + if (!pn) + return false; + return pn->findNode([node](const Node *n) { return n == node; }) != nullptr; }); } -- cgit v1.2.3 From e8705deb1c038d79a47e84274b4c3fdc6d2275aa Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 17 Jun 2019 09:14:11 +0200 Subject: Fix display of keyboard shortcuts Was using wrong foreground color for the "no collision" case. Fix-up of 963dc84cc5d1e412344e3a0fbf4a476541da2d19 Fixes: QTCREATORBUG-22333 Change-Id: I5b4934b69bd9ff2002846ffda700673b6e1cab24 Reviewed-by: Friedemann Kleint --- src/plugins/coreplugin/dialogs/shortcutsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp index 191de4a412..675996881d 100644 --- a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp +++ b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp @@ -552,7 +552,7 @@ bool ShortcutSettingsWidget::markCollisions(ShortcutItem *item) } item->m_item->setForeground(2, hasCollision ? Utils::creatorTheme()->color(Utils::Theme::TextColorError) - : commandList()->palette().window()); + : commandList()->palette().windowText()); return hasCollision; } -- cgit v1.2.3 From 7d46060af011737caa2f673d601898abcd3a4e48 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 17 Jun 2019 12:04:47 +0200 Subject: Fix disabled close button in designer editor tool bar It was never actually updating when switching the editor. An update was just accidentally triggered when the designer plugin updated the editor XML when switching modes, which triggered an intermediate document change signal. Get rid of the separate code paths for setting the current editor for "standalone" editor tool bars and the tool bars in editor views, which implicitly corrects the update behavior in the former case. Fixes: QTCREATORBUG-22553 Change-Id: Ieb9f4b53600e1e1b66695ec86164628025df73f8 Reviewed-by: David Schulz --- src/plugins/coreplugin/editortoolbar.cpp | 15 ++++----------- src/plugins/coreplugin/editortoolbar.h | 1 - 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/plugins/coreplugin/editortoolbar.cpp b/src/plugins/coreplugin/editortoolbar.cpp index 28ed8a9acc..c23aaa49d2 100644 --- a/src/plugins/coreplugin/editortoolbar.cpp +++ b/src/plugins/coreplugin/editortoolbar.cpp @@ -298,8 +298,10 @@ void EditorToolBar::setToolbarCreationFlags(ToolbarCreationFlags flags) { d->m_isStandalone = flags & FlagsStandalone; if (d->m_isStandalone) { - connect(EditorManager::instance(), &EditorManager::currentEditorChanged, - this, &EditorToolBar::updateEditorListSelection); + connect(EditorManager::instance(), + &EditorManager::currentEditorChanged, + this, + &EditorToolBar::setCurrentEditor); disconnect(d->m_editorList, static_cast(&QComboBox::activated), this, &EditorToolBar::listSelectionActivated); @@ -330,15 +332,6 @@ void EditorToolBar::setCurrentEditor(IEditor *editor) updateDocumentStatus(document); } -void EditorToolBar::updateEditorListSelection(IEditor *newSelection) -{ - if (newSelection) { - const Utils::optional index = DocumentModel::rowOfDocument(newSelection->document()); - if (QTC_GUARD(index)) - d->m_editorList->setCurrentIndex(index.value()); - } -} - void EditorToolBar::changeActiveEditor(int row) { EditorManager::activateEditorForEntry(DocumentModel::entryAtRow(row)); diff --git a/src/plugins/coreplugin/editortoolbar.h b/src/plugins/coreplugin/editortoolbar.h index b8d7fad468..0d82e58303 100644 --- a/src/plugins/coreplugin/editortoolbar.h +++ b/src/plugins/coreplugin/editortoolbar.h @@ -105,7 +105,6 @@ private: void updateActionShortcuts(); void updateDocumentStatus(IDocument *document); - void updateEditorListSelection(IEditor *newSelection); void fillListContextMenu(QMenu *menu); void updateToolBar(QWidget *toolBar); -- cgit v1.2.3 From 5bcc70b34deb1dd590cca0c115511f3c6fa9f763 Mon Sep 17 00:00:00 2001 From: Michl Voznesensky Date: Sun, 28 Oct 2018 22:49:06 +0300 Subject: Fix bug for with redirect to general landing page Qt bug tracker. Now the redirection goes to the page creating the bug Fixes: QTCREATORBUG-18734 Change-Id: I49847edce7da6a993ded3a9538334279965b6eb4 Reviewed-by: Eike Ziller --- src/plugins/help/helpplugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 118efadd81..ee6261ee3b 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -293,7 +293,7 @@ HelpPluginPrivate::HelpPluginPrivate() cmd = ActionManager::registerAction(action, "Help.ReportBug"); ActionManager::actionContainer(Core::Constants::M_HELP)->addAction(cmd, Core::Constants::G_HELP_SUPPORT); connect(action, &QAction::triggered, this, [] { - QDesktopServices::openUrl(QUrl("https://bugreports.qt.io")); + QDesktopServices::openUrl(QUrl("https://bugreports.qt.io/secure/CreateIssue.jspa?pid=10512")); }); action = new QAction(HelpPlugin::tr("System Information..."), this); -- cgit v1.2.3 From a2cfa434683552f63699a70e9de2295a12f41eaa Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 17 Jun 2019 17:51:55 +0200 Subject: Fix expansion of %DATE% in license template If the format contains '/', that must be escaped to avoid the expander to interpret that as regexp style replacement. Task-number: QTCREATORBUG-22440 Change-Id: Iaa6c0ae0aa74a055a30b3c0413e325c497f9310f Reviewed-by: Tobias Hunger --- src/plugins/cpptools/cppfilesettingspage.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/plugins/cpptools/cppfilesettingspage.cpp b/src/plugins/cpptools/cppfilesettingspage.cpp index 187f5d5913..5ee5ef22cf 100644 --- a/src/plugins/cpptools/cppfilesettingspage.cpp +++ b/src/plugins/cpptools/cppfilesettingspage.cpp @@ -169,6 +169,7 @@ static bool keyWordReplacement(const QString &keyWord, const QChar ypsilon = QLatin1Char('y'); if (format.count(ypsilon) == 2) format.insert(format.indexOf(ypsilon), QString(2, ypsilon)); + format.replace('/', "\\/"); } *value = QString::fromLatin1("%{CurrentDate:") + format + QLatin1Char('}'); return true; @@ -193,7 +194,6 @@ static void parseLicenseTemplatePlaceholders(QString *t) { int pos = 0; const QChar placeHolder = QLatin1Char('%'); - bool isCompatibilityStyle = false; do { const int placeHolderPos = t->indexOf(placeHolder, pos); if (placeHolderPos == -1) @@ -208,7 +208,6 @@ static void parseLicenseTemplatePlaceholders(QString *t) const QString keyWord = t->mid(placeHolderPos, endPlaceHolderPos + 1 - placeHolderPos); QString replacement; if (keyWordReplacement(keyWord, &replacement)) { - isCompatibilityStyle = true; t->replace(placeHolderPos, keyWord.size(), replacement); pos = placeHolderPos + replacement.size(); } else { @@ -218,8 +217,6 @@ static void parseLicenseTemplatePlaceholders(QString *t) } } while (pos < t->size()); - if (isCompatibilityStyle) - t->replace(QLatin1Char('\\'), QLatin1String("\\\\")); } // Convenience that returns the formatted license template. -- cgit v1.2.3