mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-05 00:38:04 +02:00
history: Allow overriding history directory for testing
Read UP_HISTORY_DIR for the history directory so that it can be made writeable during testing.
This commit is contained in:
parent
5fd3c9988c
commit
0a1edd7916
1 changed files with 4 additions and 1 deletions
|
|
@ -895,7 +895,10 @@ up_history_init (UpHistory *history)
|
|||
history->priv->data_time_empty = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
|
||||
history->priv->max_data_age = UP_HISTORY_DEFAULT_MAX_DATA_AGE;
|
||||
|
||||
up_history_set_directory (history, HISTORY_DIR);
|
||||
if (g_getenv ("UPOWER_HISTORY_DIR"))
|
||||
up_history_set_directory (history, g_getenv ("UPOWER_HISTORY_DIR"));
|
||||
else
|
||||
up_history_set_directory (history, HISTORY_DIR);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue