Updated copyright years.
[flashlight-appl] / src / flashlight_applet.c
index 464bd4b..641e8dd 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Flashlight applet (widget) for Maemo.
- *  Copyright (C) 2009 Roman Moravcik
+ *  Copyright (C) 2009, 2010 Roman Moravcik
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -69,7 +69,7 @@ flashlight_status_plugin_show_notification (FlashlightPlugin *plugin,
        g_return_if_fail (priv);
 
        banner = hildon_banner_show_information (GTK_WIDGET (priv->button), NULL, text);
-       hildon_banner_set_timeout (HILDON_BANNER (banner), 9000);
+       hildon_banner_set_timeout (HILDON_BANNER (banner), 3000);
 }
 
 static void
@@ -84,12 +84,14 @@ flashlight_status_plugin_enable (FlashlightPlugin *plugin,
                if (flashlight_open (priv->flashlight, "/dev/video0") < 0) {
                        flashlight_status_plugin_show_notification (plugin,
                                _("Unable to initialize flashlight.\nCamera in use by another application."));
+                       flashlight_close (priv->flashlight);
                        return;
                }
 
                if (flashlight_set_intensity (priv->flashlight, 1) < 0) {
                        flashlight_status_plugin_show_notification (plugin,
                                _("Unable to turn on flashlight."));
+                       flashlight_close (priv->flashlight);
                        return;
                }
 
@@ -322,6 +324,7 @@ flashlight_status_plugin_finalize (GObject *object)
        if (priv->hal) {
                libhal_device_remove_property_watch (priv->hal, CAM_COVER_UDI, NULL);
                libhal_ctx_set_user_data (priv->hal, NULL);
+               libhal_ctx_shutdown (priv->hal, NULL);
                libhal_ctx_free (priv->hal);
        }