forked from qt-creator/qt-creator
Git: Modernize
modernize-use-using modernize-use-default-member-init modernize-use-equals-default Change-Id: Iaccd5611cfc2056d357a0545f8522f02d6f8f0ed Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -90,7 +90,7 @@ class CommitData
|
||||
public:
|
||||
CommitData(CommitType type = SimpleCommit);
|
||||
// A pair of state string/file name ('modified', 'file.cpp').
|
||||
typedef QPair<FileStates, QString> StateFilePair;
|
||||
using StateFilePair = QPair<FileStates, QString>;
|
||||
|
||||
void clear();
|
||||
// Parse the files and the branch of panelInfo
|
||||
|
||||
@@ -140,9 +140,9 @@ static inline void applyApproval(int approval, int *total)
|
||||
// by a type character followed by the approval level: "C: -2, S: 1"
|
||||
QString GerritPatchSet::approvalsColumn() const
|
||||
{
|
||||
typedef QMap<QChar, int> TypeReviewMap;
|
||||
typedef TypeReviewMap::iterator TypeReviewMapIterator;
|
||||
typedef TypeReviewMap::const_iterator TypeReviewMapConstIterator;
|
||||
using TypeReviewMap = QMap<QChar, int>;
|
||||
using TypeReviewMapIterator = TypeReviewMap::iterator;
|
||||
using TypeReviewMapConstIterator = TypeReviewMap::const_iterator;
|
||||
|
||||
QString result;
|
||||
if (approvals.isEmpty())
|
||||
@@ -398,8 +398,7 @@ GerritModel::GerritModel(const QSharedPointer<GerritParameters> &p, QObject *par
|
||||
setHorizontalHeaderLabels(headers);
|
||||
}
|
||||
|
||||
GerritModel::~GerritModel()
|
||||
{ }
|
||||
GerritModel::~GerritModel() = default;
|
||||
|
||||
QVariant GerritModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
|
||||
@@ -38,17 +38,14 @@ class QueryContext;
|
||||
|
||||
class GerritApproval {
|
||||
public:
|
||||
GerritApproval() : approval(-1) {}
|
||||
|
||||
QString type; // Review type
|
||||
QString description; // Type description, possibly empty
|
||||
GerritUser reviewer;
|
||||
int approval;
|
||||
int approval = -1;
|
||||
};
|
||||
|
||||
class GerritPatchSet {
|
||||
public:
|
||||
GerritPatchSet() : patchSetNumber(1) {}
|
||||
QString approvalsToHtml() const;
|
||||
QString approvalsColumn() const;
|
||||
bool hasApproval(const GerritUser &user) const;
|
||||
@@ -56,7 +53,7 @@ public:
|
||||
|
||||
QString url;
|
||||
QString ref;
|
||||
int patchSetNumber;
|
||||
int patchSetNumber = 1;
|
||||
QList<GerritApproval> approvals;
|
||||
};
|
||||
|
||||
@@ -82,7 +79,7 @@ public:
|
||||
int depth = -1;
|
||||
};
|
||||
|
||||
typedef QSharedPointer<GerritChange> GerritChangePtr;
|
||||
using GerritChangePtr = QSharedPointer<GerritChange>;
|
||||
|
||||
class GerritModel : public QStandardItemModel
|
||||
{
|
||||
|
||||
@@ -270,9 +270,7 @@ GerritPlugin::GerritPlugin(QObject *parent)
|
||||
{
|
||||
}
|
||||
|
||||
GerritPlugin::~GerritPlugin()
|
||||
{
|
||||
}
|
||||
GerritPlugin::~GerritPlugin() = default;
|
||||
|
||||
bool GerritPlugin::initialize(ActionContainer *ac)
|
||||
{
|
||||
|
||||
@@ -66,8 +66,8 @@ private:
|
||||
void updateCommits(int index);
|
||||
void validate();
|
||||
|
||||
typedef QPair<QString, QDate> BranchDate;
|
||||
typedef QMultiMap<QString, BranchDate> RemoteBranchesMap;
|
||||
using BranchDate = QPair<QString, QDate>;
|
||||
using RemoteBranchesMap = QMultiMap<QString, BranchDate>;
|
||||
|
||||
QString determineRemoteBranch(const QString &localBranch);
|
||||
void initRemoteBranches();
|
||||
|
||||
@@ -2027,8 +2027,8 @@ bool GitClient::isValidRevision(const QString &revision) const
|
||||
{
|
||||
if (revision.length() < 1)
|
||||
return false;
|
||||
for (int i = 0; i < revision.length(); ++i)
|
||||
if (revision.at(i) != '0')
|
||||
for (const auto i : revision)
|
||||
if (i != '0')
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
QString ignore;
|
||||
};
|
||||
|
||||
typedef QMap<QString, SubmoduleData> SubmoduleDataMap;
|
||||
using SubmoduleDataMap = QMap<QString, SubmoduleData>;
|
||||
|
||||
class GitClient : public VcsBase::VcsBaseClientImpl
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ class BranchDialog;
|
||||
class BranchViewFactory;
|
||||
class RemoteDialog;
|
||||
|
||||
typedef void (GitClient::*GitClientMemberFunc)(const QString &);
|
||||
using GitClientMemberFunc = void (GitClient::*)(const QString &);
|
||||
|
||||
class GitPlugin : public VcsBase::VcsBasePlugin
|
||||
{
|
||||
|
||||
@@ -109,9 +109,7 @@ GitSubmitEditor::GitSubmitEditor(const VcsBaseSubmitEditorParameters *parameters
|
||||
this, &GitSubmitEditor::commitDataRetrieved);
|
||||
}
|
||||
|
||||
GitSubmitEditor::~GitSubmitEditor()
|
||||
{
|
||||
}
|
||||
GitSubmitEditor::~GitSubmitEditor() = default;
|
||||
|
||||
GitSubmitEditorWidget *GitSubmitEditor::submitEditorWidget()
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@ protected:
|
||||
QString name;
|
||||
QString url;
|
||||
};
|
||||
typedef QList<Remote> RemoteList;
|
||||
using RemoteList = QList<Remote>;
|
||||
|
||||
private:
|
||||
const Qt::ItemFlags m_flags = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable;
|
||||
|
||||
Reference in New Issue
Block a user