Merge remote-tracking branch 'origin/3.4'

This commit is contained in:
Eike Ziller
2015-04-23 09:39:09 +02:00
34 changed files with 357 additions and 101 deletions

View File

@@ -60,11 +60,8 @@ Component.prototype.beginInstallation = function()
else if (installer.value("os") == "mac") else if (installer.value("os") == "mac")
component.qtCreatorBinaryPath = component.qtCreatorBinaryPath + "/Qt Creator.app/Contents/MacOS/Qt Creator"; component.qtCreatorBinaryPath = component.qtCreatorBinaryPath + "/Qt Creator.app/Contents/MacOS/Qt Creator";
if ( installer.value("os") === "win" ) { if ( installer.value("os") === "win" )
component.setStopProcessForUpdateRequest(component.qtCreatorBinaryPath, true); component.setStopProcessForUpdateRequest(component.qtCreatorBinaryPath, true);
component.setStopProcessForUpdateRequest("@TargetDir@/bin/linguist.exe", true);
component.setStopProcessForUpdateRequest("@TargetDir@/bin/qmlviewer.exe", true);
}
} }
registerCommonWindowsFileTypeExtensions = function() registerCommonWindowsFileTypeExtensions = function()

View File

@@ -132,6 +132,14 @@
data, and the processing delay may grow excessively. You should then lower data, and the processing delay may grow excessively. You should then lower
the \uicontrol {Sampling frequency} or the \uicontrol {Stack snapshot size}. the \uicontrol {Sampling frequency} or the \uicontrol {Stack snapshot size}.
\section2 Adding Command Line Options For Perf
You can specify additional command line options to be passed to Perf when
recording data in the \uicontrol {Additional arguments} field. You may want
to specify \c{--no-delay} or \c{--no-buffering} to reduce the processing delay.
However, those options are not supported by all versions of Perf and Perf may
not start if an unsupported option is given.
\section1 Analyzing Collected Data \section1 Analyzing Collected Data
The \uicontrol Timeline view displays a graphical representation of CPU The \uicontrol Timeline view displays a graphical representation of CPU
@@ -248,4 +256,26 @@
back its own data in a sensible way by checking the output of back its own data in a sensible way by checking the output of
\c {perf report} or \c {perf script} in the recorded Perf data files. \c {perf report} or \c {perf script} in the recorded Perf data files.
\section1 Troubleshooting
The CPU Usage Analyzer might fail to record data for the following reasons:
\list 1
\li The connection between the target device and the host may not be
fast enough to transfer the data produced by Perf. Try lowering
the \uicontrol {Stack snapshot size} or
\uicontrol {Sampling Frequency} settings.
\li Perf may be buffering the data forever, never sending it. Add
\c {--no-delay} or \c {--no-buffering} to the
\uicontrol {Additional arguments} field.
\li Some versions of Perf will not start recording unless given a
certain minimum sampling frequency. Try with a
\uicontrol {Sampling Frequency} of 1000.
\li On some devices, Perf support is not very stable and the Linux
kernel may randomly fail to record data after some time. Reboot the
device and try again.
\endlist
Output from the helper program that processes the data is displayed in the
\uicontrol {General Messages} output pane.
*/ */

View File

@@ -25,6 +25,11 @@
"QtPositioning 5.2", "QtPositioning 5.2",
"QtPositioning 5.3", "QtPositioning 5.3",
"QtPurchasing 1.0", "QtPurchasing 1.0",
"QtQml 2.0",
"QtQml 2.1",
"QtQml 2.2",
"QtQml.Models 2.1",
"QtQml.Models 2.2",
"QtQuick.Controls 1.0", "QtQuick.Controls 1.0",
"QtQuick.Controls 1.1", "QtQuick.Controls 1.1",
"QtQuick.Controls 1.2", "QtQuick.Controls 1.2",

View File

