forked from qt-creator/qt-creator
Utils: More forward declarations / drop unused headers [S]
Round 1 - focus on headers. For classes with initial in range [S]. Try to keep the same separators between different kind of headers. SmallString[xxx] classes skipped for now. Change-Id: Ie5c8edcb028e33eb8f9619e646afc462b91dca73 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include <QDataStream>
|
||||
#include <QDebug>
|
||||
#include <QOperatingSystemVersion>
|
||||
#include <QTemporaryFile>
|
||||
#include <QTextStream>
|
||||
#include <QXmlStreamWriter>
|
||||
|
||||
|
@@ -34,6 +34,8 @@
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#include <QTemporaryFile>
|
||||
|
||||
namespace Utils {
|
||||
|
||||
static QFile::Permissions m_umask;
|
||||
|
@@ -27,7 +27,9 @@
|
||||
|
||||
#include "utils_global.h"
|
||||
|
||||
#include <QTemporaryFile>
|
||||
#include <QFile>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QTemporaryFile)
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "algorithm.h"
|
||||
#include "qtcassert.h"
|
||||
#include "persistentsettings.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDir>
|
||||
@@ -72,6 +73,8 @@ applicationDisplayName(applicationDisplayName)
|
||||
QTC_CHECK(!applicationDisplayName.isEmpty());
|
||||
}
|
||||
|
||||
SettingsAccessor::~SettingsAccessor() = default;
|
||||
|
||||
/*!
|
||||
* Restore settings from disk and report any issues in a message box centered on \a parent.
|
||||
*/
|
||||
@@ -299,7 +302,7 @@ BackingUpSettingsAccessor::writeData(const FilePath &path, const QVariantMap &da
|
||||
|
||||
FilePaths BackingUpSettingsAccessor::readFileCandidates(const FilePath &path) const
|
||||
{
|
||||
FilePaths result = Utils::filteredUnique(m_strategy->readFileCandidates(path));
|
||||
FilePaths result = filteredUnique(m_strategy->readFileCandidates(path));
|
||||
if (result.removeOne(baseFilePath()))
|
||||
result.prepend(baseFilePath());
|
||||
|
||||
@@ -746,7 +749,7 @@ static QVariant mergeQVariantMapsRecursion(const QVariantMap &mainTree, const QV
|
||||
const SettingsMergeFunction &merge)
|
||||
{
|
||||
QVariantMap result;
|
||||
const QList<QString> allKeys = Utils::filteredUnique(mainSubtree.keys() + secondarySubtree.keys());
|
||||
const QList<QString> allKeys = filteredUnique(mainSubtree.keys() + secondarySubtree.keys());
|
||||
|
||||
MergingSettingsAccessor::SettingsMergeData global = {mainTree, secondaryTree, QString()};
|
||||
MergingSettingsAccessor::SettingsMergeData local = {mainSubtree, secondarySubtree, QString()};
|
||||
|
@@ -27,9 +27,8 @@
|
||||
|
||||
#include "utils_global.h"
|
||||
|
||||
#include "fileutils.h"
|
||||
#include "filepath.h"
|
||||
#include "optional.h"
|
||||
#include "persistentsettings.h"
|
||||
|
||||
#include <QHash>
|
||||
#include <QMessageBox>
|
||||
@@ -63,6 +62,7 @@ QTCREATOR_UTILS_EXPORT void setVersionInMap(QVariantMap &data, int version);
|
||||
QTCREATOR_UTILS_EXPORT void setOriginalVersionInMap(QVariantMap &data, int version);
|
||||
QTCREATOR_UTILS_EXPORT void setSettingsIdInMap(QVariantMap &data, const QByteArray &id);
|
||||
|
||||
class PersistentSettingsWriter;
|
||||
using SettingsMergeResult = optional<QPair<QString, QVariant>>;
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
@@ -75,7 +75,7 @@ class QTCREATOR_UTILS_EXPORT SettingsAccessor
|
||||
public:
|
||||
SettingsAccessor(const QString &docType, const QString &displayName,
|
||||
const QString &applicationDisplayName);
|
||||
virtual ~SettingsAccessor() = default;
|
||||
virtual ~SettingsAccessor();
|
||||
|
||||
enum ProceedInfo { Continue, DiscardAndContinue };
|
||||
using ButtonMap = QHash<QMessageBox::StandardButton, ProceedInfo>;
|
||||
|
@@ -203,7 +203,7 @@ void ShellCommand::execute()
|
||||
if (d->m_jobs.empty())
|
||||
return;
|
||||
|
||||
QFuture<void> task = Utils::runAsync(&ShellCommand::run, this);
|
||||
QFuture<void> task = runAsync(&ShellCommand::run, this);
|
||||
d->m_watcher.setFuture(task);
|
||||
if (!(d->m_flags & SuppressCommandLogging))
|
||||
addTask(task);
|
||||
|
@@ -149,7 +149,7 @@ signals:
|
||||
void append(const QString &text);
|
||||
void appendSilently(const QString &text);
|
||||
void appendError(const QString &text);
|
||||
void appendCommand(const Utils::FilePath &workingDirectory, const Utils::CommandLine &command);
|
||||
void appendCommand(const FilePath &workingDirectory, const CommandLine &command);
|
||||
void appendMessage(const QString &text);
|
||||
|
||||
protected:
|
||||
|
@@ -92,7 +92,7 @@ QTCREATOR_UTILS_EXPORT QString commonPrefix(const QStringList &strings)
|
||||
|
||||
QTCREATOR_UTILS_EXPORT QString commonPath(const QStringList &files)
|
||||
{
|
||||
QStringList appendedSlashes = Utils::transform(files, [](const QString &file) -> QString {
|
||||
QStringList appendedSlashes = transform(files, [](const QString &file) -> QString {
|
||||
if (!file.endsWith('/'))
|
||||
return QString(file + '/');
|
||||
return file;
|
||||
|
Reference in New Issue
Block a user