Skip to content

Commit

Permalink
fixup! FormBrowse init optimizations (gitextensions#9725)
Browse files Browse the repository at this point in the history
  • Loading branch information
gerhardol authored and RussKie committed Nov 21, 2021
1 parent 4fd2faf commit da33732
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions GitUI/CommandsDialogs/FormBrowse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,7 @@ public FormBrowse(GitUICommands commands, BrowseArguments args)
fileTree.Bind(RevisionGrid, RefreshGitStatusMonitor);
RevisionGrid.ResumeRefreshRevisions();

// We're launching the main form, and whilst the module has been set for us we still need to formally switch to it
// Also triggers RefreshRevisions()
SetGitModule(this, new GitModuleEventArgs(new GitModule(Module.WorkingDir)));

// Application is init, the repo related operations are triggered in OnLoad()
return;

void InitCountArtificial(out GitStatusMonitor gitStatusMonitor)
Expand Down Expand Up @@ -442,7 +439,6 @@ protected override void OnApplicationActivated()
base.OnApplicationActivated();
}

// Contains app init logics ONLY. All repo-specific logic must be placed UICommands.PostRepositoryChanged handler.
protected override void OnLoad(EventArgs e)
{
_formBrowseMenus.CreateToolbarsMenus(ToolStripMain, ToolStripFilters, ToolStripScripts);
Expand All @@ -454,6 +450,9 @@ protected override void OnLoad(EventArgs e)
base.OnLoad(e);

_formBrowseDiagnosticsReporter.Report();

// All app init is done, make all repo related similar to switching repos (like triggering RefreshRevisions())
SetGitModule(this, new GitModuleEventArgs(new GitModule(Module.WorkingDir)));
}

protected override void OnActivated(EventArgs e)
Expand Down

0 comments on commit da33732

Please sign in to comment.