From 3258151e7df95826391ac0b854aac323f79b4139 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 27 Jun 2023 10:06:32 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"REPORT-91839=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=AE=A1=E7=90=86=E4=BA=8C=E6=9C=9F=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=A4=E6=96=AD=E6=96=B0=E8=80=81=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E7=9A=84=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E6=94=B9=E4=B8=BAConfig=E5=87=86=E5=A4=87?= =?UTF-8?q?=E5=90=8E=E8=BF=9B=E8=A1=8C"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6694648b918db44813a7db75d03421d51bc5ebb0. --- .../mainframe/vcs/common/VcsHelper.java | 27 +++++++------------ .../design/mainframe/vcs/ui/VcsMovePanel.java | 1 - 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java index 1c81481bb9..ce7f4094b9 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java @@ -2,7 +2,6 @@ package com.fr.design.mainframe.vcs.common; import com.fr.concurrent.NamedThreadFactory; -import com.fr.config.ConfigEvent; import com.fr.design.DesignerEnvManager; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.TemplateTreePane; @@ -15,7 +14,7 @@ import com.fr.design.mainframe.vcs.VcsConfigManager; import com.fr.design.mainframe.vcs.ui.FileVersionTable; import com.fr.event.Event; import com.fr.event.EventDispatcher; -import com.fr.event.ListenerAdaptor; +import com.fr.event.Listener; import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginContext; @@ -24,6 +23,9 @@ import com.fr.report.entity.VcsEntity; import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; import com.fr.workspace.WorkContext; +import com.fr.workspace.Workspace; +import com.fr.workspace.WorkspaceEvent; +import com.fr.workspace.server.vcs.VcsConfig; import com.fr.workspace.server.vcs.VcsOperator; import com.fr.workspace.server.vcs.filesystem.VcsFileSystem; import com.fr.workspace.server.vcs.git.config.GcConfig; @@ -76,9 +78,9 @@ public class VcsHelper implements JTemplateActionListener { if (op != null) { legacyMode = op.isLegacyMode(); } - EventDispatcher.listen(ConfigEvent.READY, new ListenerAdaptor() { + EventDispatcher.listen(WorkspaceEvent.AfterSwitch, new Listener() { @Override - protected void on(Event event) { + public void on(Event event, Workspace param) { legacyMode = WorkContext.getCurrent().get(VcsOperator.class).isLegacyMode(); } }); @@ -251,15 +253,6 @@ public class VcsHelper implements JTemplateActionListener { return legacyMode; } - /** - * 更新当前的legacyMode状态 - *
  • 目前用在迁移结束后更新模式为新模式
  • - * - */ - public void updateLegacyMode() { - this.legacyMode = !legacyMode; - } - @Override public void templateOpened(JTemplate jt) { try { @@ -299,9 +292,7 @@ public class VcsHelper implements JTemplateActionListener { } } }); - if (!fireVcs.isShutdown()) { - fireVcs.shutdown(); - } + fireVcs.shutdown(); } private void doSave(JTemplate jt, String fileName, int latestFileVersion, boolean replace, VcsOperator operator) { @@ -361,7 +352,7 @@ public class VcsHelper implements JTemplateActionListener { * @return 支持返回true */ public boolean checkV2FunctionSupport() { - return !VcsHelper.getInstance().isLegacyMode() && (WorkContext.getCurrent().isLocal() || WorkContext.getCurrent().isRoot()); + return VcsConfig.getInstance().isUseV2() && (WorkContext.getCurrent().isLocal() || WorkContext.getCurrent().isRoot()); } /** @@ -370,6 +361,6 @@ public class VcsHelper implements JTemplateActionListener { * @return 支持返回true */ public boolean checkMoveFunctionSupport() { - return VcsHelper.getInstance().isLegacyMode() && (WorkContext.getCurrent().isLocal() || WorkContext.getCurrent().isRoot()); + return !VcsConfig.getInstance().isUseV2() && (WorkContext.getCurrent().isLocal() || WorkContext.getCurrent().isRoot()); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsMovePanel.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsMovePanel.java index 9a3235cd15..350d20424e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsMovePanel.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsMovePanel.java @@ -372,7 +372,6 @@ public class VcsMovePanel extends BasicPane { } }); VcsManager.getInstance().updateManager(); - VcsHelper.getInstance().updateLegacyMode(); } }