'everything'
authorHannes Janetzek <hannes.janetzek@gmail.com>
Sun, 25 Apr 2010 21:46:36 +0000 (21:46 +0000)
committerHannes Janetzek <hannes.janetzek@gmail.com>
Sun, 25 Apr 2010 21:46:36 +0000 (21:46 +0000)
- history: lower priority when context doesnt match
- update actions only when current item changed with update_matches

SVN revision: 48319

src/modules/everything/evry.c
src/modules/everything/evry_history.c

index 93120ed..6e05788 100644 (file)
@@ -946,13 +946,13 @@ _evry_timer_cb_actions_get(void *data)
    return 0;
 }
 
-
 static void
 _evry_selector_update(Evry_Selector *sel)
 {
    Evry_State *s = sel->state;
    Evry_Item *it = NULL;
-
+   Eina_Bool item_changed = EINA_FALSE;;
+   
    if (s)
      {
        it = s->cur_item;
@@ -967,7 +967,8 @@ _evry_selector_update(Evry_Selector *sel)
        if (s->plugin && (!it || s->item_auto_selected))
          {
             it = NULL;
-
+            item_changed = EINA_TRUE;
+            
             /* get first item */
             if (!it && s->plugin->items)
               {
@@ -1003,7 +1004,7 @@ _evry_selector_update(Evry_Selector *sel)
          edje_object_part_text_set(sel->o_main, "e.text.plugin", "");
      }
 
-   if (sel == selectors[0])
+   if (item_changed && sel == selectors[0])
      {
        sel = selectors[1];
        if (sel->update_timer)
index 44330dd..983a46d 100644 (file)
@@ -295,15 +295,6 @@ evry_history_item_usage_set(Eina_Hash *hist, Evry_Item *it, const char *input, c
        if (hi->plugin != it->plugin->name)
          continue;
 
-       if (ctxt != hi->context)
-         continue;
-
-       /* if (it->plugin->type == type_action)
-        *   {
-        *      if (hi->last_used > it->usage)
-        *        it->usage = hi->last_used;
-        *   } */
-
        if (evry_conf->history_sort_mode == 0)
          {
 
@@ -338,6 +329,10 @@ evry_history_item_usage_set(Eina_Hash *hist, Evry_Item *it, const char *input, c
             if (hi->last_used > it->usage)
               it->usage = hi->last_used;
          }
+
+       if (ctxt != hi->context)
+         it->usage /= 2.0;
+
      }
 
    if (it->usage > 0.0)