forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.9' into 4.10
Change-Id: I6f1bc9381dc8c0ce8abc5a6c006087076d8fc1bc
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -295,8 +295,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, QOverload<int>::of(&QComboBox::activated),
|
||||
this, &EditorToolBar::listSelectionActivated);
|
||||
@@ -327,15 +329,6 @@ void EditorToolBar::setCurrentEditor(IEditor *editor)
|
||||
updateDocumentStatus(document);
|
||||
}
|
||||
|
||||
void EditorToolBar::updateEditorListSelection(IEditor *newSelection)
|
||||
{
|
||||
if (newSelection) {
|
||||
const Utils::optional<int> 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));
|
||||
|
@@ -105,7 +105,6 @@ private:
|
||||
void updateActionShortcuts();
|
||||
|
||||
void updateDocumentStatus(IDocument *document);
|
||||
void updateEditorListSelection(IEditor *newSelection);
|
||||
void fillListContextMenu(QMenu *menu);
|
||||
void updateToolBar(QWidget *toolBar);
|
||||
|
||||
|
@@ -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.
|
||||
|
@@ -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);
|
||||
|
@@ -140,8 +140,9 @@ void PerfResourceCounterTest::testUnitSized()
|
||||
QList<int> ids;
|
||||
for (int i = 0; i < 10000; ++i) {
|
||||
counter.request(1);
|
||||
int id = qrand();
|
||||
const int id = qrand();
|
||||
counter.obtain(id);
|
||||
if (id != 0) // Otherwise it's the invalid ID and that means the allocation "failed".
|
||||
ids.append(id);
|
||||
QCOMPARE(counter.currentTotal(), ids.length());
|
||||
}
|
||||
|
@@ -389,9 +389,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;
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user