Merge remote-tracking branch 'origin/4.5'

Conflicts:
	src/plugins/cpptools/clangcompileroptionsbuilder.cpp
	src/plugins/cpptools/clangcompileroptionsbuilder.h
	src/plugins/cpptools/compileroptionsbuilder.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.h
	src/plugins/qmlprofiler/qmlprofilertraceclient.cpp
	src/plugins/qmlprofiler/qmlprofilertraceclient.h
	src/shared/qbs

Change-Id: I364ababc5d41046d17e999096c4a7187c4e4e010
This commit is contained in:
Eike Ziller
2018-01-09 13:07:57 +01:00
19 changed files with 85 additions and 110 deletions

View File

@@ -57,6 +57,12 @@ void QmlProfilerClientManager::setFlushInterval(quint32 flushInterval)
m_flushInterval = flushInterval;
}
void QmlProfilerClientManager::clearEvents()
{
if (m_clientPlugin)
m_clientPlugin->clearEvents();
}
void QmlProfilerClientManager::clearBufferedData()
{
if (m_clientPlugin)

View File

@@ -46,6 +46,7 @@ class QmlProfilerClientManager : public QmlDebug::QmlDebugConnectionManager
public:
explicit QmlProfilerClientManager(QObject *parent = 0);
void setProfilerStateManager(QmlProfilerStateManager *profilerState);
void clearEvents();
void setModelManager(QmlProfilerModelManager *modelManager);
void setFlushInterval(quint32 flushInterval);
void clearBufferedData();

View File

@@ -691,9 +691,8 @@ QmlProfilerModelManager::State QmlProfilerModelManager::state() const
return d->state;
}
void QmlProfilerModelManager::clear()
void QmlProfilerModelManager::doClearEvents()
{
setState(ClearingData);
d->numLoadedEvents = 0;
d->numFinishedFinalizers = 0;
d->file.remove();
@@ -702,13 +701,25 @@ void QmlProfilerModelManager::clear()
d->eventStream.setDevice(&d->file);
else
emit error(tr("Cannot open temporary trace file to store events."));
d->eventTypes.clear();
d->detailsRewriter->clear();
d->traceTime->clear();
d->notesModel->clear();
setVisibleFeatures(0);
setRecordedFeatures(0);
}
void QmlProfilerModelManager::clearEvents()
{
setState(ClearingData);
doClearEvents();
setState(Empty);
}
void QmlProfilerModelManager::clear()
{
setState(ClearingData);
doClearEvents();
d->eventTypes.clear();
d->detailsRewriter->clear();
setState(Empty);
}

View File

@@ -134,6 +134,7 @@ public:
static const char *featureName(ProfileFeature feature);
void clearEvents();
void clear();
void restrictToRange(qint64 startTime, qint64 endTime);
bool isRestrictedToRange() const;
@@ -156,6 +157,7 @@ signals:
private:
void setState(State state);
void detailsChanged(int typeId, const QString &newString);
void doClearEvents();
class QmlProfilerModelManagerPrivate;
QmlProfilerModelManagerPrivate *d;

View File

@@ -44,6 +44,7 @@
#include <utils/fancymainwindow.h>
#include <utils/fileinprojectfinder.h>
#include <utils/qtcassert.h>
#include <utils/url.h>
#include <utils/utilsicons.h>
#include <projectexplorer/environmentaspect.h>
#include <projectexplorer/projectexplorer.h>
@@ -406,7 +407,7 @@ void QmlProfilerTool::recordingButtonChanged(bool recording)
if (checkForUnsavedNotes()) {
if (!d->m_profilerModelManager->aggregateTraces() ||
d->m_profilerModelManager->state() == QmlProfilerModelManager::Done)
clearData(); // clear before the recording starts, unless we aggregate recordings
clearEvents(); // clear before the recording starts, unless we aggregate recordings
if (d->m_profilerState->clientRecording())
d->m_profilerState->setClientRecording(false);
d->m_profilerState->setClientRecording(true);
@@ -471,6 +472,13 @@ void QmlProfilerTool::showTimeLineSearch()
Core::Find::openFindToolBar(Core::Find::FindForwardDirection);
}
void QmlProfilerTool::clearEvents()
{
d->m_profilerModelManager->clearEvents();
d->m_profilerConnections->clearEvents();
setRecordedFeatures(0);
}
void QmlProfilerTool::clearData()
{
d->m_profilerModelManager->clear();
@@ -555,6 +563,7 @@ void QmlProfilerTool::attachToWaitingApplication()
IDevice::ConstPtr device = DeviceKitInformation::device(kit);
QTC_ASSERT(device, return);
QUrl toolControl = device->toolControlChannel(IDevice::QmlControlChannel);
serverUrl.setScheme(Utils::urlTcpScheme());
serverUrl.setHost(toolControl.host());
serverUrl.setPort(port);
@@ -565,6 +574,8 @@ void QmlProfilerTool::attachToWaitingApplication()
auto profiler = new QmlProfilerRunner(runControl);
profiler->setServerUrl(serverUrl);
connect(d->m_profilerConnections, &QmlProfilerClientManager::connectionClosed,
runControl, &RunControl::initiateStop);
ProjectExplorerPlugin::startRunControl(runControl);
}
@@ -858,7 +869,7 @@ void QmlProfilerTool::serverRecordingChanged()
d->m_recordingElapsedTime.start();
if (!d->m_profilerModelManager->aggregateTraces() ||
d->m_profilerModelManager->state() == QmlProfilerModelManager::Done)
clearData();
clearEvents();
d->m_profilerModelManager->startAcquiring();
} else {
d->m_recordingTimer.stop();

View File

@@ -74,6 +74,7 @@ public:
void gotoSourceLocation(const QString &fileUrl, int lineNumber, int columnNumber);
private:
void clearEvents();
void clearData();
void showErrorDialog(const QString &error);
void profilerDataModelStateChanged();

View File

@@ -227,10 +227,8 @@ QmlProfilerTraceClient::~QmlProfilerTraceClient()
delete d;
}
void QmlProfilerTraceClient::clear()
void QmlProfilerTraceClient::clearEvents()
{
d->serverTypeIds.clear();
d->eventTypeIds.clear();
d->rangesInProgress.clear();
d->pendingMessages.clear();
d->pendingDebugMessages.clear();
@@ -241,6 +239,13 @@ void QmlProfilerTraceClient::clear()
emit cleared();
}
void QmlProfilerTraceClient::clear()
{
d->eventTypeIds.clear();
d->serverTypeIds.clear();
clearEvents();
}
void QmlProfilerTraceClient::sendRecordingStatus(int engineId)
{
d->sendRecordingStatus(engineId);

View File

@@ -55,6 +55,7 @@ public:
virtual void messageReceived(const QByteArray &) override;
virtual void stateChanged(State status) override;
void clearEvents();
void clear();
void sendRecordingStatus(int engineId = -1);
void setRequestedFeatures(quint64 features);