aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/refactoringchanges.h
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2010-08-12 13:46:18 +0200
committerChristian Kamm <christian.d.kamm@nokia.com>2010-08-12 14:21:35 +0200
commit0355e37e537751d4c9fd527c8a6ddf87e8d9dd43 (patch)
tree59d1c17497c4aa87dae4bf8669dc0e8eca34cb3f /src/plugins/texteditor/refactoringchanges.h
parentca5076e5ae84931a5cc7bd157171ace7c0a2ff7c (diff)
QuickFix: Migrate to a nicer API for cross-file quick fixes.
Diffstat (limited to 'src/plugins/texteditor/refactoringchanges.h')
-rw-r--r--src/plugins/texteditor/refactoringchanges.h27
1 files changed, 7 insertions, 20 deletions
diff --git a/src/plugins/texteditor/refactoringchanges.h b/src/plugins/texteditor/refactoringchanges.h
index 13b8bbd9adb..267ed2e6e20 100644
--- a/src/plugins/texteditor/refactoringchanges.h
+++ b/src/plugins/texteditor/refactoringchanges.h
@@ -50,7 +50,6 @@ public:
public:
RefactoringFile();
RefactoringFile(const QString &fileName, RefactoringChanges *refactoringChanges);
-
RefactoringFile(const RefactoringFile &other);
~RefactoringFile();
@@ -71,7 +70,7 @@ public:
private:
// not assignable
- const RefactoringFile &operator=(const RefactoringFile &other);
+ //const RefactoringFile &operator=(const RefactoringFile &other);
QTextDocument *mutableDocument() const;
@@ -80,6 +79,9 @@ private:
RefactoringChanges *m_refactoringChanges;
mutable QTextDocument *m_document;
BaseTextEditor *m_editor;
+ Utils::ChangeSet m_changes;
+ QList<Range> m_indentRanges;
+ bool m_openEditor;
};
/*!
@@ -95,28 +97,19 @@ public:
RefactoringChanges();
virtual ~RefactoringChanges();
- /*!
- Applies all changes to open editors or to text files.
-
- \return The list of changed files, including newly-created ones.
- */
- virtual QStringList apply();
-
bool createFile(const QString &fileName, const QString &contents, bool reindent = true, bool openEditor = true);
bool removeFile(const QString &fileName);
RefactoringFile file(const QString &fileName);
- void openEditor(const QString &fileName, int pos = -1);
+ BaseTextEditor *openEditor(const QString &fileName, int pos = -1);
/**
* \param fileName the file to activate the editor for
* \param pos, 0-based offset to put the cursor on, -1 means don't move
*/
- void setActiveEditor(const QString &fileName, int pos = -1);
+ BaseTextEditor *activateEditor(const QString &fileName, int pos = -1);
- QT_DEPRECATED void changeFile(const QString &fileName, const Utils::ChangeSet &changes, bool openEditor = true);
- QT_DEPRECATED void reindent(const QString &fileName, const Range &range, bool openEditor = true);
private:
static BaseTextEditor *editorForFile(const QString &fileName,
@@ -124,13 +117,7 @@ private:
static QList<QTextCursor> rangesToSelections(QTextDocument *document, const QList<Range> &ranges);
virtual void indentSelection(const QTextCursor &selection) const = 0;
-
-private:
- QSet<QString> m_filesToCreate;
- QHash<QString, int> m_cursorByFile;
- QHash<QString, Utils::ChangeSet> m_changesByFile;
- QMultiHash<QString, Range> m_indentRangesByFile;
- QString m_fileNameToShow;
+ virtual void fileChanged(const QString &fileName) = 0;
friend class RefactoringFile;
};