Skip to content
This repository has been archived by the owner on Apr 2, 2022. It is now read-only.

Commit

Permalink
Fixed some crashes on the indicator.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corentin Noël committed Jul 18, 2016
1 parent fe1e524 commit 2b4b5dc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
22 changes: 10 additions & 12 deletions src/AyatanaIndicator.vala
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,23 @@ public class AyatanaCompatibility.Indicator : Wingpanel.Indicator {
const int MAX_ICON_SIZE = 24;

public Indicator (IndicatorAyatana.ObjectEntry entry, IndicatorAyatana.Object obj, IndicatorIface indicator) {
Object (code_name: "%s%s".printf ("ayatana-", entry.name_hint),
display_name: "%s%s".printf ("ayatana-", entry.name_hint),
string name_hint = entry.name_hint;
if (name_hint == null) {
var rand = new GLib.Rand ();
name_hint = rand.next_int ().to_string ();
}

Object (code_name: "%s%s".printf ("ayatana-", name_hint),
display_name: "%s%s".printf ("ayatana-", name_hint),
description: _("Ayatana compatibility indicator"));
this.entry = entry;
this.indicator = indicator;
this.parent_object = obj;
this.menu_map = new Gee.HashMap<Gtk.Widget, Gtk.Widget> ();

unowned string name_hint = entry.name_hint;

if (name_hint == null) {
warning ("NULL name hint");
}

entry_name_hint = name_hint != null ? name_hint.dup () : "";
entry_name_hint = name_hint;

if (entry.menu == null) {
critical ("Indicator: %s has no menu widget.", entry_name_hint);

return;
}

Expand Down Expand Up @@ -325,4 +323,4 @@ public class AyatanaCompatibility.Indicator : Wingpanel.Indicator {
MAX_ICON_SIZE, Gdk.InterpType.HYPER);
}
}
}
}
5 changes: 0 additions & 5 deletions src/IndicatorObject.vala
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ public class AyatanaCompatibility.IndicatorObject : Object, IndicatorIface {
object.entry_removed.connect (on_entry_removed);
}

~IndicatorObject () {
object.entry_added.disconnect (on_entry_added);
object.entry_removed.disconnect (on_entry_removed);
}

public string get_name () {
return name;
}
Expand Down

0 comments on commit 2b4b5dc

Please sign in to comment.