trivial: Only show the device error when no devices are due to be updated

Showing a 'no attached hardware matched' then a large list of GUIDs isn't
super helpful.
This commit is contained in:
Richard Hughes 2016-08-16 17:57:30 +01:00
parent 0abde9c39a
commit 4fd38c8f1b

View File

@ -883,15 +883,14 @@ fu_main_update_helper (FuMainAuthHelper *helper, GError **error)
g_ptr_array_add (helper->devices, g_object_ref (item->device));
}
if (helper->devices->len == 0) {
g_autofree gchar *guid = NULL;
guid = fu_main_get_guids_from_store (helper->store);
if (error_first != NULL) {
g_set_error (error,
FWUPD_ERROR,
FWUPD_ERROR_INVALID_FILE,
"no attached hardware matched %s: %s",
guid, error_first->message);
g_set_error_literal (error,
FWUPD_ERROR,
FWUPD_ERROR_INVALID_FILE,
error_first->message);
} else {
g_autofree gchar *guid = NULL;
guid = fu_main_get_guids_from_store (helper->store);
g_set_error (error,
FWUPD_ERROR,
FWUPD_ERROR_INVALID_FILE,