Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix URLs openings #69

Merged
merged 1 commit into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/GitExtensions.GerritPlugin/FormGerritChangeSubmitted.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Diagnostics;
using System.Windows.Forms;
using System.Windows.Forms;
using GitUI;

namespace GitExtensions.GerritPlugin
Expand All @@ -17,7 +16,7 @@ public static void ShowSubmitted(IWin32Window owner, string change)
var form = new FormGerritChangeSubmitted();

form._NO_TRANSLATE_TargetLabel.Text = change;
form._NO_TRANSLATE_TargetLabel.Click += (s, e) => Process.Start(change);
form._NO_TRANSLATE_TargetLabel.Click += (s, e) => OsShellUtil.OpenUrlInDefaultBrowser(change);

form.ShowDialog(owner);
}
Expand Down
2 changes: 1 addition & 1 deletion src/GitExtensions.GerritPlugin/FormGitReview.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private void GitReviewFileLoaded(object sender, EventArgs e)

private void lnkGitReviewPatterns_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start("https://docs.opendev.org/opendev/git-review/latest/installation.html#gitreview-file-format");
OsShellUtil.OpenUrlInDefaultBrowser("https://docs.opendev.org/opendev/git-review/latest/installation.html#gitreview-file-format");
}
}
}
15 changes: 2 additions & 13 deletions src/GitExtensions.GerritPlugin/FormPluginInformation.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Diagnostics;
using System.Windows.Forms;
using System.Windows.Forms;
using GitUI;

namespace GitExtensions.GerritPlugin
Expand All @@ -12,19 +11,9 @@ public FormPluginInformation()
InitializeComplete();
}

public static void ShowSubmitted(IWin32Window owner, string change)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain this code deletion? Was it dead code?

Copy link
Contributor Author

@poupounetjoyeux poupounetjoyeux Apr 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem! 😉

It seams that this is a bad copy paste from the FormGerritChangeSubmitted.cs file that has exactly the same method with same body and where the location regarding the method name seems to make more sense
Moreover a "Find reference" on this method returns an empty result so I consider It was dead code

{
var form = new FormPluginInformation();

form._NO_TRANSLATE_TargetLabel.Text = change;
form._NO_TRANSLATE_TargetLabel.Click += (s, e) => Process.Start(change);

form.ShowDialog(owner);
}

private void _NO_TRANSLATE_TargetLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start("https://docs.opendev.org/opendev/git-review/latest/installation.html#gitreview-file-format");
OsShellUtil.OpenUrlInDefaultBrowser("https://docs.opendev.org/opendev/git-review/latest/installation.html#gitreview-file-format");
}
}
}