Commit 1af163e7 authored by Guido Gunther's avatar Guido Gunther Committed by Guido Gunther
Browse files

feedback-vibra-rumble: Implement is_available

This avoids criticals when there's no rumble vibra available.
parent 75e28510
......@@ -137,15 +137,27 @@ fbd_feedback_vibra_rumble_start_vibra (FbdFeedbackVibra *vibra)
static gboolean
fbd_feedback_vibra_rumble_is_available (FbdFeedbackBase *base)
FbdFeedbackManager *manager = fbd_feedback_manager_get_default ();
FbdDevVibra *dev = fbd_feedback_manager_get_dev_vibra (manager);
return FBD_IS_DEV_VIBRA (dev);
static void
fbd_feedback_vibra_rumble_class_init (FbdFeedbackVibraRumbleClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
FbdFeedbackBaseClass *base_class = FBD_FEEDBACK_BASE_CLASS (klass);
FbdFeedbackVibraClass *vibra_class = FBD_FEEDBACK_VIBRA_CLASS (klass);
object_class->set_property = fbd_feedback_vibra_rumble_set_property;
object_class->get_property = fbd_feedback_vibra_rumble_get_property;
base_class->is_available = fbd_feedback_vibra_rumble_is_available;
vibra_class->start_vibra = fbd_feedback_vibra_rumble_start_vibra;
vibra_class->end_vibra = fbd_feedback_vibra_rumble_end_vibra;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment