forked from qt-creator/qt-creator
ClangCodeModel: Modernize
modernize-use-nullptr modernize-use-auto modernize-use-override modernize-use-equals-default modernize-use-using Change-Id: I386f885860c01574035c69226240fe3b8e38392c Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -106,7 +106,7 @@ TextEditor::ProposalModelPtr completionResults(TextEditor::BaseTextEditor *textE
|
||||
{
|
||||
using namespace TextEditor;
|
||||
|
||||
TextEditorWidget *textEditorWidget = qobject_cast<TextEditorWidget *>(textEditor->widget());
|
||||
auto textEditorWidget = qobject_cast<TextEditorWidget *>(textEditor->widget());
|
||||
QTC_ASSERT(textEditorWidget, return TextEditor::ProposalModelPtr());
|
||||
AssistInterface *assistInterface = textEditorWidget->createAssistInterface(
|
||||
TextEditor::Completion, TextEditor::ExplicitlyInvoked);
|
||||
|
||||
@@ -130,7 +130,7 @@ const QChar *BatchFileLineTokenizer::advanceToTokenBegin()
|
||||
|
||||
forever {
|
||||
if (atEnd())
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
if (atQuotationMark()) {
|
||||
m_isWithinQuotation = true;
|
||||
@@ -151,7 +151,7 @@ const QChar *BatchFileLineTokenizer::advanceToTokenEnd()
|
||||
if (m_isWithinQuotation) {
|
||||
if (atEnd()) {
|
||||
qWarning("ClangBatchFileProcessor: error: unfinished quotation.");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (atQuotationMark())
|
||||
@@ -194,7 +194,7 @@ public:
|
||||
|
||||
public:
|
||||
Command(const CommandContext &context) : m_commandContext(context) {}
|
||||
virtual ~Command() {}
|
||||
virtual ~Command() = default;
|
||||
|
||||
const CommandContext &context() const { return m_commandContext; }
|
||||
virtual bool run() { return true; }
|
||||
|
||||
@@ -114,8 +114,7 @@ private:
|
||||
class TestDocument
|
||||
{
|
||||
public:
|
||||
TestDocument(const QByteArray &fileName, CppTools::Tests::TemporaryDir *temporaryDir = 0)
|
||||
: cursorPosition(-1)
|
||||
TestDocument(const QByteArray &fileName, CppTools::Tests::TemporaryDir *temporaryDir = nullptr)
|
||||
{
|
||||
QTC_ASSERT(!fileName.isEmpty(), return);
|
||||
const QResource resource(qrcPath(fileName));
|
||||
@@ -153,10 +152,10 @@ public:
|
||||
{ return isCreated() && hasValidCursorPosition(); }
|
||||
|
||||
QString filePath;
|
||||
int cursorPosition;
|
||||
int cursorPosition = -1;
|
||||
|
||||
private:
|
||||
TestDocument() : cursorPosition(-1) {}
|
||||
TestDocument() = default;
|
||||
QSharedPointer<CppTools::Tests::TemporaryDir> m_temporaryDir;
|
||||
};
|
||||
|
||||
@@ -278,10 +277,10 @@ public:
|
||||
ProjectLoader(const QStringList &projectFiles,
|
||||
const ProjectExplorer::Macros &projectMacros,
|
||||
bool testOnlyForCleanedProjects = false)
|
||||
: m_project(0)
|
||||
: m_project(nullptr)
|
||||
, m_projectFiles(projectFiles)
|
||||
, m_projectMacros(projectMacros)
|
||||
, m_helper(0, testOnlyForCleanedProjects)
|
||||
, m_helper(nullptr, testOnlyForCleanedProjects)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user