forked from qt-creator/qt-creator
Utils: Drop unused headers [A-H]
Round 2 - focus on sources. For classes with initial in range [A-H]. Try to keep the same separators between different kind of headers. Change-Id: I838a8324ddd5b4d8d5a51b8f30605f783c663813 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -24,7 +24,8 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "ansiescapecodehandler.h"
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include "qtcassert.h"
|
||||
|
||||
namespace Utils {
|
||||
|
||||
|
@@ -24,9 +24,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "appmainwindow.h"
|
||||
#include "theme/theme_p.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include "theme/theme_p.h"
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
|
@@ -108,7 +108,7 @@ static QVector<Tool> toolsForMimeType(const MimeType &mimeType)
|
||||
|
||||
static QVector<Tool> toolsForFilePath(const FilePath &fp)
|
||||
{
|
||||
return toolsForMimeType(Utils::mimeTypeForFile(fp));
|
||||
return toolsForMimeType(mimeTypeForFile(fp));
|
||||
}
|
||||
|
||||
static Utils::optional<Tool> resolveTool(const Tool &tool)
|
||||
|
@@ -53,8 +53,8 @@ signals:
|
||||
void finished(bool success);
|
||||
|
||||
private:
|
||||
Utils::CommandLine m_commandLine;
|
||||
Utils::FilePath m_workingDirectory;
|
||||
CommandLine m_commandLine;
|
||||
FilePath m_workingDirectory;
|
||||
std::unique_ptr<QtcProcess> m_process;
|
||||
};
|
||||
|
||||
|
@@ -56,7 +56,7 @@ namespace Internal {
|
||||
class BaseAspectPrivate
|
||||
{
|
||||
public:
|
||||
Utils::Id m_id;
|
||||
Id m_id;
|
||||
QVariant m_value;
|
||||
QVariant m_defaultValue;
|
||||
std::function<QVariant(const QVariant &)> m_toSettings;
|
||||
@@ -710,7 +710,7 @@ class TextDisplayPrivate
|
||||
{
|
||||
public:
|
||||
QString m_message;
|
||||
Utils::InfoLabel::InfoType m_type;
|
||||
InfoLabel::InfoType m_type;
|
||||
QPointer<InfoLabel> m_label;
|
||||
};
|
||||
|
||||
@@ -2119,18 +2119,18 @@ void IntegersAspect::emitChangedValue()
|
||||
|
||||
QList<int> IntegersAspect::value() const
|
||||
{
|
||||
return Utils::transform(BaseAspect::value().toList(),
|
||||
return transform(BaseAspect::value().toList(),
|
||||
[](QVariant v) { return v.toInt(); });
|
||||
}
|
||||
|
||||
void IntegersAspect::setValue(const QList<int> &value)
|
||||
{
|
||||
BaseAspect::setValue(Utils::transform(value, &QVariant::fromValue<int>));
|
||||
BaseAspect::setValue(transform(value, &QVariant::fromValue<int>));
|
||||
}
|
||||
|
||||
void IntegersAspect::setDefaultValue(const QList<int> &value)
|
||||
{
|
||||
BaseAspect::setDefaultValue(Utils::transform(value, &QVariant::fromValue<int>));
|
||||
BaseAspect::setDefaultValue(transform(value, &QVariant::fromValue<int>));
|
||||
}
|
||||
|
||||
|
||||
@@ -2252,7 +2252,7 @@ void AspectContainer::registerAspects(const AspectContainer &aspects)
|
||||
*/
|
||||
BaseAspect *AspectContainer::aspect(Id id) const
|
||||
{
|
||||
return Utils::findOrDefault(d->m_items, Utils::equal(&BaseAspect::id, id));
|
||||
return findOrDefault(d->m_items, equal(&BaseAspect::id, id));
|
||||
}
|
||||
|
||||
AspectContainer::const_iterator AspectContainer::begin() const
|
||||
|
@@ -68,8 +68,8 @@ public:
|
||||
BaseAspect();
|
||||
~BaseAspect() override;
|
||||
|
||||
Utils::Id id() const;
|
||||
void setId(Utils::Id id);
|
||||
Id id() const;
|
||||
void setId(Id id);
|
||||
|
||||
QVariant value() const;
|
||||
void setValue(const QVariant &value);
|
||||
@@ -147,7 +147,7 @@ public:
|
||||
|
||||
virtual ~Data() = default;
|
||||
|
||||
Utils::Id id() const { return m_id; }
|
||||
Id id() const { return m_id; }
|
||||
ClassId classId() const { return m_classId; }
|
||||
Data *clone() const { return m_cloner(this); }
|
||||
|
||||
@@ -171,7 +171,7 @@ public:
|
||||
|
||||
protected:
|
||||
friend class BaseAspect;
|
||||
Utils::Id m_id;
|
||||
Id m_id;
|
||||
ClassId m_classId = 0;
|
||||
std::function<Data *(const Data *)> m_cloner;
|
||||
};
|
||||
@@ -349,7 +349,7 @@ public:
|
||||
struct Data : BaseAspect::Data
|
||||
{
|
||||
QString value;
|
||||
Utils::FilePath filePath;
|
||||
FilePath filePath;
|
||||
};
|
||||
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
@@ -370,15 +370,15 @@ public:
|
||||
void setDisplayFilter(const std::function<QString (const QString &)> &displayFilter);
|
||||
void setPlaceHolderText(const QString &placeHolderText);
|
||||
void setHistoryCompleter(const QString &historyCompleterKey);
|
||||
void setExpectedKind(const Utils::PathChooser::Kind expectedKind);
|
||||
void setEnvironmentChange(const Utils::EnvironmentChange &change);
|
||||
void setBaseFileName(const Utils::FilePath &baseFileName);
|
||||
void setExpectedKind(const PathChooser::Kind expectedKind);
|
||||
void setEnvironmentChange(const EnvironmentChange &change);
|
||||
void setBaseFileName(const FilePath &baseFileName);
|
||||
void setUndoRedoEnabled(bool readOnly);
|
||||
void setAcceptRichText(bool acceptRichText);
|
||||
void setMacroExpanderProvider(const Utils::MacroExpanderProvider &expanderProvider);
|
||||
void setMacroExpanderProvider(const MacroExpanderProvider &expanderProvider);
|
||||
void setUseGlobalMacroExpander();
|
||||
void setUseResetButton();
|
||||
void setValidationFunction(const Utils::FancyLineEdit::ValidationFunction &validator);
|
||||
void setValidationFunction(const FancyLineEdit::ValidationFunction &validator);
|
||||
void setOpenTerminalHandler(const std::function<void()> &openTerminal);
|
||||
void setAutoApplyOnEditingFinished(bool applyOnEditingFinished);
|
||||
void setElideMode(Qt::TextElideMode elideMode);
|
||||
@@ -404,9 +404,9 @@ public:
|
||||
void fromMap(const QVariantMap &map) override;
|
||||
void toMap(QVariantMap &map) const override;
|
||||
|
||||
Utils::FilePath filePath() const;
|
||||
void setFilePath(const Utils::FilePath &value);
|
||||
void setDefaultFilePath(const Utils::FilePath &value);
|
||||
FilePath filePath() const;
|
||||
void setFilePath(const FilePath &value);
|
||||
void setDefaultFilePath(const FilePath &value);
|
||||
|
||||
PathChooser *pathChooser() const; // Avoid to use.
|
||||
|
||||
@@ -562,12 +562,12 @@ class QTCREATOR_UTILS_EXPORT TextDisplay : public BaseAspect
|
||||
|
||||
public:
|
||||
TextDisplay(const QString &message = {},
|
||||
Utils::InfoLabel::InfoType type = Utils::InfoLabel::None);
|
||||
InfoLabel::InfoType type = InfoLabel::None);
|
||||
~TextDisplay() override;
|
||||
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
|
||||
void setIconType(Utils::InfoLabel::InfoType t);
|
||||
void setIconType(InfoLabel::InfoType t);
|
||||
void setText(const QString &message);
|
||||
|
||||
private:
|
||||
@@ -579,8 +579,8 @@ class QTCREATOR_UTILS_EXPORT AspectContainerData
|
||||
public:
|
||||
AspectContainerData() = default;
|
||||
|
||||
const BaseAspect::Data *aspect(Utils::Id instanceId) const;
|
||||
const BaseAspect::Data *aspect(Utils::BaseAspect::Data::ClassId classId) const;
|
||||
const BaseAspect::Data *aspect(Id instanceId) const;
|
||||
const BaseAspect::Data *aspect(BaseAspect::Data::ClassId classId) const;
|
||||
|
||||
void append(const BaseAspect::Data::Ptr &data);
|
||||
|
||||
@@ -643,9 +643,9 @@ public:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
BaseAspect *aspect(Utils::Id id) const;
|
||||
BaseAspect *aspect(Id id) const;
|
||||
|
||||
template <typename T> T *aspect(Utils::Id id) const
|
||||
template <typename T> T *aspect(Id id) const
|
||||
{
|
||||
return qobject_cast<T*>(aspect(id));
|
||||
}
|
||||
|
@@ -25,13 +25,12 @@
|
||||
|
||||
#include "basetreeview.h"
|
||||
|
||||
#include "algorithm.h"
|
||||
#include "progressindicator.h"
|
||||
#include "qtcassert.h"
|
||||
#include "qtcsettings.h"
|
||||
#include "treemodel.h"
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFontMetrics>
|
||||
#include <QHeaderView>
|
||||
@@ -638,7 +637,7 @@ ItemViewEvent::ItemViewEvent(QEvent *ev, QAbstractItemView *view)
|
||||
};
|
||||
|
||||
m_sourceModelIndex = fixIndex(m_index);
|
||||
m_selectedRows = Utils::transform(m_selectedRows, fixIndex);
|
||||
m_selectedRows = transform(m_selectedRows, fixIndex);
|
||||
}
|
||||
|
||||
QModelIndexList ItemViewEvent::currentOrSelectedRows() const
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "classnamevalidatinglineedit.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include "qtcassert.h"
|
||||
|
||||
#include <QRegularExpression>
|
||||
|
||||
|
@@ -25,6 +25,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "utils_global.h"
|
||||
|
||||
#include "fancylineedit.h"
|
||||
|
||||
namespace Utils {
|
||||
|
@@ -85,7 +85,7 @@ QTCREATOR_UTILS_EXPORT void writeBeginQtVersionCheck(QTextStream &str)
|
||||
static void qtSection(const QStringList &qtIncludes, QTextStream &str)
|
||||
{
|
||||
QStringList sorted = qtIncludes;
|
||||
Utils::sort(sorted);
|
||||
sort(sorted);
|
||||
for (const QString &inc : qAsConst(sorted)) {
|
||||
if (!inc.isEmpty())
|
||||
str << QStringLiteral("#include <%1>\n").arg(inc);
|
||||
@@ -105,8 +105,8 @@ void writeQtIncludeSection(const QStringList &qt4,
|
||||
else
|
||||
trans = [](const QString &i) { return i.mid(i.indexOf(QLatin1Char('/')) + 1); };
|
||||
|
||||
QSet<QString> qt4Only = Utils::transform<QSet>(qt4, trans);
|
||||
QSet<QString> qt5Only = Utils::transform<QSet>(qt5, trans);
|
||||
QSet<QString> qt4Only = transform<QSet>(qt4, trans);
|
||||
QSet<QString> qt5Only = transform<QSet>(qt5, trans);
|
||||
|
||||
if (addQtVersionCheck) {
|
||||
QSet<QString> common = qt4Only;
|
||||
@@ -121,23 +121,23 @@ void writeQtIncludeSection(const QStringList &qt4,
|
||||
qt4Only.subtract(common);
|
||||
qt5Only.subtract(common);
|
||||
|
||||
qtSection(Utils::toList(common), str);
|
||||
qtSection(toList(common), str);
|
||||
|
||||
if (!qt4Only.isEmpty() || !qt5Only.isEmpty()) {
|
||||
if (addQtVersionCheck)
|
||||
writeBeginQtVersionCheck(str);
|
||||
qtSection(Utils::toList(qt5Only), str);
|
||||
qtSection(toList(qt5Only), str);
|
||||
if (addQtVersionCheck)
|
||||
str << QLatin1String("#else\n");
|
||||
qtSection(Utils::toList(qt4Only), str);
|
||||
qtSection(toList(qt4Only), str);
|
||||
if (addQtVersionCheck)
|
||||
str << QLatin1String("#endif\n");
|
||||
}
|
||||
} else {
|
||||
if (!qt5Only.isEmpty()) // default to Qt5
|
||||
qtSection(Utils::toList(qt5Only), str);
|
||||
qtSection(toList(qt5Only), str);
|
||||
else
|
||||
qtSection(Utils::toList(qt4Only), str);
|
||||
qtSection(toList(qt4Only), str);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -24,6 +24,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "delegates.h"
|
||||
|
||||
#include "completinglineedit.h"
|
||||
|
||||
#include <QPainter>
|
||||
|
@@ -24,11 +24,11 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "detailsbutton.h"
|
||||
|
||||
#include "hostosinfo.h"
|
||||
#include "theme/theme.h"
|
||||
|
||||
#include <QGraphicsOpacityEffect>
|
||||
#include <QGuiApplication>
|
||||
#include <QPropertyAnimation>
|
||||
#include <QPaintEvent>
|
||||
#include <QPainter>
|
||||
|
@@ -24,6 +24,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "detailswidget.h"
|
||||
|
||||
#include "detailsbutton.h"
|
||||
#include "hostosinfo.h"
|
||||
#include "theme/theme.h"
|
||||
|
@@ -510,8 +510,8 @@ void Differ::unifiedDiffWithWhitespaceReduced(const QString &leftInput,
|
||||
*/
|
||||
static QString encodeExpandedWhitespace(const QString &leftEquality,
|
||||
const QString &rightEquality,
|
||||
QMap<int, QPair<int, QString> > *leftCodeMap,
|
||||
QMap<int, QPair<int, QString> > *rightCodeMap,
|
||||
QMap<int, QPair<int, QString>> *leftCodeMap,
|
||||
QMap<int, QPair<int, QString>> *rightCodeMap,
|
||||
bool *ok)
|
||||
{
|
||||
if (ok)
|
||||
@@ -586,7 +586,7 @@ static QString encodeExpandedWhitespace(const QString &leftEquality,
|
||||
* the returned value contains decoded diff list.
|
||||
*/
|
||||
static QList<Diff> decodeExpandedWhitespace(const QList<Diff> &input,
|
||||
const QMap<int, QPair<int, QString> > &codeMap,
|
||||
const QMap<int, QPair<int, QString>> &codeMap,
|
||||
bool *ok)
|
||||
{
|
||||
if (ok)
|
||||
@@ -651,16 +651,16 @@ static bool diffWithWhitespaceExpandedInEqualities(const QList<Diff> &leftInput,
|
||||
QString leftText;
|
||||
QString rightText;
|
||||
|
||||
QMap<int, QPair<int, QString> > commonLeftCodeMap;
|
||||
QMap<int, QPair<int, QString> > commonRightCodeMap;
|
||||
QMap<int, QPair<int, QString>> commonLeftCodeMap;
|
||||
QMap<int, QPair<int, QString>> commonRightCodeMap;
|
||||
|
||||
while (l <= leftCount && r <= rightCount) {
|
||||
const Diff leftDiff = l < leftCount ? leftInput.at(l) : Diff(Diff::Equal);
|
||||
const Diff rightDiff = r < rightCount ? rightInput.at(r) : Diff(Diff::Equal);
|
||||
|
||||
if (leftDiff.command == Diff::Equal && rightDiff.command == Diff::Equal) {
|
||||
QMap<int, QPair<int, QString> > leftCodeMap;
|
||||
QMap<int, QPair<int, QString> > rightCodeMap;
|
||||
QMap<int, QPair<int, QString>> leftCodeMap;
|
||||
QMap<int, QPair<int, QString>> rightCodeMap;
|
||||
|
||||
bool ok = false;
|
||||
const QString &commonEquality = encodeExpandedWhitespace(leftDiff.text,
|
||||
|
@@ -24,10 +24,10 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "elfreader.h"
|
||||
|
||||
#include "qtcassert.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QDebug>
|
||||
#include <QtEndian>
|
||||
|
||||
#include <new> // std::bad_alloc
|
||||
|
@@ -24,6 +24,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "elidinglabel.h"
|
||||
|
||||
#include <QFontMetrics>
|
||||
#include <QPainter>
|
||||
#include <QStyle>
|
||||
|
@@ -29,11 +29,9 @@
|
||||
#include "fileutils.h"
|
||||
#include "qtcassert.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QProcessEnvironment>
|
||||
#include <QSet>
|
||||
#include <QCoreApplication>
|
||||
|
||||
namespace Utils {
|
||||
|
||||
|
@@ -25,13 +25,7 @@
|
||||
|
||||
#include "environmentdialog.h"
|
||||
|
||||
#include <utils/environment.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QPlainTextEdit>
|
||||
#include <QLabel>
|
||||
#include "environment.h"
|
||||
|
||||
namespace Utils {
|
||||
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "environmentmodel.h"
|
||||
|
||||
#include <utils/environment.h>
|
||||
#include "environment.h"
|
||||
|
||||
namespace Utils {
|
||||
const Environment &EnvironmentModel::baseEnvironment() const
|
||||
|
@@ -23,9 +23,10 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "fancylineedit.h"
|
||||
|
||||
#include "camelcasecursor.h"
|
||||
#include "execmenu.h"
|
||||
#include "fancylineedit.h"
|
||||
#include "historycompleter.h"
|
||||
#include "hostosinfo.h"
|
||||
#include "optional.h"
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include "filesearch.h"
|
||||
|
||||
#include "algorithm.h"
|
||||
#include "fileutils.h"
|
||||
#include "filepath.h"
|
||||
#include "mapreduce.h"
|
||||
#include "qtcassert.h"
|
||||
#include "stringutils.h"
|
||||
|
@@ -24,6 +24,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "headerviewstretcher.h"
|
||||
|
||||
#include <QHideEvent>
|
||||
#include <QHeaderView>
|
||||
|
||||
|
Reference in New Issue
Block a user