diff --git a/src/plugins/texteditor/refactoringchanges.cpp b/src/plugins/texteditor/refactoringchanges.cpp index 0dab146b704..a7474e2029e 100644 --- a/src/plugins/texteditor/refactoringchanges.cpp +++ b/src/plugins/texteditor/refactoringchanges.cpp @@ -43,7 +43,7 @@ #include #include -using namespace TextEditor; +namespace TextEditor { RefactoringChanges::RefactoringChanges() : m_data(new RefactoringChangesData) @@ -56,10 +56,10 @@ RefactoringChanges::RefactoringChanges(RefactoringChangesData *data) RefactoringChanges::~RefactoringChanges() {} -QList > RefactoringChanges::rangesToSelections(QTextDocument *document, - const QList &ranges) +RefactoringSelections RefactoringChanges::rangesToSelections(QTextDocument *document, + const QList &ranges) { - QList > selections; + RefactoringSelections selections; foreach (const Range &range, ranges) { QTextCursor start(document); @@ -179,7 +179,7 @@ RefactoringFile::RefactoringFile(const QString &fileName, const QSharedPointer editors = Core::DocumentModel::editorsForFilePath(fileName); if (!editors.isEmpty()) - m_editor = qobject_cast(editors.first()->widget()); + m_editor = qobject_cast(editors.first()->widget()); } RefactoringFile::~RefactoringFile() @@ -351,10 +351,10 @@ void RefactoringFile::apply() c.beginEditBlock(); // build indent selections now, applying the changeset will change locations - const QList > &indentSelections = + const RefactoringSelections &indentSelections = RefactoringChanges::rangesToSelections(doc, m_indentRanges); m_indentRanges.clear(); - const QList > &reindentSelections = + const RefactoringSelections &reindentSelections = RefactoringChanges::rangesToSelections(doc, m_reindentRanges); m_reindentRanges.clear(); @@ -385,7 +385,7 @@ void RefactoringFile::apply() void RefactoringFile::indentOrReindent(void (RefactoringChangesData::*mf)(const QTextCursor &, const QString &, const BaseTextDocument *) const, - const QList > &ranges) + const RefactoringSelections &ranges) { typedef QPair CursorPair; @@ -419,3 +419,5 @@ void RefactoringChangesData::reindentSelection(const QTextCursor &, const QStrin void RefactoringChangesData::fileChanged(const QString &) { } + +} // namespace TextEditor diff --git a/src/plugins/texteditor/refactoringchanges.h b/src/plugins/texteditor/refactoringchanges.h index 4570ed14bf4..27af9999b66 100644 --- a/src/plugins/texteditor/refactoringchanges.h +++ b/src/plugins/texteditor/refactoringchanges.h @@ -50,6 +50,7 @@ class RefactoringChanges; class RefactoringFile; class RefactoringChangesData; typedef QSharedPointer RefactoringFilePtr; +typedef QVector > RefactoringSelections; // ### listen to the m_editor::destroyed signal? class TEXTEDITOR_EXPORT RefactoringFile @@ -99,7 +100,7 @@ protected: void indentOrReindent(void (RefactoringChangesData::*mf)(const QTextCursor &, const QString &, const BaseTextDocument *) const, - const QList > &ranges); + const RefactoringSelections &ranges); protected: QString m_fileName; @@ -140,9 +141,7 @@ protected: explicit RefactoringChanges(RefactoringChangesData *data); static BaseTextEditorWidget *openEditor(const QString &fileName, bool activate, int line, int column); - - static QList > rangesToSelections(QTextDocument *document, - const QList &ranges); + static RefactoringSelections rangesToSelections(QTextDocument *document, const QList &ranges); protected: QSharedPointer m_data;