~gero-bare/slingshot/add_search_for_keyword

« back to all changes in this revision

Viewing changes to src/Backend/App.vala

  • Committer: RabbitBot
  • Author(s): Adam Bieńkowski
  • Date: 2016-02-22 23:13:16 UTC
  • mfrom: (632.1.1 show-app-badges-new)
  • Revision ID: rabbitbot-20160222231316-m9wyd9txr0v0rhq0
* Fixes bug #710498: "Support Launcher API in order to show badges".

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    public string generic_name { get; private set; default = ""; }
45
45
    public AppType app_type { get; private set; default = AppType.APP; }
46
46
 
 
47
#if HAS_PLANK_0_11
 
48
    public string? unity_sender_name = null;
 
49
    public bool count_visible = false;
 
50
    public int64 current_count = 0;
 
51
#endif
 
52
 
47
53
    public Synapse.Match? match { get; private set; default = null; }
48
54
    public Synapse.Match? target { get; private set; default = null; }
49
55
    public Gee.ArrayList<string> actions { get; private set; default = null; }
51
57
 
52
58
    public signal void launched (App app);
53
59
 
 
60
#if HAS_PLANK_0_11
 
61
    public signal void unity_update_info ();
 
62
#endif
 
63
 
54
64
    // for FDO Desktop Actions
55
65
    // see http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#extra-actions
56
66
    private const string DESKTOP_ACTION_KEY = "Actions";
151
161
    }
152
162
 
153
163
    // Quicklist code from Plank
154
 
    public void init_actions () throws KeyFileError  {
 
164
    public void init_actions () throws KeyFileError {
155
165
        actions = new Gee.ArrayList<string> ();
156
166
        actions_map = new Gee.HashMap<string, string> ();
157
167
 
231
241
            }
232
242
        }
233
243
    }
 
244
 
 
245
#if HAS_PLANK_0_11
 
246
    public void perform_unity_update (string sender_name, VariantIter prop_iter) {
 
247
        unity_sender_name = sender_name;
 
248
 
 
249
        string prop_key;
 
250
        Variant prop_value;
 
251
        while (prop_iter.next ("{sv}", out prop_key, out prop_value)) {
 
252
            if (prop_key == "count") {
 
253
                current_count = prop_value.get_int64 ();
 
254
            } else if (prop_key == "count-visible") {
 
255
                count_visible = prop_value.get_boolean ();
 
256
            }
 
257
        }
 
258
 
 
259
        unity_update_info ();
 
260
    }
 
261
 
 
262
    public void unity_reset () {
 
263
        unity_sender_name = null;
 
264
        count_visible = false;
 
265
        current_count = 0;
 
266
 
 
267
        unity_update_info ();
 
268
    }
 
269
#endif
234
270
}