aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/utils')
-rw-r--r--src/libs/utils/changeset.cpp (renamed from src/libs/utils/textwriter.cpp)22
-rw-r--r--src/libs/utils/changeset.h (renamed from src/libs/utils/textwriter.h)22
-rw-r--r--src/libs/utils/utils.pro4
3 files changed, 24 insertions, 24 deletions
diff --git a/src/libs/utils/textwriter.cpp b/src/libs/utils/changeset.cpp
index 6753acfda44..32be3cf15bc 100644
--- a/src/libs/utils/textwriter.cpp
+++ b/src/libs/utils/changeset.cpp
@@ -39,11 +39,11 @@
**
****************************************************************************/
-#include "textwriter.h"
+#include "changeset.h"
namespace Utils {
-TextWriter::TextWriter()
+ChangeSet::ChangeSet()
:string(0), cursor(0)
{
}
@@ -53,7 +53,7 @@ static bool overlaps(int posA, int lengthA, int posB, int lengthB) {
|| (posA < posB && posA + lengthA > posB);
}
-bool TextWriter::hasOverlap(int pos, int length)
+bool ChangeSet::hasOverlap(int pos, int length)
{
{
QListIterator<Replace> i(replaceList);
@@ -74,7 +74,7 @@ bool TextWriter::hasOverlap(int pos, int length)
}
}
-bool TextWriter::hasMoveInto(int pos, int length)
+bool ChangeSet::hasMoveInto(int pos, int length)
{
QListIterator<Move> i(moveList);
while (i.hasNext()) {
@@ -85,7 +85,7 @@ bool TextWriter::hasMoveInto(int pos, int length)
return false;
}
-void TextWriter::replace(int pos, int length, const QString &replacement)
+void ChangeSet::replace(int pos, int length, const QString &replacement)
{
Q_ASSERT(!hasOverlap(pos, length));
Q_ASSERT(!hasMoveInto(pos, length));
@@ -97,7 +97,7 @@ void TextWriter::replace(int pos, int length, const QString &replacement)
replaceList += cmd;
}
-void TextWriter::move(int pos, int length, int to)
+void ChangeSet::move(int pos, int length, int to)
{
Q_ASSERT(!hasOverlap(pos, length));
@@ -108,7 +108,7 @@ void TextWriter::move(int pos, int length, int to)
moveList += cmd;
}
-void TextWriter::doReplace(const Replace &replace)
+void ChangeSet::doReplace(const Replace &replace)
{
int diff = replace.replacement.size() - replace.length;
{
@@ -144,7 +144,7 @@ void TextWriter::doReplace(const Replace &replace)
}
}
-void TextWriter::doMove(const Move &move)
+void ChangeSet::doMove(const Move &move)
{
QString text;
if (string) {
@@ -174,21 +174,21 @@ void TextWriter::doMove(const Move &move)
}
}
-void TextWriter::write(QString *s)
+void ChangeSet::write(QString *s)
{
string = s;
write_helper();
string = 0;
}
-void TextWriter::write(QTextCursor *textCursor)
+void ChangeSet::write(QTextCursor *textCursor)
{
cursor = textCursor;
write_helper();
cursor = 0;
}
-void TextWriter::write_helper()
+void ChangeSet::write_helper()
{
if (cursor)
cursor->beginEditBlock();
diff --git a/src/libs/utils/textwriter.h b/src/libs/utils/changeset.h
index 4b3df22ad60..ba86cf2253c 100644
--- a/src/libs/utils/textwriter.h
+++ b/src/libs/utils/changeset.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef TEXTWRITER_H
-#define TEXTWRITER_H
+#ifndef CHANGESET_H
+#define CHANGESET_H
#include "utils_global.h"
@@ -50,23 +50,23 @@
namespace Utils {
-class QTCREATOR_UTILS_EXPORT TextWriter
+class QTCREATOR_UTILS_EXPORT ChangeSet
{
QString *string;
QTextCursor *cursor;
struct Replace {
- int pos;
- int length;
- QString replacement;
+ int pos;
+ int length;
+ QString replacement;
};
QList<Replace> replaceList;
struct Move {
- int pos;
- int length;
- int to;
+ int pos;
+ int length;
+ int to;
};
QList<Move> moveList;
@@ -80,7 +80,7 @@ class QTCREATOR_UTILS_EXPORT TextWriter
void write_helper();
public:
- TextWriter();
+ ChangeSet();
void replace(int pos, int length, const QString &replacement);
void move(int pos, int length, int to);
@@ -91,4 +91,4 @@ public:
} // namespace Utils
-#endif // TEXTWRITER_H
+#endif // CHANGESET_H
diff --git a/src/libs/utils/utils.pro b/src/libs/utils/utils.pro
index b5d797c8e33..e48e240b5d7 100644
--- a/src/libs/utils/utils.pro
+++ b/src/libs/utils/utils.pro
@@ -37,7 +37,7 @@ SOURCES += reloadpromptutils.cpp \
fancymainwindow.cpp \
detailsbutton.cpp \
detailswidget.cpp \
- textwriter.cpp
+ changeset.cpp
win32 {
SOURCES += abstractprocess_win.cpp \
consoleprocess_win.cpp \
@@ -82,7 +82,7 @@ HEADERS += utils_global.h \
fancymainwindow.h \
detailsbutton.h \
detailswidget.h \
- textwriter.h
+ changeset.h
FORMS += filewizardpage.ui \
projectintropage.ui \
newclasswidget.ui \