summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2009-01-23 17:14:02 +0000
committerRichard Hughes <richard@hughsie.com>2009-01-23 17:14:02 +0000
commit39df99ae208e0f5c38e041de7c6050c1f77ceace (patch)
treef6adabdaea82e2729d64ba6cb56cc67bdd5c769f /tools
parent44b2ad6bc2e64365c92f401229804949c2a748a6 (diff)
trivial: add a fixme
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile.am1
-rw-r--r--tools/dkp-tool.c45
2 files changed, 21 insertions, 25 deletions
diff --git a/tools/Makefile.am b/tools/Makefile.am
index c4309a0..30fb7d8 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -1,7 +1,6 @@
## Process this file with automake to produce Makefile.in
INCLUDES = \
- -I$(top_builddir)/src -I$(top_srcdir)/src \
-DPACKAGE_LIBEXEC_DIR=\""$(libexecdir)"\" \
-DPACKAGE_SYSCONF_DIR=\""$(sysconfdir)"\" \
-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
diff --git a/tools/dkp-tool.c b/tools/dkp-tool.c
index 3881516..6f792af 100644
--- a/tools/dkp-tool.c
+++ b/tools/dkp-tool.c
@@ -31,9 +31,10 @@
#include <glib/gi18n-lib.h>
#include "dkp-marshal.h"
-#include "egg-debug.h"
#include "dkp-client.h"
-#include "dkp-client-device.h"
+#include "dkp-device.h"
+
+#include "egg-debug.h"
static GMainLoop *loop;
static gboolean opt_monitor_detail = FALSE;
@@ -42,11 +43,11 @@ static gboolean opt_monitor_detail = FALSE;
* dkp_tool_device_added_cb:
**/
static void
-dkp_tool_device_added_cb (DkpClient *client, const DkpClientDevice *device, gpointer user_data)
+dkp_tool_device_added_cb (DkpClient *client, const DkpDevice *device, gpointer user_data)
{
- g_print ("device added: %s\n", dkp_client_device_get_object_path (device));
+ g_print ("device added: %s\n", dkp_device_get_object_path (device));
if (opt_monitor_detail) {
- dkp_client_device_print (device);
+ dkp_device_print (device);
g_print ("\n");
}
}
@@ -55,12 +56,12 @@ dkp_tool_device_added_cb (DkpClient *client, const DkpClientDevice *device, gpoi
* dkp_tool_device_changed_cb:
**/
static void
-dkp_tool_device_changed_cb (DkpClient *client, const DkpClientDevice *device, gpointer user_data)
+dkp_tool_device_changed_cb (DkpClient *client, const DkpDevice *device, gpointer user_data)
{
- g_print ("device changed: %s\n", dkp_client_device_get_object_path (device));
+ g_print ("device changed: %s\n", dkp_device_get_object_path (device));
if (opt_monitor_detail) {
/* TODO: would be nice to just show the diff */
- dkp_client_device_print (device);
+ dkp_device_print (device);
g_print ("\n");
}
}
@@ -69,9 +70,9 @@ dkp_tool_device_changed_cb (DkpClient *client, const DkpClientDevice *device, gp
* dkp_tool_device_removed_cb:
**/
static void
-dkp_tool_device_removed_cb (DkpClient *client, const DkpClientDevice *device, gpointer user_data)
+dkp_tool_device_removed_cb (DkpClient *client, const DkpDevice *device, gpointer user_data)
{
- g_print ("device removed: %s\n", dkp_client_device_get_object_path (device));
+ g_print ("device removed: %s\n", dkp_device_get_object_path (device));
if (opt_monitor_detail)
g_print ("\n");
}
@@ -134,7 +135,7 @@ main (int argc, char **argv)
unsigned int n;
DkpClient *client;
- DkpClientDevice *device;
+ DkpDevice *device;
const GOptionEntry entries[] = {
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, _("Show extra debugging information"), NULL },
@@ -169,24 +170,20 @@ main (int argc, char **argv)
if (opt_enumerate || opt_dump) {
GPtrArray *devices;
- const gchar *object_path;
- devices = dkp_client_enumerate_devices (client, NULL);
+ devices = dkp_client_enumerate_devices (client);
if (devices == NULL)
goto out;
for (n=0; n < devices->len; n++) {
- object_path = (const gchar *) g_ptr_array_index (devices, n);
+ device = (DkpDevice*) g_ptr_array_index (devices, n);
if (opt_enumerate) {
- g_print ("%s\n", object_path);
+ g_print ("%s\n", dkp_device_get_object_path (device));
} else {
- g_print ("Device: %s\n", object_path);
- device = dkp_client_device_new ();
- dkp_client_device_set_object_path (device, object_path);
- dkp_client_device_print (device);
+ g_print ("Device: %s\n", dkp_device_get_object_path (device));
+ dkp_device_print (device);
g_print ("\n");
- g_object_unref (device);
}
}
- g_ptr_array_foreach (devices, (GFunc) g_free, NULL);
+ g_ptr_array_foreach (devices, (GFunc) g_object_unref, NULL);
g_ptr_array_free (devices, TRUE);
if (opt_dump) {
g_print ("Daemon:\n");
@@ -196,9 +193,9 @@ main (int argc, char **argv)
if (!dkp_tool_do_monitor (client))
goto out;
} else if (opt_show_info != NULL) {
- device = dkp_client_device_new ();
- dkp_client_device_set_object_path (device, opt_show_info);
- dkp_client_device_print (device);
+ device = dkp_device_new ();
+ dkp_device_set_object_path (device, opt_show_info);
+ dkp_device_print (device);
g_object_unref (device);
}