summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2008-11-12 09:58:36 +0000
committerRichard Hughes <richard@hughsie.com>2008-11-12 09:58:36 +0000
commit35bd038ac79957d22cea6c9b5b50f1f003c427d7 (patch)
tree9a3c383c53fa1134ce7e067a89175b2b2d8c92e2 /src
parent0f560f820e7ee27b9849d9178686a9b8557bbeaa (diff)
trivial cleanups of davidz patch -- no functional changes
Diffstat (limited to 'src')
-rw-r--r--src/dkp-csr.c10
-rw-r--r--src/dkp-daemon.c100
2 files changed, 52 insertions, 58 deletions
diff --git a/src/dkp-csr.c b/src/dkp-csr.c
index b73efff..8815a40 100644
--- a/src/dkp-csr.c
+++ b/src/dkp-csr.c
@@ -90,7 +90,7 @@ dkp_csr_poll_cb (DkpCsr *csr)
/**
* dkp_csr_find_device:
**/
-static struct usb_device *
+static struct usb_device *
dkp_csr_find_device (DkpCsr *csr)
{
struct usb_bus *curr_bus;
@@ -107,14 +107,14 @@ dkp_csr_find_device (DkpCsr *csr)
if (g_strcasecmp (dir_name, curr_bus->dirname))
continue;
- for (curr_device = curr_bus->devices; curr_device != NULL;
+ for (curr_device = curr_bus->devices; curr_device != NULL;
curr_device = curr_device->next) {
/* egg_debug ("Checking port: [%s]", curr_device->filename); */
if (g_strcasecmp (filename, curr_device->filename))
continue;
- egg_debug ("Matched device: [%s][%s][%04X:%04X]", curr_bus->dirname,
- curr_device->filename,
- curr_device->descriptor.idVendor,
+ egg_debug ("Matched device: [%s][%s][%04X:%04X]", curr_bus->dirname,
+ curr_device->filename,
+ curr_device->descriptor.idVendor,
curr_device->descriptor.idProduct);
goto out;
}
diff --git a/src/dkp-daemon.c b/src/dkp-daemon.c
index e72a80b..e4d50a2 100644
--- a/src/dkp-daemon.c
+++ b/src/dkp-daemon.c
@@ -155,34 +155,34 @@ dkp_daemon_get_property (GObject *object,
daemon = DKP_DAEMON (object);
- switch (prop_id) {
+ switch (prop_id) {
- case PROP_DAEMON_VERSION:
- g_value_set_string (value, PACKAGE_VERSION);
- break;
+ case PROP_DAEMON_VERSION:
+ g_value_set_string (value, PACKAGE_VERSION);
+ break;
- case PROP_CAN_SUSPEND:
+ case PROP_CAN_SUSPEND:
/* TODO: for now assume we can always suspend */
- g_value_set_boolean (value, TRUE);
- break;
+ g_value_set_boolean (value, TRUE);
+ break;
- case PROP_CAN_HIBERNATE:
+ case PROP_CAN_HIBERNATE:
/* TODO for now assume we can always hibernate */
- g_value_set_boolean (value, TRUE);
- break;
+ g_value_set_boolean (value, TRUE);
+ break;
- case PROP_ON_BATTERY:
- g_value_set_boolean (value, daemon->priv->on_battery);
- break;
+ case PROP_ON_BATTERY:
+ g_value_set_boolean (value, daemon->priv->on_battery);
+ break;
- case PROP_ON_LOW_BATTERY:
- g_value_set_boolean (value, daemon->priv->on_battery && daemon->priv->low_battery);
- break;
+ case PROP_ON_LOW_BATTERY:
+ g_value_set_boolean (value, daemon->priv->on_battery && daemon->priv->low_battery);
+ break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
}
/**
@@ -203,8 +203,7 @@ dkp_daemon_class_init (DkpDaemonClass *klass)
g_signal_new ("device-added",
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
- 0,
- NULL, NULL,
+ 0, NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1, G_TYPE_STRING);
@@ -212,8 +211,7 @@ dkp_daemon_class_init (DkpDaemonClass *klass)
g_signal_new ("device-removed",
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
- 0,
- NULL, NULL,
+ 0, NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1, G_TYPE_STRING);
@@ -221,8 +219,7 @@ dkp_daemon_class_init (DkpDaemonClass *klass)
g_signal_new ("device-changed",
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
- 0,
- NULL, NULL,
+ 0, NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1, G_TYPE_STRING);
@@ -230,47 +227,46 @@ dkp_daemon_class_init (DkpDaemonClass *klass)
g_signal_new ("changed",
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
- 0,
- NULL, NULL,
+ 0, NULL, NULL,
g_cclosure_marshal_VOID__BOOLEAN,
G_TYPE_NONE, 0);
- g_object_class_install_property (object_class,
- PROP_DAEMON_VERSION,
- g_param_spec_string ("daemon-version",
- "Daemon Version",
- "The version of the running daemon",
- NULL,
- G_PARAM_READABLE));
+ g_object_class_install_property (object_class,
+ PROP_DAEMON_VERSION,
+ g_param_spec_string ("daemon-version",
+ "Daemon Version",
+ "The version of the running daemon",
+ NULL,
+ G_PARAM_READABLE));
- g_object_class_install_property (object_class,
- PROP_CAN_SUSPEND,
- g_param_spec_boolean ("can-suspend",
+ g_object_class_install_property (object_class,
+ PROP_CAN_SUSPEND,
+ g_param_spec_boolean ("can-suspend",
"Can Suspend",
"Whether the system can suspend",
FALSE,
G_PARAM_READABLE));
- g_object_class_install_property (object_class,
- PROP_CAN_SUSPEND,
- g_param_spec_boolean ("can-hibernate",
+ g_object_class_install_property (object_class,
+ PROP_CAN_SUSPEND,
+ g_param_spec_boolean ("can-hibernate",
"Can Hibernate",
"Whether the system can hibernate",
FALSE,
G_PARAM_READABLE));
- g_object_class_install_property (object_class,
- PROP_ON_BATTERY,
- g_param_spec_boolean ("on-battery",
+ g_object_class_install_property (object_class,
+ PROP_ON_BATTERY,
+ g_param_spec_boolean ("on-battery",
"On Battery",
"Whether the system is running on battery",
FALSE,
G_PARAM_READABLE));
- g_object_class_install_property (object_class,
- PROP_ON_LOW_BATTERY,
- g_param_spec_boolean ("on-low-battery",
+ g_object_class_install_property (object_class,
+ PROP_ON_LOW_BATTERY,
+ g_param_spec_boolean ("on-low-battery",
"On Low Battery",
"Whether the system is running on battery and if the battery is critically low",
FALSE,
@@ -375,15 +371,13 @@ gpk_daemon_dbus_filter (DBusConnection *connection, DBusMessage *message, void *
interface = dbus_message_get_interface (message);
- if (dbus_message_is_signal (message, DBUS_INTERFACE_DBUS, "NameOwnerChanged")) {
- /* pass NameOwnerChanged signals from the bus to PolKitTracker */
+ /* pass NameOwnerChanged signals from the bus to PolKitTracker */
+ if (dbus_message_is_signal (message, DBUS_INTERFACE_DBUS, "NameOwnerChanged"))
polkit_tracker_dbus_func (daemon->priv->pk_tracker, message);
- }
- if (interface != NULL && g_str_has_prefix (interface, "org.freedesktop.ConsoleKit")) {
- /* pass ConsoleKit signals to PolKitTracker */
+ /* pass ConsoleKit signals to PolKitTracker */
+ if (interface != NULL && g_str_has_prefix (interface, "org.freedesktop.ConsoleKit"))
polkit_tracker_dbus_func (daemon->priv->pk_tracker, message);
- }
/* other filters might want to process this message too */
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;