forked from qt-creator/qt-creator
DiffEditorController: Make setReloader() protected
Change-Id: I2c988794176aa2e234c15ae88c425f30c1726810 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -52,15 +52,14 @@ public:
|
||||
bool chunkExists(int fileIndex, int chunkIndex) const;
|
||||
Core::IDocument *document() const;
|
||||
|
||||
// reloadFinished() should be called inside the reloader (for synchronous reload)
|
||||
// or later (for asynchronous reload)
|
||||
void setReloader(const std::function<void ()> &reloader);
|
||||
|
||||
signals:
|
||||
void chunkActionsRequested(QMenu *menu, int fileIndex, int chunkIndex,
|
||||
const ChunkSelection &selection);
|
||||
|
||||
protected:
|
||||
// reloadFinished() should be called inside the reloader (for synchronous reload)
|
||||
// or later (for asynchronous reload)
|
||||
void setReloader(const std::function<void ()> &reloader);
|
||||
void reloadFinished(bool success);
|
||||
|
||||
void setDiffFiles(const QList<FileData> &diffFileList,
|
||||
|
||||
@@ -38,12 +38,14 @@ namespace Mercurial::Internal {
|
||||
class MercurialDiffEditorController : public VcsBaseDiffEditorController
|
||||
{
|
||||
public:
|
||||
MercurialDiffEditorController(IDocument *document)
|
||||
MercurialDiffEditorController(IDocument *document, const QStringList &args)
|
||||
: VcsBaseDiffEditorController(document)
|
||||
{
|
||||
setDisplayName("Hg Diff");
|
||||
setReloader([this, args] { runCommand({addConfigurationArguments(args)}); });
|
||||
}
|
||||
|
||||
private:
|
||||
void runCommand(const QList<QStringList> &args, QTextCodec *codec = nullptr);
|
||||
QStringList addConfigurationArguments(const QStringList &args) const;
|
||||
};
|
||||
@@ -416,10 +418,7 @@ void MercurialClient::requestReload(const QString &documentId, const QString &so
|
||||
|
||||
IDocument *document = DiffEditorController::findOrCreateDocument(documentId, title);
|
||||
QTC_ASSERT(document, return);
|
||||
auto controller = new MercurialDiffEditorController(document);
|
||||
controller->setReloader([controller, args] {
|
||||
controller->runCommand({controller->addConfigurationArguments(args)});
|
||||
});
|
||||
auto controller = new MercurialDiffEditorController(document, args);
|
||||
controller->setVcsBinary(settings().binaryPath.filePath());
|
||||
controller->setVcsTimeoutS(settings().timeout.value());
|
||||
controller->setProcessEnvironment(processEnvironment());
|
||||
|
||||
Reference in New Issue
Block a user