forked from qt-creator/qt-creator
ClangTools: Remove useless member FixitsRefactoringFile::m_filePath
Change-Id: I686eddeea7c52096175c3b2fe1a519e8fbf2c876 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -75,13 +75,9 @@ static QDebug operator<<(QDebug debug, const ReplacementOperation &op)
|
|||||||
|
|
||||||
bool FixitsRefactoringFile::apply()
|
bool FixitsRefactoringFile::apply()
|
||||||
{
|
{
|
||||||
qCDebug(fixitsLog) << "Applying fixits for" << m_filePath;
|
|
||||||
|
|
||||||
if (m_replacementOperations.isEmpty())
|
if (m_replacementOperations.isEmpty())
|
||||||
return false; // Error nothing to apply TODO: Is this correct to return?
|
return false; // Error nothing to apply TODO: Is this correct to return?
|
||||||
|
|
||||||
QTC_ASSERT(!m_filePath.isEmpty(), return false);
|
|
||||||
|
|
||||||
ICodeStylePreferencesFactory *factory = TextEditorSettings::codeStyleFactory(
|
ICodeStylePreferencesFactory *factory = TextEditorSettings::codeStyleFactory(
|
||||||
CppTools::Constants::CPP_SETTINGS_ID);
|
CppTools::Constants::CPP_SETTINGS_ID);
|
||||||
|
|
||||||
|
@@ -54,10 +54,8 @@ class FixitsRefactoringFile
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FixitsRefactoringFile() = default;
|
FixitsRefactoringFile() = default;
|
||||||
FixitsRefactoringFile(const QString &filePath) : m_filePath(filePath) {}
|
|
||||||
~FixitsRefactoringFile() { qDeleteAll(m_documents); }
|
~FixitsRefactoringFile() { qDeleteAll(m_documents); }
|
||||||
|
|
||||||
bool isValid() const { return !m_filePath.isEmpty(); }
|
|
||||||
int position(const QString &filePath, unsigned line, unsigned column) const;
|
int position(const QString &filePath, unsigned line, unsigned column) const;
|
||||||
|
|
||||||
void setReplacements(const ReplacementOperations &ops) { m_replacementOperations = ops; }
|
void setReplacements(const ReplacementOperations &ops) { m_replacementOperations = ops; }
|
||||||
@@ -78,7 +76,6 @@ private:
|
|||||||
const Utils::Text::Replacements &replacements,
|
const Utils::Text::Replacements &replacements,
|
||||||
int startIndex) const;
|
int startIndex) const;
|
||||||
|
|
||||||
QString m_filePath;
|
|
||||||
mutable Utils::TextFileFormat m_textFileFormat;
|
mutable Utils::TextFileFormat m_textFileFormat;
|
||||||
mutable QHash<QString, QTextDocument *> m_documents;
|
mutable QHash<QString, QTextDocument *> m_documents;
|
||||||
ReplacementOperations m_replacementOperations; // Not owned.
|
ReplacementOperations m_replacementOperations; // Not owned.
|
||||||
|
@@ -200,8 +200,6 @@ public:
|
|||||||
class RefactoringFileInfo
|
class RefactoringFileInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool isValid() const { return file.isValid(); }
|
|
||||||
|
|
||||||
FixitsRefactoringFile file;
|
FixitsRefactoringFile file;
|
||||||
QVector<DiagnosticItem *> diagnosticItems;
|
QVector<DiagnosticItem *> diagnosticItems;
|
||||||
bool hasScheduledFixits = false;
|
bool hasScheduledFixits = false;
|
||||||
@@ -215,8 +213,6 @@ public:
|
|||||||
|
|
||||||
// Get or create refactoring file
|
// Get or create refactoring file
|
||||||
RefactoringFileInfo &fileInfo = m_refactoringFileInfos[filePath];
|
RefactoringFileInfo &fileInfo = m_refactoringFileInfos[filePath];
|
||||||
if (!fileInfo.isValid())
|
|
||||||
fileInfo.file = FixitsRefactoringFile(filePath);
|
|
||||||
|
|
||||||
// Append item
|
// Append item
|
||||||
fileInfo.diagnosticItems += diagnosticItem;
|
fileInfo.diagnosticItems += diagnosticItem;
|
||||||
|
Reference in New Issue
Block a user