Move diff calculation to the separate thread

It doesn't freeze creator anymore.

Task-number: QTCREATORBUG-14255
Change-Id: I3d06ea7a848e321c6072e00a73b96e9ea9770b6a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Jarek Kobus
2016-11-18 16:06:27 +01:00
parent 6d1d1a4416
commit 2144fb5949
3 changed files with 176 additions and 82 deletions

View File

@@ -31,6 +31,7 @@
QT_BEGIN_NAMESPACE
template <class K, class T>
class QMap;
class QFutureInterfaceBase;
QT_END_NAMESPACE
namespace DiffEditor {
@@ -62,7 +63,7 @@ public:
WordMode,
LineMode
};
Differ();
Differ(QFutureInterfaceBase *jobController = nullptr);
QList<Diff> diff(const QString &text1, const QString &text2);
QList<Diff> unifiedDiff(const QString &text1, const QString &text2);
void setDiffMode(DiffMode mode);
@@ -110,6 +111,7 @@ private:
int subTextStart);
DiffMode m_diffMode;
DiffMode m_currentDiffMode;
QFutureInterfaceBase *m_jobController = nullptr;
};
} // namespace DiffEditor