DiffEditorController: Make it possible to setup task tree

Instead of reloader function. Use task tree for ShowController.
Make diff processing a part of task tree.

Change-Id: I732d0a14eaf8de7ce0d1be891fb4700b22ea24b7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Jarek Kobus
2022-12-12 14:40:56 +01:00
parent 041c59e90f
commit eef9cb458b
7 changed files with 207 additions and 123 deletions

View File

@@ -7,6 +7,7 @@
#include "diffutils.h"
#include <utils/filepath.h>
#include <utils/tasktree.h>
#include <QObject>
@@ -57,6 +58,9 @@ signals:
const ChunkSelection &selection);
protected:
void setDisplayName(const QString &name) { m_displayName = name; }
QString displayName() const { return m_displayName; }
// reloadFinished() should be called inside the reloader (for synchronous reload)
// or later (for asynchronous reload)
void setReloader(const std::function<void ()> &reloader);
@@ -72,7 +76,10 @@ protected:
private:
Internal::DiffEditorDocument *const m_document;
bool m_isReloading = false;
QString m_displayName;
std::function<void()> m_reloader;
std::unique_ptr<Utils::TaskTree> m_taskTree;
virtual Utils::Tasking::Group reloadRecipe() { return {}; } // TODO: make pure abstract
friend class Internal::DiffEditorDocument;
};