@@ -1,4 +1,4 @@
import QtQuick 2.3 import QtQuick 2.4
Rectangle { Rectangle {
property alias mouseArea: mouseArea property alias mouseArea: mouseArea

View File

@@ -25125,11 +25125,23 @@ These files are preserved.</source>
<extracomment>The name of the debug build configuration created by default for a qbs project.</extracomment> <extracomment>The name of the debug build configuration created by default for a qbs project.</extracomment>
<translation>Отладка</translation> <translation>Отладка</translation>
</message> </message>
<message>
<source>Debug</source>
<comment>Shadow build directory suffix</comment>
<extracomment>Non-ASCII characters in directory suffix may cause build issues.</extracomment>
<translation>Debug</translation>
</message>
<message> <message>
<source>Release</source> <source>Release</source>
<extracomment>The name of the release build configuration created by default for a qbs project.</extracomment> <extracomment>The name of the release build configuration created by default for a qbs project.</extracomment>
<translation>Выпуск</translation> <translation>Выпуск</translation>
</message> </message>
<message>
<source>Release</source>
<comment>Shadow build directory suffix</comment>
<extracomment>Non-ASCII characters in directory suffix may cause build issues.</extracomment>
<translation>Release</translation>
</message>
</context> </context>
<context> <context>
<name>QbsProjectManager::Internal::QbsBuildConfigurationWidget</name> <name>QbsProjectManager::Internal::QbsBuildConfigurationWidget</name>
@@ -25173,7 +25185,7 @@ These files are preserved.</source>
</message> </message>
<message> <message>
<source>Keep going</source> <source>Keep going</source>
<translation>Не сдаваться</translation> <translation>Пропускать ошибки</translation>
</message> </message>
<message> <message>
<source>Properties:</source> <source>Properties:</source>
@@ -25217,11 +25229,11 @@ These files are preserved.</source>
</message> </message>
<message> <message>
<source>Install</source> <source>Install</source>
<translation>Установить</translation> <translation>Устанавливать</translation>
</message> </message>
<message> <message>
<source>Clean install root</source> <source>Clean install root</source>
<translation>Очищать корень установки</translation> <translation>Очищать каталог установки</translation>
</message> </message>
</context> </context>
<context> <context>

View File

@@ -121,8 +121,10 @@ void TimelineModel::setCollapsedRowCount(int rows)
if (d->collapsedRowCount != rows) { if (d->collapsedRowCount != rows) {
d->collapsedRowCount = rows; d->collapsedRowCount = rows;
emit collapsedRowCountChanged(); emit collapsedRowCountChanged();
if (!d->expanded) if (!d->expanded) {
emit rowCountChanged(); emit rowCountChanged();
emit heightChanged(); // collapsed rows have a fixed size
}
} }
} }
@@ -136,12 +138,16 @@ void TimelineModel::setExpandedRowCount(int rows)
{ {
Q_D(TimelineModel); Q_D(TimelineModel);
if (d->expandedRowCount != rows) { if (d->expandedRowCount != rows) {
int prevHeight = height();
if (d->rowOffsets.length() > rows) if (d->rowOffsets.length() > rows)
d->rowOffsets.resize(rows); d->rowOffsets.resize(rows);
d->expandedRowCount = rows; d->expandedRowCount = rows;
emit expandedRowCountChanged(); emit expandedRowCountChanged();
if (d->expanded) if (d->expanded) {
emit rowCountChanged(); emit rowCountChanged();
if (height() != prevHeight)
emit heightChanged();
}
} }
} }
@@ -156,25 +162,16 @@ TimelineModel::TimelineModelPrivate::TimelineModelPrivate(int modelId, const QSt
{ {
} }
void TimelineModel::TimelineModelPrivate::init(TimelineModel *q)
{
q_ptr = q;
connect(q,SIGNAL(expandedChanged()),q,SIGNAL(heightChanged()));
connect(q,SIGNAL(hiddenChanged()),q,SIGNAL(heightChanged()));
connect(q,SIGNAL(emptyChanged()),q,SIGNAL(heightChanged()));
}
TimelineModel::TimelineModel(TimelineModelPrivate &dd, QObject *parent) : TimelineModel::TimelineModel(TimelineModelPrivate &dd, QObject *parent) :
QObject(parent), d_ptr(&dd) QObject(parent), d_ptr(&dd)
{ {
d_ptr->init(this); d_ptr->q_ptr = this;
} }
TimelineModel::TimelineModel(int modelId, const QString &displayName, QObject *parent) : TimelineModel::TimelineModel(int modelId, const QString &displayName, QObject *parent) :
QObject(parent), d_ptr(new TimelineModelPrivate(modelId, displayName)) QObject(parent), d_ptr(new TimelineModelPrivate(modelId, displayName))
{ {
d_ptr->init(this); d_ptr->q_ptr = this;
} }
TimelineModel::~TimelineModel() TimelineModel::~TimelineModel()
@@ -492,8 +489,11 @@ void TimelineModel::setExpanded(bool expanded)
{ {
Q_D(TimelineModel); Q_D(TimelineModel);
if (expanded != d->expanded) { if (expanded != d->expanded) {
int prevHeight = height();
d->expanded = expanded; d->expanded = expanded;
emit expandedChanged(); emit expandedChanged();
if (prevHeight != height())
emit heightChanged();
if (d->collapsedRowCount != d->expandedRowCount) if (d->collapsedRowCount != d->expandedRowCount)
emit rowCountChanged(); emit rowCountChanged();
} }
@@ -509,8 +509,11 @@ void TimelineModel::setHidden(bool hidden)
{ {
Q_D(TimelineModel); Q_D(TimelineModel);
if (hidden != d->hidden) { if (hidden != d->hidden) {
int prevHeight = height();
d->hidden = hidden; d->hidden = hidden;
emit hiddenChanged(); emit hiddenChanged();
if (height() != prevHeight)
emit heightChanged();
} }
} }

View File

@@ -53,10 +53,6 @@ TimelineModelAggregator::TimelineModelAggregator(TimelineNotesModel *notes, QObj
: QObject(parent), d(new TimelineModelAggregatorPrivate(this)) : QObject(parent), d(new TimelineModelAggregatorPrivate(this))
{ {
d->notesModel = notes; d->notesModel = notes;
connect(this, &TimelineModelAggregator::modelsChanged,
this, &TimelineModelAggregator::heightChanged);
connect(this, &TimelineModelAggregator::stateChanged,
this, &TimelineModelAggregator::heightChanged);
} }
TimelineModelAggregator::~TimelineModelAggregator() TimelineModelAggregator::~TimelineModelAggregator()
@@ -76,6 +72,8 @@ void TimelineModelAggregator::addModel(TimelineModel *m)
if (d->notesModel) if (d->notesModel)
d->notesModel->addTimelineModel(m); d->notesModel->addTimelineModel(m);
emit modelsChanged(); emit modelsChanged();
if (m->height() != 0)
emit heightChanged();
} }
const TimelineModel *TimelineModelAggregator::model(int modelIndex) const const TimelineModel *TimelineModelAggregator::model(int modelIndex) const
@@ -98,10 +96,13 @@ TimelineNotesModel *TimelineModelAggregator::notes() const
void TimelineModelAggregator::clear() void TimelineModelAggregator::clear()
{ {
int prevHeight = height();
d->modelList.clear(); d->modelList.clear();
if (d->notesModel) if (d->notesModel)
d->notesModel->clear(); d->notesModel->clear();
emit modelsChanged(); emit modelsChanged();
if (height() != prevHeight)
emit heightChanged();
} }
int TimelineModelAggregator::modelOffset(int modelIndex) const int TimelineModelAggregator::modelOffset(int modelIndex) const

View File

@@ -54,6 +54,11 @@ QSGNode *TimelineOverviewRenderer::updatePaintNode(QSGNode *oldNode,
Q_D(TimelineOverviewRenderer); Q_D(TimelineOverviewRenderer);
Q_UNUSED(updatePaintNodeData) Q_UNUSED(updatePaintNodeData)
if (!d->model || d->model->isEmpty() || !d->zoomer || d->zoomer->traceDuration() <= 0) {
delete oldNode;
return 0;
}
if (d->modelDirty) { if (d->modelDirty) {
delete d->renderState; delete d->renderState;
d->renderState = 0; d->renderState = 0;

View File

@@ -203,7 +203,6 @@ void TimelineRenderer::mouseMoveEvent(QMouseEvent *event)
void TimelineRenderer::hoverMoveEvent(QHoverEvent *event) void TimelineRenderer::hoverMoveEvent(QHoverEvent *event)
{ {
Q_D(TimelineRenderer); Q_D(TimelineRenderer);
Q_UNUSED(event);
d->manageHovered(event->pos().x(), event->pos().y()); d->manageHovered(event->pos().x(), event->pos().y());
if (d->currentSelection.eventIndex == -1) if (d->currentSelection.eventIndex == -1)
event->setAccepted(false); event->setAccepted(false);

View File

@@ -29,6 +29,7 @@
****************************************************************************/ ****************************************************************************/
#include "timelinerenderstate_p.h" #include "timelinerenderstate_p.h"
#include <utils/qtcassert.h>
namespace Timeline { namespace Timeline {
@@ -139,6 +140,8 @@ void TimelineRenderState::assembleNodeTree(const TimelineModel *model, int defau
int defaultRowOffset) int defaultRowOffset)
{ {
Q_D(TimelineRenderState); Q_D(TimelineRenderState);
QTC_ASSERT(isEmpty(), return);
for (int pass = 0; pass < d->passes.length(); ++pass) { for (int pass = 0; pass < d->passes.length(); ++pass) {
const TimelineRenderPass::State *passState = d->passes[pass]; const TimelineRenderPass::State *passState = d->passes[pass];
if (!passState) if (!passState)

View File

@@ -69,6 +69,7 @@ const QLatin1String VerboseOutputKey("VerboseOutput");
const QLatin1String InputFile("InputFile"); const QLatin1String InputFile("InputFile");
const QLatin1String ProFilePathForInputFile("ProFilePathForInputFile"); const QLatin1String ProFilePathForInputFile("ProFilePathForInputFile");
const QLatin1String InstallFailedInconsistentCertificatesString("INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES"); const QLatin1String InstallFailedInconsistentCertificatesString("INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES");
const QLatin1String InstallFailedInconsistentCertificatesString2("INSTALL_FAILED_UPDATE_INCOMPATIBLE");
const Core::Id AndroidDeployQtStep::Id("Qt4ProjectManager.AndroidDeployQtStep"); const Core::Id AndroidDeployQtStep::Id("Qt4ProjectManager.AndroidDeployQtStep");
////////////////// //////////////////
@@ -490,7 +491,8 @@ void AndroidDeployQtStep::processReadyReadStdOutput()
void AndroidDeployQtStep::stdOutput(const QString &line) void AndroidDeployQtStep::stdOutput(const QString &line)
{ {
if (line.contains(InstallFailedInconsistentCertificatesString)) if (line.contains(InstallFailedInconsistentCertificatesString)
|| line.contains(InstallFailedInconsistentCertificatesString2))
m_installOk = false; m_installOk = false;
emit addOutput(line, BuildStep::NormalOutput, BuildStep::DontAppendNewline); emit addOutput(line, BuildStep::NormalOutput, BuildStep::DontAppendNewline);
} }
@@ -506,7 +508,8 @@ void AndroidDeployQtStep::processReadyReadStdError()
void AndroidDeployQtStep::stdError(const QString &line) void AndroidDeployQtStep::stdError(const QString &line)
{ {
if (line.contains(InstallFailedInconsistentCertificatesString)) if (line.contains(InstallFailedInconsistentCertificatesString)
|| line.contains(InstallFailedInconsistentCertificatesString2))
m_installOk = false; m_installOk = false;
emit addOutput(line, BuildStep::ErrorOutput, BuildStep::DontAppendNewline); emit addOutput(line, BuildStep::ErrorOutput, BuildStep::DontAppendNewline);
} }

View File

@@ -66,7 +66,7 @@ unix {
LLVM_CONFIG = $$findLLVMConfig() LLVM_CONFIG = $$findLLVMConfig()
LLVM_VERSION = $$system($$LLVM_CONFIG --version 2>/dev/null) LLVM_VERSION = $$system($$LLVM_CONFIG --version 2>/dev/null)
LLVM_VERSION = $$replace(LLVM_VERSION, ^(\\d+\\.\\d+).*$, \\1) LLVM_VERSION = $$replace(LLVM_VERSION, ^(\\d+\\.\\d+\\.\\d+).*$, \\1)
message("... version $$LLVM_VERSION") message("... version $$LLVM_VERSION")
LLVM_INCLUDEPATH = $$system($$LLVM_CONFIG --includedir 2>/dev/null) LLVM_INCLUDEPATH = $$system($$LLVM_CONFIG --includedir 2>/dev/null)

View File

@@ -151,6 +151,14 @@ QStringList createClangOptions(const ProjectPart::Ptr &pPart, ProjectFile::Kind
maybeIncludeBorlandExtensions()); maybeIncludeBorlandExtensions());
result << CompilerOptionsBuilder::createDefineOptions(pPart->toolchainDefines); result << CompilerOptionsBuilder::createDefineOptions(pPart->toolchainDefines);
result << CompilerOptionsBuilder::createDefineOptions(pPart->projectDefines); result << CompilerOptionsBuilder::createDefineOptions(pPart->projectDefines);
static const QString resourceDir = getResourceDir();
if (!resourceDir.isEmpty()) {
result << QLatin1String("-nostdlibinc");
result << (QLatin1String("-I") + resourceDir);
result << QLatin1String("-undef");
}
result << CompilerOptionsBuilder::createHeaderPathOptions(pPart->headerPaths, isBlacklisted); result << CompilerOptionsBuilder::createHeaderPathOptions(pPart->headerPaths, isBlacklisted);
// Inject header file // Inject header file
@@ -164,13 +172,6 @@ QStringList createClangOptions(const ProjectPart::Ptr &pPart, ProjectFile::Kind
if (!pPart->projectConfigFile.isEmpty()) if (!pPart->projectConfigFile.isEmpty())
result << QLatin1String("-include") << pPart->projectConfigFile; result << QLatin1String("-include") << pPart->projectConfigFile;
static const QString resourceDir = getResourceDir();
if (!resourceDir.isEmpty()) {
result << QLatin1String("-nostdlibinc");
result << (QLatin1String("-I") + resourceDir);
result << QLatin1String("-undef");
}
result << QLatin1String("-fmessage-length=0"); result << QLatin1String("-fmessage-length=0");
result << QLatin1String("-fdiagnostics-show-note-include-stack"); result << QLatin1String("-fdiagnostics-show-note-include-stack");
result << QLatin1String("-fmacro-backtrace-limit=0"); result << QLatin1String("-fmacro-backtrace-limit=0");

View File

@@ -251,9 +251,12 @@ void DebuggerItemManager::autoDetectGdbOrLldbDebuggers()
dir.setFilter(QDir::Files | QDir::Executable); dir.setFilter(QDir::Files | QDir::Executable);
foreach (const QString &base, path) { foreach (const QString &base, path) {
dir.setPath(base); dir.setPath(base);
foreach (const QString &entry, dir.entryList()) foreach (const QString &entry, dir.entryList()) {
if (entry.startsWith(QLatin1String("lldb-platform-")))
continue;
suspects.append(FileName::fromString(dir.absoluteFilePath(entry))); suspects.append(FileName::fromString(dir.absoluteFilePath(entry)));
} }
}
foreach (const FileName &command, suspects) { foreach (const FileName &command, suspects) {
if (findByCommand(command)) if (findByCommand(command))

View File

@@ -219,7 +219,7 @@ ToolTipWatchItem::ToolTipWatchItem(WatchItem *item)
value = item->displayValue(); value = item->displayValue();
type = item->displayType(); type = item->displayType();
iname = item->iname; iname = item->iname;
valueColor = item->valueColor(); valueColor = item->valueColor(1);
expandable = item->hasChildren(); expandable = item->hasChildren();
expression = item->expression(); expression = item->expression();
foreach (TreeItem *child, item->children()) foreach (TreeItem *child, item->children())

View File

@@ -868,13 +868,14 @@ void LldbEngine::assignValueInDebugger(WatchItem *,
void LldbEngine::updateWatchItem(WatchItem *) void LldbEngine::updateWatchItem(WatchItem *)
{ {
updateLocals(); doUpdateLocals(UpdateParameters());
} }
void LldbEngine::updateLocals() void LldbEngine::updateLocals()
{ {
UpdateParameters params; watchHandler()->resetValueCache();
doUpdateLocals(params); watchHandler()->notifyUpdateStarted();
doUpdateLocals(UpdateParameters());
} }
void LldbEngine::doUpdateLocals(UpdateParameters params) void LldbEngine::doUpdateLocals(UpdateParameters params)
@@ -923,7 +924,6 @@ void LldbEngine::doUpdateLocals(UpdateParameters params)
m_lastDebuggableCommand = cmd; m_lastDebuggableCommand = cmd;
m_lastDebuggableCommand.args.replace("\"passexceptions\":0", "\"passexceptions\":1"); m_lastDebuggableCommand.args.replace("\"passexceptions\":0", "\"passexceptions\":1");
watchHandler()->notifyUpdateStarted();
runCommand(cmd); runCommand(cmd);
reloadRegisters(); reloadRegisters();

View File

@@ -776,21 +776,24 @@ QString WatchItem::displayType() const
return result; return result;
} }
QColor WatchItem::valueColor() const QColor WatchItem::valueColor(int column) const
{ {
using Utils::Theme; Theme::Color color = Theme::Debugger_WatchItem_ValueNormal;
Theme *theme = Utils::creatorTheme(); if (const WatchModel *model = watchModel()) {
if (watchModel()) { if (!model->m_contentsValid && !isInspect()) {
color = Theme::Debugger_WatchItem_ValueInvalid;
} else if (column == 1) {
if (!valueEnabled) if (!valueEnabled)
return theme->color(Theme::Debugger_WatchItem_ValueInvalid); color = Theme::Debugger_WatchItem_ValueInvalid;
if (!watchModel()->m_contentsValid && !isInspect()) else if (!model->m_contentsValid && !isInspect())
return theme->color(Theme::Debugger_WatchItem_ValueInvalid); color = Theme::Debugger_WatchItem_ValueInvalid;
if (value.isEmpty()) // This might still show 0x... else if (column == 1 && value.isEmpty()) // This might still show 0x...
return theme->color(Theme::Debugger_WatchItem_ValueInvalid); color = Theme::Debugger_WatchItem_ValueInvalid;
if (value != watchModel()->m_valueCache.value(iname)) else if (column == 1 && value != model->m_valueCache.value(iname))
return theme->color(Theme::Debugger_WatchItem_ValueChanged); color = Theme::Debugger_WatchItem_ValueChanged;
} }
return theme->color(Theme::Debugger_WatchItem_ValueNormal); }
return creatorTheme()->color(color);
} }
QVariant WatchItem::data(int column, int role) const QVariant WatchItem::data(int column, int role) const
@@ -837,8 +840,7 @@ QVariant WatchItem::data(int column, int role) const
? toToolTip() : QVariant(); ? toToolTip() : QVariant();
case Qt::ForegroundRole: case Qt::ForegroundRole:
if (column == 1) return valueColor(column);
return valueColor();
case LocalsExpressionRole: case LocalsExpressionRole:
return expression(); return expression();

View File

@@ -107,7 +107,7 @@ public:
QVariant editValue() const; QVariant editValue() const;
int editType() const; int editType() const;
QColor valueColor() const; QColor valueColor(int column) const;
int requestedFormat() const; int requestedFormat() const;
WatchItem *findItem(const QByteArray &iname); WatchItem *findItem(const QByteArray &iname);

View File

@@ -303,7 +303,7 @@ void HelpWidget::addSideBar()
auto contentWindow = new ContentWindow; auto contentWindow = new ContentWindow;
auto contentItem = new Core::SideBarItem(contentWindow, QLatin1String(Constants::HELP_CONTENTS)); auto contentItem = new Core::SideBarItem(contentWindow, QLatin1String(Constants::HELP_CONTENTS));
contentWindow->setOpenInNewPageActionVisible(supportsNewPages); contentWindow->setOpenInNewPageActionVisible(supportsNewPages);
contentWindow->setWindowTitle(tr(Constants::SB_CONTENTS)); contentWindow->setWindowTitle(HelpPlugin::tr(Constants::SB_CONTENTS));
connect(contentWindow, &ContentWindow::linkActivated, connect(contentWindow, &ContentWindow::linkActivated,
this, &HelpWidget::open); this, &HelpWidget::open);
m_contentsAction = new QAction(tr(Constants::SB_CONTENTS), this); m_contentsAction = new QAction(tr(Constants::SB_CONTENTS), this);
@@ -315,7 +315,7 @@ void HelpWidget::addSideBar()
auto indexWindow = new IndexWindow(); auto indexWindow = new IndexWindow();
auto indexItem = new Core::SideBarItem(indexWindow, QLatin1String(Constants::HELP_INDEX)); auto indexItem = new Core::SideBarItem(indexWindow, QLatin1String(Constants::HELP_INDEX));
indexWindow->setOpenInNewPageActionVisible(supportsNewPages); indexWindow->setOpenInNewPageActionVisible(supportsNewPages);
indexWindow->setWindowTitle(tr(Constants::SB_INDEX)); indexWindow->setWindowTitle(HelpPlugin::tr(Constants::SB_INDEX));
connect(indexWindow, &IndexWindow::linkActivated, connect(indexWindow, &IndexWindow::linkActivated,
this, &HelpWidget::open); this, &HelpWidget::open);
connect(indexWindow, &IndexWindow::linksActivated, connect(indexWindow, &IndexWindow::linksActivated,
@@ -327,7 +327,7 @@ void HelpWidget::addSideBar()
shortcutMap.insert(QLatin1String(Constants::HELP_INDEX), cmd); shortcutMap.insert(QLatin1String(Constants::HELP_INDEX), cmd);
auto bookmarkWidget = new BookmarkWidget(&LocalHelpManager::bookmarkManager()); auto bookmarkWidget = new BookmarkWidget(&LocalHelpManager::bookmarkManager());
bookmarkWidget->setWindowTitle(tr(Constants::SB_BOOKMARKS)); bookmarkWidget->setWindowTitle(HelpPlugin::tr(Constants::SB_BOOKMARKS));
bookmarkWidget->setOpenInNewPageActionVisible(supportsNewPages); bookmarkWidget->setOpenInNewPageActionVisible(supportsNewPages);
auto bookmarkItem = new Core::SideBarItem(bookmarkWidget, auto bookmarkItem = new Core::SideBarItem(bookmarkWidget,
QLatin1String(Constants::HELP_BOOKMARKS)); QLatin1String(Constants::HELP_BOOKMARKS));
@@ -351,7 +351,7 @@ void HelpWidget::addSideBar()
Core::SideBarItem *openPagesItem = 0; Core::SideBarItem *openPagesItem = 0;
if (m_style == ModeWidget) { if (m_style == ModeWidget) {
QWidget *openPagesWidget = OpenPagesManager::instance().openPagesWidget(); QWidget *openPagesWidget = OpenPagesManager::instance().openPagesWidget();
openPagesWidget->setWindowTitle(tr(Constants::SB_OPENPAGES)); openPagesWidget->setWindowTitle(HelpPlugin::tr(Constants::SB_OPENPAGES));
openPagesItem = new Core::SideBarItem(openPagesWidget, openPagesItem = new Core::SideBarItem(openPagesWidget,
QLatin1String(Constants::HELP_OPENPAGES)); QLatin1String(Constants::HELP_OPENPAGES));
m_openPagesAction = new QAction(tr("Activate Open Help Pages View"), this); m_openPagesAction = new QAction(tr("Activate Open Help Pages View"), this);

View File

@@ -30,6 +30,7 @@
#include "searchwidget.h" #include "searchwidget.h"
#include "helpconstants.h" #include "helpconstants.h"
#include "helpplugin.h"
#include "localhelpmanager.h" #include "localhelpmanager.h"
#include "openpagesmanager.h" #include "openpagesmanager.h"
@@ -303,7 +304,7 @@ QStringList SearchWidget::currentSearchTerms() const
SearchSideBarItem::SearchSideBarItem() SearchSideBarItem::SearchSideBarItem()
: SideBarItem(new SearchWidget, QLatin1String(Constants::HELP_SEARCH)) : SideBarItem(new SearchWidget, QLatin1String(Constants::HELP_SEARCH))
{ {
widget()->setWindowTitle(tr(Constants::SB_SEARCH)); widget()->setWindowTitle(HelpPlugin::tr(Constants::SB_SEARCH));
connect(widget(), SIGNAL(linkActivated(QUrl,QStringList,bool)), connect(widget(), SIGNAL(linkActivated(QUrl,QStringList,bool)),
this, SIGNAL(linkActivated(QUrl,QStringList,bool))); this, SIGNAL(linkActivated(QUrl,QStringList,bool)));
} }

View File

@@ -443,7 +443,7 @@ void IosToolHandlerPrivate::processXml()
else if (statusStr.compare(QLatin1String("failure"), Qt::CaseInsensitive) == 0) else if (statusStr.compare(QLatin1String("failure"), Qt::CaseInsensitive) == 0)
status = Ios::IosToolHandler::Failure; status = Ios::IosToolHandler::Failure;
emit didTransferApp(bundlePath, deviceId, status); emit didTransferApp(bundlePath, deviceId, status);
} else if (elName == QLatin1String("device_info")) { } else if (elName == QLatin1String("device_info") || elName == QLatin1String("deviceinfo")) {
stack.append(ParserState(ParserState::DeviceInfo)); stack.append(ParserState(ParserState::DeviceInfo));
} else if (elName == QLatin1String("inferior_pid")) { } else if (elName == QLatin1String("inferior_pid")) {
stack.append(ParserState(ParserState::InferiorPid)); stack.append(ParserState(ParserState::InferiorPid));

View File

@@ -126,7 +126,7 @@ ApplicationLauncher::ApplicationLauncher(QObject *parent)
connect(WinDebugInterface::instance(), SIGNAL(cannotRetrieveDebugOutput()), connect(WinDebugInterface::instance(), SIGNAL(cannotRetrieveDebugOutput()),
this, SLOT(cannotRetrieveDebugOutput())); this, SLOT(cannotRetrieveDebugOutput()));
connect(WinDebugInterface::instance(), SIGNAL(debugOutput(qint64,QString)), connect(WinDebugInterface::instance(), SIGNAL(debugOutput(qint64,QString)),
this, SLOT(checkDebugOutput(qint64,QString))); this, SLOT(checkDebugOutput(qint64,QString)), Qt::BlockingQueuedConnection);
#endif #endif
#ifdef WITH_JOURNALD #ifdef WITH_JOURNALD
connect(JournaldWatcher::instance(), &JournaldWatcher::journaldOutput, connect(JournaldWatcher::instance(), &JournaldWatcher::journaldOutput,

View File

@@ -3021,29 +3021,33 @@ void ProjectExplorerPluginPrivate::addNewSubproject()
void ProjectExplorerPluginPrivate::handleAddExistingFiles() void ProjectExplorerPluginPrivate::handleAddExistingFiles()
{ {
QTC_ASSERT(ProjectTree::currentNode(), return); Node *node = ProjectTree::currentNode();
FolderNode *folderNode = node ? node->asFolderNode() : 0;
QTC_ASSERT(folderNode, return);
QStringList fileNames = QFileDialog::getOpenFileNames(ICore::mainWindow(), QStringList fileNames = QFileDialog::getOpenFileNames(ICore::mainWindow(),
tr("Add Existing Files"), directoryFor(ProjectTree::currentNode())); tr("Add Existing Files"), directoryFor(ProjectTree::currentNode()));
if (fileNames.isEmpty()) if (fileNames.isEmpty())
return; return;
ProjectExplorerPlugin::addExistingFiles(fileNames); ProjectExplorerPlugin::addExistingFiles(fileNames, folderNode);
} }
void ProjectExplorerPluginPrivate::addExistingDirectory() void ProjectExplorerPluginPrivate::addExistingDirectory()
{ {
QTC_ASSERT(ProjectTree::currentNode(), return); Node *node = ProjectTree::currentNode();
FolderNode *folderNode = node ? node->asFolderNode() : 0;
QTC_ASSERT(folderNode, return);
SelectableFilesDialogAddDirectory dialog(directoryFor(ProjectTree::currentNode()), QStringList(), ICore::mainWindow()); SelectableFilesDialogAddDirectory dialog(directoryFor(ProjectTree::currentNode()), QStringList(), ICore::mainWindow());
if (dialog.exec() == QDialog::Accepted) if (dialog.exec() == QDialog::Accepted)
ProjectExplorerPlugin::addExistingFiles(dialog.selectedFiles()); ProjectExplorerPlugin::addExistingFiles(dialog.selectedFiles(), folderNode);
} }
void ProjectExplorerPlugin::addExistingFiles(const QStringList &filePaths) void ProjectExplorerPlugin::addExistingFiles(const QStringList &filePaths, FolderNode *folderNode)
{ {
Node *node = ProjectTree::currentNode();
FolderNode *folderNode = node ? node->asFolderNode() : 0;
addExistingFiles(folderNode, filePaths); addExistingFiles(folderNode, filePaths);
} }

View File

@@ -104,7 +104,7 @@ public:
const bool forceSkipDeploy = false); const bool forceSkipDeploy = false);
static void addExistingFiles(FolderNode *projectNode, const QStringList &filePaths); static void addExistingFiles(FolderNode *projectNode, const QStringList &filePaths);
static void addExistingFiles(const QStringList &filePaths); static void addExistingFiles(const QStringList &filePaths, FolderNode *folderNode);
static void buildProject(Project *p); static void buildProject(Project *p);
/// Normally there's no need to call this function. /// Normally there's no need to call this function.

View File

@@ -62,7 +62,9 @@ static QString extractToolchainPrefix(QString *compilerName)
{ {
QString prefix; QString prefix;
if (compilerName->endsWith(QLatin1String("-g++")) if (compilerName->endsWith(QLatin1String("-g++"))
|| compilerName->endsWith(QLatin1String("-clang++"))) { || compilerName->endsWith(QLatin1String("-clang++"))
|| compilerName->endsWith(QLatin1String("-gcc"))
|| compilerName->endsWith(QLatin1String("-clang"))) {
const int idx = compilerName->lastIndexOf(QLatin1Char('-')) + 1; const int idx = compilerName->lastIndexOf(QLatin1Char('-')) + 1;
prefix = compilerName->left(idx); prefix = compilerName->left(idx);
compilerName->remove(0, idx); compilerName->remove(0, idx);

View File

@@ -419,13 +419,15 @@ QList<BuildInfo *> QbsBuildConfigurationFactory::availableSetups(const Kit *k, c
BuildInfo *info = createBuildInfo(k, BuildConfiguration::Debug); BuildInfo *info = createBuildInfo(k, BuildConfiguration::Debug);
//: The name of the debug build configuration created by default for a qbs project. //: The name of the debug build configuration created by default for a qbs project.
info->displayName = tr("Debug"); info->displayName = tr("Debug");
info->buildDirectory = defaultBuildDirectory(projectPath, k, info->displayName); //: Non-ASCII characters in directory suffix may cause build issues.
info->buildDirectory = defaultBuildDirectory(projectPath, k, tr("Debug", "Shadow build directory suffix"));
result << info; result << info;
info = createBuildInfo(k, BuildConfiguration::Release); info = createBuildInfo(k, BuildConfiguration::Release);
//: The name of the release build configuration created by default for a qbs project. //: The name of the release build configuration created by default for a qbs project.
info->displayName = tr("Release"); info->displayName = tr("Release");
info->buildDirectory = defaultBuildDirectory(projectPath, k, info->displayName); //: Non-ASCII characters in directory suffix may cause build issues.
info->buildDirectory = defaultBuildDirectory(projectPath, k, tr("Release", "Shadow build directory suffix"));
result << info; result << info;
return result; return result;

View File

@@ -414,10 +414,6 @@ struct Type
expectedType.replace(' ', ""); expectedType.replace(' ', "");
expectedType.replace("const", ""); expectedType.replace("const", "");
expectedType.replace('@', context.nameSpace); expectedType.replace('@', context.nameSpace);
if (fullNamespaceMatch)
expectedType.replace('?', context.nameSpace);
else
expectedType.replace('?', "");
if (isPattern) { if (isPattern) {
QString actual = QString::fromLatin1(actualType); QString actual = QString::fromLatin1(actualType);
@@ -425,6 +421,11 @@ struct Type
return QRegExp(expected).exactMatch(actual); return QRegExp(expected).exactMatch(actual);
} }
if (fullNamespaceMatch)
expectedType.replace('?', context.nameSpace);
else
expectedType.replace('?', "");
if (actualType == expectedType) if (actualType == expectedType)
return true; return true;
@@ -4382,24 +4383,6 @@ void tst_Dumpers::dumper_data()
+ Check("v2.3", "[3]", "", "Foo"); + Check("v2.3", "[3]", "", "Foo");
QTest::newRow("StdStream")
<< Data("#include <istream>\n"
"#include <fstream>\n",
"using namespace std;\n"
"ifstream is0, is;\n"
"#ifdef Q_OS_WIN\n"
"is.open(\"C:\\\\Program Files\\\\Windows NT\\\\Accessories\\\\wordpad.exe\");\n"
"#else\n"
"is.open(\"/etc/passwd\");\n"
"#endif\n"
"bool ok = is.good();\n"
"unused(&ok, &is, &is0);\n")
+ Check("is", "", "std::ifstream")
+ Check("ok", "true", "bool");
QTest::newRow("StdUnorderedMap") QTest::newRow("StdUnorderedMap")
<< Data("#include <unordered_map>\n" << Data("#include <unordered_map>\n"
"#include <string>\n", "#include <string>\n",

View File

@@ -2,8 +2,9 @@ include(../../../qtcreator.pri)
TEMPLATE = subdirs TEMPLATE = subdirs
SUBDIRS = \ SUBDIRS = \
timelineabstractrenderer \
timelinemodel \ timelinemodel \
timelineabstractrenderer timelinemodelaggregator
minQtVersion(5,4,0) { minQtVersion(5,4,0) {
SUBDIRS += \ SUBDIRS += \

View File

@@ -7,6 +7,7 @@ Project {
+ "/src/libs/timeline" + "/src/libs/timeline"
references: [ references: [
"timelinemodel/timelinemodel.qbs", "timelinemodel/timelinemodel.qbs",
"timelinemodelaggregator/timelinemodelaggregator.qbs",
"timelineabstractrenderer/timelineabstractrenderer.qbs", "timelineabstractrenderer/timelineabstractrenderer.qbs",
"timelineitemsrenderpass/timelineitemsrenderpass.qbs", "timelineitemsrenderpass/timelineitemsrenderpass.qbs",
] ]

View File

@@ -227,14 +227,23 @@ void tst_TimelineModel::rowOffset()
void tst_TimelineModel::height() void tst_TimelineModel::height()
{ {
DummyModel dummy; DummyModel dummy;
QSignalSpy spy(&dummy, SIGNAL(heightChanged()));
QCOMPARE(dummy.height(), 0); QCOMPARE(dummy.height(), 0);
dummy.loadData(); dummy.loadData();
QCOMPARE(spy.count(), 1);
QCOMPARE(dummy.height(), 2 * DefaultRowHeight); QCOMPARE(dummy.height(), 2 * DefaultRowHeight);
dummy.setExpanded(true); dummy.setExpanded(true);
QCOMPARE(spy.count(), 2);
QCOMPARE(dummy.height(), 3 * DefaultRowHeight); QCOMPARE(dummy.height(), 3 * DefaultRowHeight);
dummy.setExpandedRowHeight(1, 80); dummy.setExpandedRowHeight(1, 80);
QCOMPARE(spy.count(), 3);
QCOMPARE(dummy.height(), 2 * DefaultRowHeight + 80); QCOMPARE(dummy.height(), 2 * DefaultRowHeight + 80);
dummy.setHidden(true);
QCOMPARE(spy.count(), 4);
QCOMPARE(dummy.height(), 0);
dummy.clear(); dummy.clear();
// When clearing the height can change several times in a row.
QVERIFY(spy.count() > 4);
dummy.loadData(); dummy.loadData();
dummy.setExpanded(true); dummy.setExpanded(true);
QCOMPARE(dummy.rowHeight(1), DefaultRowHeight); // Make sure the row height gets reset. QCOMPARE(dummy.rowHeight(1), DefaultRowHeight); // Make sure the row height gets reset.

View File

@@ -0,0 +1,5 @@
QTC_LIB_DEPENDS += timeline
include(../../qttest.pri)
SOURCES += \
tst_timelinemodelaggregator.cpp

View File

@@ -0,0 +1,14 @@
import qbs
QtcAutotest {
Depends { name: "Timeline" }
Depends { name: "Qt.gui" }
name: "TimelineModelAggregator autotest"
Group {
name: "Test sources"
files: [
"tst_timelinemodelaggregator.cpp"
]
}
}

View File

@@ -0,0 +1,170 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://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 http://www.qt.io/terms-conditions. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include <QtTest>
#include <timeline/timelinemodelaggregator.h>
class tst_TimelineModelAggregator : public QObject
{
Q_OBJECT
private slots:
void height();
void addRemoveModel();
void prevNext();
};
class HeightTestModel : public Timeline::TimelineModel {
public:
HeightTestModel() : TimelineModel(2, QString())
{
insert(0, 1, 1);
}
};
void tst_TimelineModelAggregator::height()
{
Timeline::TimelineModelAggregator aggregator(0);
QCOMPARE(aggregator.height(), 0);
QSignalSpy heightSpy(&aggregator, SIGNAL(heightChanged()));
Timeline::TimelineModel *model = new Timeline::TimelineModel(25, QString());
aggregator.addModel(model);
QCOMPARE(aggregator.height(), 0);
QCOMPARE(heightSpy.count(), 0);
aggregator.addModel(new HeightTestModel);
QVERIFY(aggregator.height() > 0);
QCOMPARE(heightSpy.count(), 1);
aggregator.clear();
QCOMPARE(aggregator.height(), 0);
QCOMPARE(heightSpy.count(), 2);
}
void tst_TimelineModelAggregator::addRemoveModel()
{
Timeline::TimelineNotesModel notes;
Timeline::TimelineModelAggregator aggregator(&notes);
QSignalSpy spy(&aggregator, SIGNAL(modelsChanged()));
QCOMPARE(aggregator.notes(), &notes);
Timeline::TimelineModel *model1 = new Timeline::TimelineModel(25, QString());
Timeline::TimelineModel *model2 = new Timeline::TimelineModel(26, QString());
aggregator.addModel(model1);
QCOMPARE(spy.count(), 1);
QCOMPARE(aggregator.modelCount(), 1);
QCOMPARE(aggregator.model(0), model1);
QCOMPARE(aggregator.models().count(), 1);
aggregator.addModel(model2);
QCOMPARE(spy.count(), 2);
QCOMPARE(aggregator.modelCount(), 2);
QCOMPARE(aggregator.model(1), model2);
QCOMPARE(aggregator.models().count(), 2);
QCOMPARE(aggregator.modelIndexById(25), 0);
QCOMPARE(aggregator.modelIndexById(26), 1);
QCOMPARE(aggregator.modelIndexById(27), -1);
QCOMPARE(aggregator.modelOffset(0), 0);
QCOMPARE(aggregator.modelOffset(1), 0);
aggregator.clear();
QCOMPARE(spy.count(), 3);
QCOMPARE(aggregator.modelCount(), 0);
}
class PrevNextTestModel : public Timeline::TimelineModel
{
public:
PrevNextTestModel(int x) : TimelineModel(x, QString())
{
for (int i = 0; i < 20; ++i)
insert(i + x, i * x, x);
}
};
void tst_TimelineModelAggregator::prevNext()
{
Timeline::TimelineModelAggregator aggregator(0);
aggregator.addModel(new PrevNextTestModel(1));
aggregator.addModel(new PrevNextTestModel(2));
aggregator.addModel(new PrevNextTestModel(3));
// Add an empty model to trigger the special code paths that skip it
aggregator.addModel(new Timeline::TimelineModel(4, QString()));
QLatin1String item("item");
QLatin1String model("model");
QVariantMap result;
{
int indexes[] = {-1, -1, -1};
int lastModel = -1;
int lastIndex = -1;
for (int i = 0; i < 60; ++i) {
result = aggregator.nextItem(lastModel, lastIndex, -1);
int nextModel = result.value(model).toInt();
int nextIndex = result.value(item).toInt();
QVERIFY(nextModel < 3);
QVERIFY(nextModel >= 0);
QCOMPARE(nextIndex, ++indexes[nextModel]);
lastModel = nextModel;
lastIndex = nextIndex;
}
result = aggregator.nextItem(lastModel, lastIndex, -1);
QCOMPARE(result.value(model).toInt(), 0);
QCOMPARE(result.value(item).toInt(), 0);
}
{
int indexes[] = {20, 20, 20};
int lastModel = -1;
int lastIndex = -1;
for (int i = 0; i < 60; ++i) {
result = aggregator.prevItem(lastModel, lastIndex, -1);
int prevModel = result.value(model).toInt();
int prevIndex = result.value(item).toInt();
QVERIFY(prevModel < 3);
QVERIFY(prevModel >= 0);
QCOMPARE(prevIndex, --indexes[prevModel]);
lastModel = prevModel;
lastIndex = prevIndex;
}
result = aggregator.prevItem(lastModel, lastIndex, -1);
QCOMPARE(result.value(model).toInt(), 2);
QCOMPARE(result.value(item).toInt(), 19);
}
}
QTEST_MAIN(tst_TimelineModelAggregator)
#include "tst_timelinemodelaggregator.moc"

View File

@@ -74,11 +74,11 @@ def main():
# close help widget again to avoid focus issues # close help widget again to avoid focus issues
sendEvent("QCloseEvent", waitForObject(":Help Widget_Help::Internal::HelpWidget")) sendEvent("QCloseEvent", waitForObject(":Help Widget_Help::Internal::HelpWidget"))
# check a demonstration video link # check a demonstration video link
replaceEditorContent(waitForObject(searchTut), "embedded linux") replaceEditorContent(waitForObject(searchTut), "embedded device")
test.verify(checkIfObjectExists(getQmlItem("Delegate", test.verify(checkIfObjectExists(getQmlItem("Delegate",
":WelcomePageStyledBar.WelcomePage_QQuickView", ":WelcomePageStyledBar.WelcomePage_QQuickView",
False, "id='delegate' radius='0' caption=" False, "id='delegate' radius='0' caption="
"'Developing Embedded Linux Applications with Qt'")), "'Device Creation with Qt'")),
"Verifying: Link to the expected demonstration video exists.") "Verifying: Link to the expected demonstration video exists.")
# exit Qt Creator # exit Qt Creator
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")