2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2012-01-17 13:26:57 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2012-01-17 13:26:57 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2012-01-17 13:26:57 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2012-01-17 13:26:57 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2012-01-17 13:26:57 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
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
|