From: Enlightenment S. <no-...@en...> - 2009-08-28 02:39:42
|
Log: 'everything' - actually make the action prio sort work - clenaups Author: jeffdameth Date: 2009-08-27 19:39:29 -0700 (Thu, 27 Aug 2009) New Revision: 42052 Modified: trunk/e/src/modules/everything/evry_plug_aggregator.c trunk/e/src/modules/everything/views/evry_plug_view_thumb.c Modified: trunk/e/src/modules/everything/evry_plug_aggregator.c =================================================================== --- trunk/e/src/modules/everything/evry_plug_aggregator.c 2009-08-28 02:25:13 UTC (rev 42051) +++ trunk/e/src/modules/everything/evry_plug_aggregator.c 2009-08-28 02:39:29 UTC (rev 42052) @@ -9,7 +9,29 @@ Evry_Selector *selector; }; +static int +_cb_sort_recent(const void *data1, const void *data2) +{ + const Evry_Item *it1 = data1; + const Evry_Item *it2 = data2; + if ((it1->plugin == action_selector) || + (it2->plugin == action_selector)) + { + if ((it1->plugin == action_selector) && + (it2->plugin == action_selector)) + return (it1->priority - it2->priority); + else if (it1->plugin == action_selector) + return ((it1->plugin->config->priority + it1->priority) + - it2->plugin->config->priority); + else + return (it1->plugin->config->priority - + (it1->plugin->config->priority + it2->priority)); + } + + return -1; +} + static int _cb_sort(const void *data1, const void *data2) { @@ -23,9 +45,11 @@ (it2->plugin == action_selector)) return (it1->priority - it2->priority); else if (it1->plugin == action_selector) - return (it1->priority - it2->plugin->config->priority); + return ((it1->plugin->config->priority + it1->priority) + - it2->plugin->config->priority); else - return (it1->plugin->config->priority - it2->priority); + return (it1->plugin->config->priority - + (it1->plugin->config->priority + it2->priority)); } if ((it1->plugin == it2->plugin) && @@ -112,8 +136,14 @@ if (items) eina_list_free(items); if (input[0]) - EVRY_PLUGIN_ITEMS_SORT(p, _cb_sort); - + { + EVRY_PLUGIN_ITEMS_SORT(p, _cb_sort); + } + else + { + EVRY_PLUGIN_ITEMS_SORT(p, _cb_sort_recent); + } + return 1; } Modified: trunk/e/src/modules/everything/views/evry_plug_view_thumb.c =================================================================== --- trunk/e/src/modules/everything/views/evry_plug_view_thumb.c 2009-08-28 02:25:13 UTC (rev 42051) +++ trunk/e/src/modules/everything/views/evry_plug_view_thumb.c 2009-08-28 02:39:29 UTC (rev 42052) @@ -638,9 +638,6 @@ return 0; } -static int _view_update_do(void *data); - - static int _view_update(Evry_View *view) { |