forked from qt-creator/qt-creator
Utils: More forward declarations / drop unused headers [L-O]
Round 1 - focus on headers. For classes with initial in range [L-O]. Try to keep the same separators between different kind of headers. Drop changes to NameValueDictionary for now, as apparently environmentfwd.h is broken currently. It looks we can't forward declare the argument T inside QList<T> - the type must be complete. Change-Id: If26e88357a2ffbb91a79c4d003046443d98d5673 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -72,7 +72,7 @@ private:
|
|||||||
|
|
||||||
static QString launcherSocketName()
|
static QString launcherSocketName()
|
||||||
{
|
{
|
||||||
return Utils::TemporaryDirectory::masterDirectoryPath()
|
return TemporaryDirectory::masterDirectoryPath()
|
||||||
+ QStringLiteral("/launcher-%1").arg(QString::number(qApp->applicationPid()));
|
+ QStringLiteral("/launcher-%1").arg(QString::number(qApp->applicationPid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,7 +232,7 @@ void LauncherInterface::sendData(const QByteArray &data)
|
|||||||
instance()->m_private->socket()->sendData(data);
|
instance()->m_private->socket()->sendData(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::Internal::CallerHandle *LauncherInterface::registerHandle(QObject *parent, quintptr token)
|
Internal::CallerHandle *LauncherInterface::registerHandle(QObject *parent, quintptr token)
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&s_instanceMutex);
|
QMutexLocker locker(&s_instanceMutex);
|
||||||
return instance()->m_private->socket()->registerHandle(parent, token);
|
return instance()->m_private->socket()->registerHandle(parent, token);
|
||||||
|
@@ -47,13 +47,13 @@ public:
|
|||||||
static void setPathToLauncher(const QString &pathToLauncher);
|
static void setPathToLauncher(const QString &pathToLauncher);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class Utils::Internal::CallerHandle;
|
friend class Internal::CallerHandle;
|
||||||
friend class Utils::Internal::LauncherHandle;
|
friend class Internal::LauncherHandle;
|
||||||
friend class Utils::Internal::ProcessLauncherImpl;
|
friend class Internal::ProcessLauncherImpl;
|
||||||
|
|
||||||
static bool isStarted();
|
static bool isStarted();
|
||||||
static void sendData(const QByteArray &data);
|
static void sendData(const QByteArray &data);
|
||||||
static Utils::Internal::CallerHandle *registerHandle(QObject *parent, quintptr token);
|
static Internal::CallerHandle *registerHandle(QObject *parent, quintptr token);
|
||||||
static void unregisterHandle(quintptr token);
|
static void unregisterHandle(quintptr token);
|
||||||
|
|
||||||
LauncherInterface();
|
LauncherInterface();
|
||||||
|
@@ -25,8 +25,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "environment.h"
|
|
||||||
#include "filepath.h"
|
|
||||||
#include "launcherpackets.h"
|
#include "launcherpackets.h"
|
||||||
#include "processinterface.h"
|
#include "processinterface.h"
|
||||||
|
|
||||||
|
@@ -25,21 +25,21 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "filepath.h"
|
#include "utils_global.h"
|
||||||
#include "porting.h"
|
|
||||||
|
|
||||||
|
#include "filepath.h"
|
||||||
|
|
||||||
|
#include <QMetaType>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <qmetatype.h>
|
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
class QTCREATOR_UTILS_EXPORT Link
|
class QTCREATOR_UTILS_EXPORT Link
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Link(const Utils::FilePath &filePath = Utils::FilePath(), int line = 0, int column = 0)
|
Link(const FilePath &filePath = FilePath(), int line = 0, int column = 0)
|
||||||
: targetFilePath(filePath)
|
: targetFilePath(filePath)
|
||||||
, targetLine(line)
|
, targetLine(line)
|
||||||
, targetColumn(column)
|
, targetColumn(column)
|
||||||
@@ -71,7 +71,7 @@ public:
|
|||||||
int linkTextStart = -1;
|
int linkTextStart = -1;
|
||||||
int linkTextEnd = -1;
|
int linkTextEnd = -1;
|
||||||
|
|
||||||
Utils::FilePath targetFilePath;
|
FilePath targetFilePath;
|
||||||
int targetLine;
|
int targetLine;
|
||||||
int targetColumn;
|
int targetColumn;
|
||||||
};
|
};
|
||||||
|
@@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "utils_global.h"
|
|
||||||
#include "treemodel.h"
|
#include "treemodel.h"
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
@@ -27,11 +27,11 @@
|
|||||||
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
#include <functional>
|
#include <QCoreApplication>
|
||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QCoreApplication>
|
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
#include "algorithm.h"
|
#include "algorithm.h"
|
||||||
#include "runextensions.h"
|
#include "runextensions.h"
|
||||||
|
|
||||||
|
@@ -39,11 +39,11 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "utils_global.h"
|
||||||
|
|
||||||
#include <mimemagicrule_p.h>
|
#include <mimemagicrule_p.h>
|
||||||
#include <mimetype.h>
|
#include <mimetype.h>
|
||||||
|
|
||||||
#include <utils/utils_global.h>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QFileInfo;
|
class QFileInfo;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@@ -25,10 +25,12 @@
|
|||||||
|
|
||||||
#include "minimizableinfobars.h"
|
#include "minimizableinfobars.h"
|
||||||
|
|
||||||
|
#include "infobar.h"
|
||||||
#include "qtcassert.h"
|
#include "qtcassert.h"
|
||||||
#include "qtcsettings.h"
|
#include "qtcsettings.h"
|
||||||
#include "utilsicons.h"
|
#include "utilsicons.h"
|
||||||
|
|
||||||
|
#include <QAction>
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
|
|
||||||
const char SETTINGS_PREFIX[] = "ShowInfoBarFor";
|
const char SETTINGS_PREFIX[] = "ShowInfoBarFor";
|
||||||
|
@@ -28,16 +28,19 @@
|
|||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
#include "id.h"
|
#include "id.h"
|
||||||
#include "infobar.h"
|
|
||||||
|
|
||||||
#include <QAction>
|
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
|
QT_FORWARD_DECLARE_CLASS(QAction)
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
|
class InfoBar;
|
||||||
|
class InfoBarEntry;
|
||||||
|
|
||||||
class QTCREATOR_UTILS_EXPORT MinimizableInfoBars : public QObject
|
class QTCREATOR_UTILS_EXPORT MinimizableInfoBars : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -46,32 +49,32 @@ public:
|
|||||||
using ActionCreator = std::function<QAction *(QWidget *widget)>;
|
using ActionCreator = std::function<QAction *(QWidget *widget)>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit MinimizableInfoBars(Utils::InfoBar &infoBar);
|
explicit MinimizableInfoBars(InfoBar &infoBar);
|
||||||
|
|
||||||
void setSettingsGroup(const QString &settingsGroup);
|
void setSettingsGroup(const QString &settingsGroup);
|
||||||
void setPossibleInfoBarEntries(const QList<Utils::InfoBarEntry> &entries);
|
void setPossibleInfoBarEntries(const QList<InfoBarEntry> &entries);
|
||||||
|
|
||||||
void createShowInfoBarActions(const ActionCreator &actionCreator) const;
|
void createShowInfoBarActions(const ActionCreator &actionCreator) const;
|
||||||
|
|
||||||
void setInfoVisible(const Utils::Id &id, bool visible);
|
void setInfoVisible(const Id &id, bool visible);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void createActions();
|
void createActions();
|
||||||
|
|
||||||
QString settingsKey(const Utils::Id &id) const;
|
QString settingsKey(const Id &id) const;
|
||||||
bool showInInfoBar(const Utils::Id &id) const;
|
bool showInInfoBar(const Id &id) const;
|
||||||
void setShowInInfoBar(const Utils::Id &id, bool show);
|
void setShowInInfoBar(const Id &id, bool show);
|
||||||
|
|
||||||
void updateInfo(const Utils::Id &id);
|
void updateInfo(const Id &id);
|
||||||
|
|
||||||
void showInfoBar(const Utils::Id &id);
|
void showInfoBar(const Id &id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Utils::InfoBar &m_infoBar;
|
InfoBar &m_infoBar;
|
||||||
QString m_settingsGroup;
|
QString m_settingsGroup;
|
||||||
QHash<Utils::Id, QAction *> m_actions;
|
QHash<Id, QAction *> m_actions;
|
||||||
QHash<Utils::Id, bool> m_isInfoVisible;
|
QHash<Id, bool> m_isInfoVisible;
|
||||||
QHash<Utils::Id, Utils::InfoBarEntry> m_infoEntries;
|
QHash<Id, InfoBarEntry> m_infoEntries;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Utils
|
} // namespace Utils
|
||||||
|
@@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "utils_global.h"
|
||||||
|
|
||||||
#include "hostosinfo.h"
|
#include "hostosinfo.h"
|
||||||
#include "namevalueitem.h"
|
#include "namevalueitem.h"
|
||||||
|
|
||||||
|
@@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "utils_global.h"
|
||||||
|
|
||||||
#include "environmentfwd.h"
|
#include "environmentfwd.h"
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
|
@@ -25,9 +25,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "environmentfwd.h"
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
|
#include "environmentfwd.h"
|
||||||
|
|
||||||
#include <QAbstractTableModel>
|
#include <QAbstractTableModel>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
@@ -25,19 +25,17 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "environmentfwd.h"
|
|
||||||
#include "namevalueitem.h"
|
|
||||||
#include "optional.h"
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
|
#include "environmentfwd.h"
|
||||||
|
#include "optional.h"
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_FORWARD_DECLARE_CLASS(QPlainTextEdit)
|
||||||
class QPlainTextEdit;
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
NameValueValidator::NameValueValidator(QWidget *parent,
|
NameValueValidator::NameValueValidator(QWidget *parent,
|
||||||
Utils::NameValueModel *model,
|
NameValueModel *model,
|
||||||
QTreeView *view,
|
QTreeView *view,
|
||||||
const QModelIndex &index,
|
const QModelIndex &index,
|
||||||
const QString &toolTipText)
|
const QString &toolTipText)
|
||||||
@@ -44,7 +44,7 @@ NameValueValidator::NameValueValidator(QWidget *parent,
|
|||||||
{
|
{
|
||||||
m_hideTipTimer.setInterval(2000);
|
m_hideTipTimer.setInterval(2000);
|
||||||
m_hideTipTimer.setSingleShot(true);
|
m_hideTipTimer.setSingleShot(true);
|
||||||
connect(&m_hideTipTimer, &QTimer::timeout, this, []() { Utils::ToolTip::hide(); });
|
connect(&m_hideTipTimer, &QTimer::timeout, this, []() { ToolTip::hide(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
QValidator::State NameValueValidator::validate(QString &in, int &pos) const
|
QValidator::State NameValueValidator::validate(QString &in, int &pos) const
|
||||||
@@ -53,7 +53,7 @@ QValidator::State NameValueValidator::validate(QString &in, int &pos) const
|
|||||||
QModelIndex idx = m_model->variableToIndex(in);
|
QModelIndex idx = m_model->variableToIndex(in);
|
||||||
if (idx.isValid() && idx != m_index)
|
if (idx.isValid() && idx != m_index)
|
||||||
return QValidator::Intermediate;
|
return QValidator::Intermediate;
|
||||||
Utils::ToolTip::hide();
|
ToolTip::hide();
|
||||||
m_hideTipTimer.stop();
|
m_hideTipTimer.stop();
|
||||||
return QValidator::Acceptable;
|
return QValidator::Acceptable;
|
||||||
}
|
}
|
||||||
@@ -65,8 +65,8 @@ void NameValueValidator::fixup(QString &input) const
|
|||||||
if (!m_index.isValid())
|
if (!m_index.isValid())
|
||||||
return;
|
return;
|
||||||
QPoint pos = m_view->mapToGlobal(m_view->visualRect(m_index).topLeft());
|
QPoint pos = m_view->mapToGlobal(m_view->visualRect(m_index).topLeft());
|
||||||
pos -= Utils::ToolTip::offsetFromPosition();
|
pos -= ToolTip::offsetFromPosition();
|
||||||
Utils::ToolTip::show(pos, m_toolTipText);
|
ToolTip::show(pos, m_toolTipText);
|
||||||
m_hideTipTimer.start();
|
m_hideTipTimer.start();
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
@@ -25,22 +25,26 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "environmentfwd.h"
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
#include <QModelIndex>
|
#include "environmentfwd.h"
|
||||||
|
|
||||||
#include <QPersistentModelIndex>
|
#include <QPersistentModelIndex>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QValidator>
|
#include <QValidator>
|
||||||
|
|
||||||
|
QT_FORWARD_DECLARE_CLASS(QModelIndex)
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
|
class NameValueModel;
|
||||||
|
|
||||||
class QTCREATOR_UTILS_EXPORT NameValueValidator : public QValidator
|
class QTCREATOR_UTILS_EXPORT NameValueValidator : public QValidator
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
NameValueValidator(QWidget *parent,
|
NameValueValidator(QWidget *parent,
|
||||||
Utils::NameValueModel *model,
|
NameValueModel *model,
|
||||||
QTreeView *view,
|
QTreeView *view,
|
||||||
const QModelIndex &index,
|
const QModelIndex &index,
|
||||||
const QString &toolTipText);
|
const QString &toolTipText);
|
||||||
@@ -51,7 +55,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
const QString m_toolTipText;
|
const QString m_toolTipText;
|
||||||
Utils::NameValueModel *m_model;
|
NameValueModel *m_model;
|
||||||
QTreeView *m_view;
|
QTreeView *m_view;
|
||||||
QPersistentModelIndex m_index;
|
QPersistentModelIndex m_index;
|
||||||
mutable QTimer m_hideTipTimer;
|
mutable QTimer m_hideTipTimer;
|
||||||
|
@@ -26,7 +26,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
#include "fileutils.h"
|
|
||||||
|
#include "filepath.h"
|
||||||
#include "optional.h"
|
#include "optional.h"
|
||||||
#include "outputformat.h"
|
#include "outputformat.h"
|
||||||
|
|
||||||
|
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
QT_FORWARD_DECLARE_CLASS(QJSEngine);
|
QT_FORWARD_DECLARE_CLASS(QJSEngine)
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user