2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2012-01-17 13:26:57 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2012-01-17 13:26:57 +01:00
|
|
|
|
2016-05-04 18:54:59 +02:00
|
|
|
#include "qmleventlocation.h"
|
2012-01-17 13:26:57 +01:00
|
|
|
|
2016-12-28 16:45:43 +01:00
|
|
|
#include <projectexplorer/runconfiguration.h>
|
2012-01-17 13:26:57 +01:00
|
|
|
#include <qmljs/qmljsdocument.h>
|
2012-05-10 11:46:59 +02:00
|
|
|
#include <utils/fileinprojectfinder.h>
|
2012-01-17 13:26:57 +01:00
|
|
|
|
2016-05-02 12:18:57 +02:00
|
|
|
#include <QObject>
|
|
|
|
|
|
2012-01-17 13:26:57 +01:00
|
|
|
namespace QmlProfiler {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class QmlProfilerDetailsRewriter : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2016-12-28 16:45:43 +01:00
|
|
|
explicit QmlProfilerDetailsRewriter(QObject *parent = nullptr);
|
2012-01-17 13:26:57 +01:00
|
|
|
|
2017-08-14 14:39:17 +02:00
|
|
|
void clear();
|
2016-12-20 17:02:41 +01:00
|
|
|
void requestDetailsForLocation(int typeId, const QmlEventLocation &location);
|
2022-06-20 12:35:13 +02:00
|
|
|
Utils::FilePath getLocalFile(const QString &remoteFile);
|
2012-01-17 13:26:57 +01:00
|
|
|
void reloadDocuments();
|
2017-09-27 14:56:00 +02:00
|
|
|
void populateFileFinder(const ProjectExplorer::Target *target);
|
2016-12-19 16:03:16 +01:00
|
|
|
|
2012-01-17 13:26:57 +01:00
|
|
|
signals:
|
2016-12-20 17:02:41 +01:00
|
|
|
void rewriteDetailsString(int typeId, const QString &details);
|
2012-01-17 13:26:57 +01:00
|
|
|
void eventDetailsChanged();
|
2016-12-19 16:03:16 +01:00
|
|
|
|
2012-01-17 13:26:57 +01:00
|
|
|
private:
|
2017-08-14 11:09:21 +02:00
|
|
|
struct PendingEvent {
|
|
|
|
|
QmlEventLocation location;
|
|
|
|
|
int typeId;
|
|
|
|
|
};
|
|
|
|
|
|
2022-06-20 12:35:13 +02:00
|
|
|
QMultiHash<Utils::FilePath, PendingEvent> m_pendingEvents;
|
2016-12-28 16:45:43 +01:00
|
|
|
Utils::FileInProjectFinder m_projectFinder;
|
2016-12-19 16:03:16 +01:00
|
|
|
|
2016-12-20 17:02:41 +01:00
|
|
|
void rewriteDetailsForLocation(const QString &source, QmlJS::Document::Ptr doc, int typeId,
|
2016-12-19 16:03:16 +01:00
|
|
|
const QmlEventLocation &location);
|
2016-12-19 16:48:02 +01:00
|
|
|
void connectQmlModel();
|
|
|
|
|
void disconnectQmlModel();
|
2017-08-14 11:09:21 +02:00
|
|
|
void documentReady(QmlJS::Document::Ptr doc);
|
|
|
|
|
|
|
|
|
|
friend class QTypeInfo<PendingEvent>;
|
2012-01-17 13:26:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace QmlProfiler
|
2016-12-20 10:23:55 +01:00
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
Q_DECLARE_TYPEINFO(QmlProfiler::Internal::QmlProfilerDetailsRewriter::PendingEvent, Q_MOVABLE_TYPE);
|
|
|
|
|
QT_END_NAMESPACE
|