[gitg/wip/actions] Do not pretend to support deleting remotes
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg/wip/actions] Do not pretend to support deleting remotes
- Date: Sat, 12 Jul 2014 09:01:11 +0000 (UTC)
commit 89adb4690ce7a4ad808150adb37810cb2f87e925
Author: Jesse van den Kieboom <jessevdk gnome org>
Date: Sat Jul 12 11:00:42 2014 +0200
Do not pretend to support deleting remotes
gitg/gitg-ref-action-delete.vala | 59 ++++++++++++++++----------------------
1 files changed, 25 insertions(+), 34 deletions(-)
---
diff --git a/gitg/gitg-ref-action-delete.vala b/gitg/gitg-ref-action-delete.vala
index 8edc2cb..86e8fbc 100644
--- a/gitg/gitg-ref-action-delete.vala
+++ b/gitg/gitg-ref-action-delete.vala
@@ -43,8 +43,7 @@ class RefActionDelete : GitgExt.Action, GitgExt.RefAction, Object
get
{
return reference.is_branch()
- || reference.is_tag()
- || reference.is_remote();
+ || reference.is_tag();
}
}
@@ -93,47 +92,39 @@ class RefActionDelete : GitgExt.Action, GitgExt.RefAction, Object
return true;
}
- if (reference.is_remote())
+ try
{
- // TODO
- return true;
+ reference.delete();
}
- else
+ catch (Error e)
{
- try
- {
- reference.delete();
- }
- catch (Error e)
- {
- string title;
- string message;
+ string title;
+ string message;
- var name = reference.get_shorthand();
+ var name = reference.get_shorthand();
- if (reference.is_tag())
- {
- // Translators: %s is the name of the tag
- title = _("Failed to delete tag %s").printf(name);
+ if (reference.is_tag())
+ {
+ // Translators: %s is the name of the tag
+ title = _("Failed to delete tag %s").printf(name);
- // Translators: the first %s is the name of the tag, the second is an
error message
- message = _("The tag %s could not be deleted: %s").printf(name,
e.message);
- }
- else
- {
- // Translators: %s is the name of the branch
- title = _("Failed to delete branch %s").printf(name);
+ // Translators: the first %s is the name of the tag, the second is an error
message
+ message = _("The tag %s could not be deleted: %s").printf(name, e.message);
+ }
+ else
+ {
+ // Translators: %s is the name of the branch
+ title = _("Failed to delete branch %s").printf(name);
- // Translators: the first %s is the name of the branch, the second is
an error message
- message = _("The branch %s could not be deleted: %s").printf(name,
e.message);
- }
+ // Translators: the first %s is the name of the branch, the second is an
error message
+ message = _("The branch %s could not be deleted: %s").printf(name, e.message);
+ }
- action_interface.application.show_infobar(title,
- message,
- Gtk.MessageType.ERROR);
+ action_interface.application.show_infobar(title,
+ message,
+ Gtk.MessageType.ERROR);
- return true;
- }
+ return true;
}
action_interface.remove_ref(reference);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]