Back to index

indicator-appmenu  12.10.0
Functions | Variables
test-usage-db-ancient.c File Reference
#include <glib.h>
#include <glib-object.h>
#include "hudsettings.h"
#include "load-app-info.h"
#include "usage-tracker.h"

Go to the source code of this file.

Functions

gint main (gint argc, gchar *argv[])

Variables

HudSettings hud_settings
 SECTION:hudsettings : HudSettings : tunable parameters.

Function Documentation

gint main ( gint  argc,
gchar *  argv[] 
)

Definition at line 34 of file test-usage-db-ancient.c.

{
       g_type_init();
       UsageTracker * tracker = usage_tracker_new();
       g_object_unref(tracker);
       return 0;
}

Here is the call graph for this function:


Variable Documentation

HudSettings hud_settings
Initial value:
 {
  .store_usage_data = TRUE
}

SECTION:hudsettings : HudSettings : tunable parameters.

HudSettings is a structure that contains the value of several

tunable parameters that affect the behaviour of various components of the HUD.

This structure exists for two reasons.

The first reason is that caching these values in local variables eliminates the need to look them up from #GSettings on each use. This vastly improves the performance of the matching algorithms (as many of these values are used quite a lot from within them).

The second reason is to improve testability. The testcases are able to hardcode sane values for the settings without worrying about changes that the user may have made to their local configuration (which could otherwise cause spurious test failures). HudSettings: : if usage tracking should be performed : the percentage by which to increase the distance of indicators when sorting the results list : the maximum distance value we consider as being a matching result : the penalty incurred by a character in the search term that does not exist in the item being matched : the penalty incurred by a character missing from the search string as compared to the item being matched : the penalty incurred by a character missing from the search string as compared to the item being matched when the character is at the end of the item (ie: the search term is a prefix of the item) : the penalty incurred for the substitution of one character for another

This structure contains the value of several tunable parameters that affect the behaviour of various components of the HUD. hud_settings:

The #HudSettings in effect.

hud_settings_init() can be used to keep these values in sync with

GSettings. For testing, it may make sense to set these values

directly.

Definition at line 29 of file test-usage-db-ancient.c.