trivial: Return 'unset' for Offline::TriggerAction if there was no trigger set

This commit is contained in:
Richard Hughes 2014-09-08 17:37:23 +01:00
parent 98531b1163
commit d27489d714
2 changed files with 5 additions and 2 deletions

View File

@ -528,7 +528,7 @@
<doc:para>
The action to take when finished applying updates, known values
are <doc:tt>power-off</doc:tt>, <doc:tt>reboot</doc:tt> or
<doc:tt>unknown</doc:tt> if no offline update is scheduled.
<doc:tt>unset</doc:tt> if no offline update is scheduled.
</doc:para>
</doc:description>
</doc:doc>

View File

@ -980,7 +980,10 @@ pk_engine_offline_get_property (GDBusConnection *connection_, const gchar *sende
if (g_strcmp0 (property_name, "TriggerAction") == 0) {
PkOfflineAction action = pk_offline_get_action (NULL);
return g_variant_new_string (pk_offline_action_to_string (action));
const gchar *tmp = "unset";
if (action != PK_OFFLINE_ACTION_UNKNOWN)
tmp = pk_offline_action_to_string (action);
return g_variant_new_string (tmp);
}
/* stat the file */