summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2022-05-24 12:14:24 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2022-05-25 07:18:44 +0000
commit304ab10642127253fe5128c095a023aa707f798c (patch)
tree0d85c0fd994b2edb7d83cb127a18819477e05d5b
parent9508ee134781a11e72ac38180e07d16b8fb135dd (diff)
downloadqt-creator-304ab10642127253fe5128c095a023aa707f798c.tar.gz
Utils: More forward declarations / drop unused headers [P-R]
Round 1 - focus on headers. For classes with initial in range [P-R]. Try to keep the same separators between different kind of headers. Change-Id: I01fb80b93164a7fe4c0bd2cd8f9e4f27523efefa Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
-rw-r--r--src/libs/advanceddockingsystem/dockmanager.cpp1
-rw-r--r--src/libs/utils/pathchooser.cpp3
-rw-r--r--src/libs/utils/pathchooser.h8
-rw-r--r--src/libs/utils/pathlisteditor.h4
-rw-r--r--src/libs/utils/persistentsettings.cpp3
-rw-r--r--src/libs/utils/persistentsettings.h3
-rw-r--r--src/libs/utils/port.cpp4
-rw-r--r--src/libs/utils/port.h1
-rw-r--r--src/libs/utils/portlist.h1
-rw-r--r--src/libs/utils/processenums.h1
-rw-r--r--src/libs/utils/processinfo.cpp2
-rw-r--r--src/libs/utils/processinterface.h2
-rw-r--r--src/libs/utils/processutils.h1
-rw-r--r--src/libs/utils/progressindicator.h4
-rw-r--r--src/libs/utils/projectintropage.cpp1
-rw-r--r--src/libs/utils/projectintropage.h4
-rw-r--r--src/libs/utils/proxycredentialsdialog.h1
-rw-r--r--src/libs/utils/qrcparser.h10
-rw-r--r--src/libs/utils/qtcprocess.cpp6
-rw-r--r--src/libs/utils/runextensions.h7
-rw-r--r--src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h1
-rw-r--r--src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp2
22 files changed, 43 insertions, 27 deletions
diff --git a/src/libs/advanceddockingsystem/dockmanager.cpp b/src/libs/advanceddockingsystem/dockmanager.cpp
index a4c81ff244..31d6c5ee3f 100644
--- a/src/libs/advanceddockingsystem/dockmanager.cpp
+++ b/src/libs/advanceddockingsystem/dockmanager.cpp
@@ -49,6 +49,7 @@
#include "workspacedialog.h"
#include <utils/algorithm.h>
+#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <algorithm>
diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp
index a46825a3fb..12bc2ac309 100644
--- a/src/libs/utils/pathchooser.cpp
+++ b/src/libs/utils/pathchooser.cpp
@@ -27,6 +27,7 @@
#include "commandline.h"
#include "environment.h"
+#include "fileutils.h"
#include "hostosinfo.h"
#include "macroexpander.h"
#include "qtcassert.h"
@@ -231,7 +232,7 @@ FilePath PathChooserPrivate::expandedPath(const QString &input) const
case PathChooser::File:
case PathChooser::SaveFile:
if (!m_baseDirectory.isEmpty()) {
- Utils::FilePath fp = m_baseDirectory.resolvePath(path.path()).absoluteFilePath();
+ FilePath fp = m_baseDirectory.resolvePath(path.path()).absoluteFilePath();
// FIXME bad hotfix for manually editing PathChooser (invalid paths, jumping cursor)
// examples: have an absolute path and try to change the device letter by typing the new
// letter and removing the original afterwards ends up in
diff --git a/src/libs/utils/pathchooser.h b/src/libs/utils/pathchooser.h
index ddc68b227e..6e1760d391 100644
--- a/src/libs/utils/pathchooser.h
+++ b/src/libs/utils/pathchooser.h
@@ -25,8 +25,10 @@
#pragma once
+#include "utils_global.h"
+
#include "fancylineedit.h"
-#include "fileutils.h"
+#include "filepath.h"
#include <QWidget>
@@ -35,11 +37,9 @@ class QAbstractButton;
class QLineEdit;
QT_END_NAMESPACE
-
namespace Utils {
class CommandLine;
-class FancyLineEdit;
class MacroExpander;
class Environment;
class EnvironmentChange;
@@ -126,7 +126,7 @@ public:
void setCommandVersionArguments(const QStringList &arguments);
// Utility to run a tool and return its stdout.
- static QString toolVersion(const Utils::CommandLine &cmd);
+ static QString toolVersion(const CommandLine &cmd);
// Install a tooltip on lineedits used for binaries showing the version.
static void installLineEditVersionToolTip(QLineEdit *le, const QStringList &arguments);
diff --git a/src/libs/utils/pathlisteditor.h b/src/libs/utils/pathlisteditor.h
index a7c61448d1..5f65531122 100644
--- a/src/libs/utils/pathlisteditor.h
+++ b/src/libs/utils/pathlisteditor.h
@@ -31,9 +31,7 @@
#include <functional>
-QT_BEGIN_NAMESPACE
-class QPushButton;
-QT_END_NAMESPACE
+QT_FORWARD_DECLARE_CLASS(QPushButton)
namespace Utils {
diff --git a/src/libs/utils/persistentsettings.cpp b/src/libs/utils/persistentsettings.cpp
index 092727a3aa..a6aa0e9dd9 100644
--- a/src/libs/utils/persistentsettings.cpp
+++ b/src/libs/utils/persistentsettings.cpp
@@ -25,6 +25,9 @@
#include "persistentsettings.h"
+#include "fileutils.h"
+
+#include <QCoreApplication>
#include <QDateTime>
#include <QDebug>
#include <QDir>
diff --git a/src/libs/utils/persistentsettings.h b/src/libs/utils/persistentsettings.h
index 20802ea263..9ffb819155 100644
--- a/src/libs/utils/persistentsettings.h
+++ b/src/libs/utils/persistentsettings.h
@@ -25,9 +25,10 @@
#pragma once
-#include "fileutils.h"
#include "utils_global.h"
+#include "filepath.h"
+
#include <QVariant>
QT_BEGIN_NAMESPACE
diff --git a/src/libs/utils/port.cpp b/src/libs/utils/port.cpp
index a130810316..15a45f8424 100644
--- a/src/libs/utils/port.cpp
+++ b/src/libs/utils/port.cpp
@@ -43,7 +43,7 @@ QList<Port> Port::parseFromSedOutput(const QByteArray &output)
if (portString.size() != 4)
continue;
bool ok;
- const Utils::Port port(portString.toInt(&ok, 16));
+ const Port port(portString.toInt(&ok, 16));
if (ok) {
if (!ports.contains(port))
ports << port;
@@ -60,7 +60,7 @@ QList<Port> Port::parseFromNetstatOutput(const QByteArray &output)
QList<Port> ports;
const QList<QByteArray> lines = output.split('\n');
for (const QByteArray &line : lines) {
- const Port port(Utils::parseUsedPortFromNetstatOutput(line));
+ const Port port(parseUsedPortFromNetstatOutput(line));
if (port.isValid() && !ports.contains(port))
ports.append(port);
}
diff --git a/src/libs/utils/port.h b/src/libs/utils/port.h
index a22673bd18..3d88d99328 100644
--- a/src/libs/utils/port.h
+++ b/src/libs/utils/port.h
@@ -26,6 +26,7 @@
#pragma once
#include "utils_global.h"
+
#include "qtcassert.h"
#include <QMetaType>
diff --git a/src/libs/utils/portlist.h b/src/libs/utils/portlist.h
index 49adf3ae0b..911fbd0e7a 100644
--- a/src/libs/utils/portlist.h
+++ b/src/libs/utils/portlist.h
@@ -26,6 +26,7 @@
#pragma once
#include "utils_global.h"
+
#include "port.h"
QT_FORWARD_DECLARE_CLASS(QString)
diff --git a/src/libs/utils/processenums.h b/src/libs/utils/processenums.h
index 6be5bcd5f1..f755a812ea 100644
--- a/src/libs/utils/processenums.h
+++ b/src/libs/utils/processenums.h
@@ -26,6 +26,7 @@
#pragma once
#include <QMetaType>
+
#include <functional>
namespace Utils {
diff --git a/src/libs/utils/processinfo.cpp b/src/libs/utils/processinfo.cpp
index 98776784dc..1575c0fe63 100644
--- a/src/libs/utils/processinfo.cpp
+++ b/src/libs/utils/processinfo.cpp
@@ -191,7 +191,7 @@ QList<ProcessInfo> ProcessInfo::processInfoList()
ProcessInfo p;
p.processId = pe.th32ProcessID;
// Image has the absolute path, but can fail.
- const QString image = Utils::imageName(pe.th32ProcessID);
+ const QString image = imageName(pe.th32ProcessID);
p.executable = p.commandLine = image.isEmpty() ?
QString::fromWCharArray(pe.szExeFile) : image;
processes << p;
diff --git a/src/libs/utils/processinterface.h b/src/libs/utils/processinterface.h
index e97efeb84c..0295f92d0c 100644
--- a/src/libs/utils/processinterface.h
+++ b/src/libs/utils/processinterface.h
@@ -96,7 +96,7 @@ signals:
// This should be emitted when being in Starting or Running state.
// When being in Starting state, the resultData should set error to FailedToStart.
// After emitting this signal the process enters NotRunning state.
- void done(const Utils::ProcessResultData &resultData);
+ void done(const ProcessResultData &resultData);
protected:
static int controlSignalToInt(ControlSignal controlSignal);
diff --git a/src/libs/utils/processutils.h b/src/libs/utils/processutils.h
index 0ffa811747..141de2d4fd 100644
--- a/src/libs/utils/processutils.h
+++ b/src/libs/utils/processutils.h
@@ -26,7 +26,6 @@
#pragma once
#include "processenums.h"
-#include "processreaper.h"
#include <QIODevice>
#include <QProcess>
diff --git a/src/libs/utils/progressindicator.h b/src/libs/utils/progressindicator.h
index 1cf41806c8..9ec6d40b9e 100644
--- a/src/libs/utils/progressindicator.h
+++ b/src/libs/utils/progressindicator.h
@@ -25,11 +25,11 @@
#pragma once
-#include "overlaywidget.h"
#include "utils_global.h"
+#include "overlaywidget.h"
+
#include <QTimer>
-#include <QWidget>
#include <functional>
#include <memory>
diff --git a/src/libs/utils/projectintropage.cpp b/src/libs/utils/projectintropage.cpp
index e5189759b0..6a34791962 100644
--- a/src/libs/utils/projectintropage.cpp
+++ b/src/libs/utils/projectintropage.cpp
@@ -27,6 +27,7 @@
#include "ui_projectintropage.h"
#include "filenamevalidatinglineedit.h"
+#include "fileutils.h"
#include "wizard.h"
#include <QDir>
diff --git a/src/libs/utils/projectintropage.h b/src/libs/utils/projectintropage.h
index ea755d671e..4508039b06 100644
--- a/src/libs/utils/projectintropage.h
+++ b/src/libs/utils/projectintropage.h
@@ -39,7 +39,7 @@ class QTCREATOR_UTILS_EXPORT ProjectIntroPage : public WizardPage
{
Q_OBJECT
Q_PROPERTY(QString description READ description WRITE setDescription DESIGNABLE true)
- Q_PROPERTY(FilePath filePath READ filePath WRITE setFilePath DESIGNABLE true)
+ Q_PROPERTY(Utils::FilePath filePath READ filePath WRITE setFilePath DESIGNABLE true)
Q_PROPERTY(QString projectName READ projectName WRITE setProjectName DESIGNABLE true)
Q_PROPERTY(bool useAsDefaultPath READ useAsDefaultPath WRITE setUseAsDefaultPath DESIGNABLE true)
Q_PROPERTY(bool forceSubProject READ forceSubProject WRITE setForceSubProject DESIGNABLE true)
@@ -61,7 +61,7 @@ public:
bool forceSubProject() const;
void setForceSubProject(bool force);
void setProjectList(const QStringList &projectList);
- void setProjectDirectories(const Utils::FilePaths &directoryList);
+ void setProjectDirectories(const FilePaths &directoryList);
int projectIndex() const;
bool validateProjectName(const QString &name, QString *errorMessage);
diff --git a/src/libs/utils/proxycredentialsdialog.h b/src/libs/utils/proxycredentialsdialog.h
index 13f380a15c..8c79af0147 100644
--- a/src/libs/utils/proxycredentialsdialog.h
+++ b/src/libs/utils/proxycredentialsdialog.h
@@ -26,6 +26,7 @@
#pragma once
#include "utils_global.h"
+
#include <QDialog>
QT_FORWARD_DECLARE_CLASS(QNetworkProxy)
diff --git a/src/libs/utils/qrcparser.h b/src/libs/utils/qrcparser.h
index 49e1f9e924..665df44548 100644
--- a/src/libs/utils/qrcparser.h
+++ b/src/libs/utils/qrcparser.h
@@ -24,14 +24,18 @@
****************************************************************************/
#pragma once
+
#include "utils_global.h"
-#include <QMap>
#include <QSharedPointer>
#include <QString>
#include <QStringList>
-QT_FORWARD_DECLARE_CLASS(QLocale)
+QT_BEGIN_NAMESPACE
+class QLocale;
+template <typename K, typename V>
+class QMap;
+QT_END_NAMESPACE
namespace Utils {
@@ -50,7 +54,7 @@ public:
QString firstFileAtPath(const QString &path, const QLocale &locale) const;
void collectFilesAtPath(const QString &path, QStringList *res, const QLocale *locale = nullptr) const;
bool hasDirAtPath(const QString &path, const QLocale *locale = nullptr) const;
- void collectFilesInPath(const QString &path, QMap<QString,QStringList> *res, bool addDirs = false,
+ void collectFilesInPath(const QString &path, QMap<QString, QStringList> *res, bool addDirs = false,
const QLocale *locale = nullptr) const;
void collectResourceFilesForSourceFile(const QString &sourceFile, QStringList *results,
const QLocale *locale = nullptr) const;
diff --git a/src/libs/utils/qtcprocess.cpp b/src/libs/utils/qtcprocess.cpp
index c0cf93fb33..deb10d3944 100644
--- a/src/libs/utils/qtcprocess.cpp
+++ b/src/libs/utils/qtcprocess.cpp
@@ -793,9 +793,9 @@ bool QtcProcessPrivate::flushFor(SignalType signalType)
QList<ProcessInterfaceSignal *> oldSignals;
{
QMutexLocker locker(&m_mutex);
- const QList<SignalType> storedSignals =
- Utils::transform(qAsConst(m_signals), [](const ProcessInterfaceSignal *aSignal) {
- return aSignal->signalType();
+ const QList<SignalType> storedSignals = transform(qAsConst(m_signals),
+ [](const ProcessInterfaceSignal *aSignal) {
+ return aSignal->signalType();
});
// If we are flushing for ReadyRead or Done - flush all.
diff --git a/src/libs/utils/runextensions.h b/src/libs/utils/runextensions.h
index e7b9dd6c93..6fed1cbae0 100644
--- a/src/libs/utils/runextensions.h
+++ b/src/libs/utils/runextensions.h
@@ -25,9 +25,10 @@
#pragma once
+#include "utils_global.h"
+
#include "functiontraits.h"
#include "optional.h"
-#include "utils_global.h"
#include <QCoreApplication>
#include <QFuture>
@@ -481,7 +482,7 @@ runAsync(QThread::Priority priority, Function &&function, Args&&... args)
template<typename Function,
typename... Args,
typename ResultType = typename Internal::resultType<Function>::type>
-QFuture<ResultType> runAsync(Utils::StackSizeInBytes stackSize, Function &&function, Args &&... args)
+QFuture<ResultType> runAsync(StackSizeInBytes stackSize, Function &&function, Args &&... args)
{
return Internal::runAsync_internal(static_cast<QThreadPool *>(nullptr),
stackSize,
@@ -500,7 +501,7 @@ QFuture<ResultType> runAsync(Utils::StackSizeInBytes stackSize, Function &&funct
template<typename Function,
typename... Args,
typename ResultType = typename Internal::resultType<Function>::type>
-QFuture<ResultType> runAsync(Utils::StackSizeInBytes stackSize,
+QFuture<ResultType> runAsync(StackSizeInBytes stackSize,
QThread::Priority priority,
Function &&function,
Args &&... args)
diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h
index db8a1b06fb..17904cfd1b 100644
--- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h
+++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h
@@ -27,6 +27,7 @@
#include "jsonfieldpage.h"
+#include <utils/fileutils.h>
#include <utils/pathchooser.h>
#include <QWidget>
diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp
index 903aed598e..60663cb3c0 100644
--- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp
+++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwizardpages.cpp
@@ -30,6 +30,8 @@
#include "sshkeycreationdialog.h"
#include <projectexplorer/devicesupport/sshparameters.h>
+
+#include <utils/fileutils.h>
#include <utils/pathchooser.h>
#include <utils/utilsicons.h>