diff options
Diffstat (limited to 'src/profile.vala')
-rw-r--r-- | src/profile.vala | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/profile.vala b/src/profile.vala index 96d1b5c..f89490b 100644 --- a/src/profile.vala +++ b/src/profile.vala @@ -23,6 +23,7 @@ class Profile: Object protected string profile_name; protected Menu root; protected Menu menu; + private uint menu_export_id; protected bool visible { get; set; default = true; } @@ -44,8 +45,8 @@ class Profile: Object { try { - debug (@"exporting '$profile_name' on $object_path"); - connection.export_menu_model (object_path, root); + debug (@"exporting menu '$profile_name'"); + menu_export_id = connection.export_menu_model (object_path, root); } catch (Error e) { @@ -53,6 +54,16 @@ class Profile: Object } } + public void unexport_menu (DBusConnection connection) + { + if (menu_export_id != 0) + { + debug (@"unexporting menu '$profile_name'"); + connection.unexport_menu_model (menu_export_id); + menu_export_id = 0; + } + } + protected void spawn_command_line_async (string command) { try { |