Commit f5b8cc1c authored by Jamie McCracken's avatar Jamie McCracken

added tracker-status

svn path=/trunk/; revision=649
parent df7049fd
2007-07-10 Patch from Jerry Tan <Jerry.Tan@Sun.COM>
* Added GetStatus Dbus nmethod and tracker-status app
2007-07-10 Luca Ferretti <elle.uca@libero.it>
* src/tracker-search-tool/tracker-search-tool.c: (do_search):
show GtkNotebook labels translated
2007-07-09 Patch from Halton Huo <Halton.Huo@Sun.COM>
* Fixed various crashers (solaris specific only)
......
......@@ -137,6 +137,8 @@ Additional recommended packages:
* GTK and Gnome stack for GUI tools
* libglade (for tracker-preferences UI)
* unac (accent stripper)
* exempi
* libxml2
Optional run-time dependency:
......@@ -213,6 +215,10 @@ parameters to autogen.sh EG ./autogen.sh --disable-fam)
--disable-libtracker-gtk : disables the building of libtracker-gtk
--disable-libxml2 : disables HTML/XML extractors (full-text will still be available)
--disable-xmp : disables XMP extraction
RUNNING TRACKER
......
......@@ -71,6 +71,13 @@
<arg type="i" name="version" direction="out" />
</method>
<!-- Return the status of tracker daemon -->
<method name="GetStatus">
<arg type="s" name="status" direction="out" />
</method>
<!-- Gets all implemented services and also returns any corresponding metadata type class for the service (IE "File", "Doc", "Image" etc)
If main_services_only is set to true then only the major services are returned
......
......@@ -14,7 +14,7 @@ libtrackerclient_la_LDFLAGS = -version-info 0:0:0
include_HEADERS = tracker.h tracker-client.h
bin_PROGRAMS = tracker-search tracker-query tracker-meta-folder tracker-stats tracker-tag tracker-files
bin_PROGRAMS = tracker-search tracker-query tracker-meta-folder tracker-stats tracker-tag tracker-files tracker-status
tracker_search_SOURCES = tracker-search.c
......@@ -44,6 +44,14 @@ tracker_stats_LDADD = $(GLIB2_LIBS) \
$(GOBJECT_LIBS) \
libtrackerclient.la
tracker_status_SOURCES = tracker-status.c
tracker_status_LDADD = $(GLIB2_LIBS) \
$(DBUS_LIBS) \
$(GOBJECT_LIBS) \
libtrackerclient.la
tracker_tag_SOURCES = tracker-tag.c
tracker_tag_LDADD = $(GLIB2_LIBS) \
......
......@@ -52,6 +52,44 @@ static
inline
#endif
gboolean
org_freedesktop_Tracker_get_status (DBusGProxy *proxy, char ** OUT_status, GError **error)
{
return dbus_g_proxy_call (proxy, "GetStatus", error, G_TYPE_INVALID, G_TYPE_STRING, OUT_status, G_TYPE_INVALID);
}
typedef void (*org_freedesktop_Tracker_get_status_reply) (DBusGProxy *proxy, char * OUT_status, GError *error, gpointer userdata);
static void
org_freedesktop_Tracker_get_status_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
char * OUT_status;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING, &OUT_status, G_TYPE_INVALID);
(*(org_freedesktop_Tracker_get_status_reply)data->cb) (proxy, OUT_status, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_freedesktop_Tracker_get_status_async (DBusGProxy *proxy, org_freedesktop_Tracker_get_status_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "GetStatus", org_freedesktop_Tracker_get_status_async_callback, stuff, g_free, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_freedesktop_Tracker_get_services (DBusGProxy *proxy, const gboolean IN_main_services_only, GHashTable** OUT_result, GError **error)
{
......
......@@ -324,7 +324,13 @@ tracker_get_version (TrackerClient *client, GError **error)
return version;
}
char *
tracker_get_status (TrackerClient *client, GError **error)
{
char *status ;
org_freedesktop_Tracker_get_status (client->proxy, &status, &*error);
return status;
}
GHashTable *
......@@ -818,6 +824,20 @@ tracker_get_version_async (TrackerClient *client, TrackerIntReply callback, gpoi
}
void
tracker_get_status_async (TrackerClient *client, TrackerStringReply callback, gpointer user_data)
{
StringCallBackStruct *callback_struct;
callback_struct = g_new (StringCallBackStruct, 1);
callback_struct->callback = callback;
callback_struct->data = user_data;
client->last_pending_call = org_freedesktop_Tracker_get_status_async (client->proxy, tracker_string_reply, callback_struct);
}
......
......@@ -101,6 +101,7 @@ void tracker_disconnect (TrackerClient *client);
/* synchronous calls */
int tracker_get_version (TrackerClient *client, GError **error);
char * tracker_get_status (TrackerClient *client, GError **error);
GHashTable * tracker_get_services (TrackerClient *client, gboolean main_services_only, GError **error);
GPtrArray * tracker_get_stats (TrackerClient *client, GError **error);
......@@ -156,6 +157,7 @@ char ** tracker_search_metadata_by_text_and_location (TrackerClient *client, c
void tracker_get_version_async (TrackerClient *client, TrackerIntReply callback, gpointer user_data);
void tracker_get_status_async (TrackerClient *client, TrackerStringReply callback, gpointer user_data);
void tracker_get_services_async (TrackerClient *client, gboolean main_services_only, TrackerHashTableReply callback, gpointer user_data);
void tracker_get_stats_async (TrackerClient *client, TrackerGPtrArrayReply callback, gpointer user_data);
......
......@@ -134,9 +134,12 @@ NULL
static service_info_t services[11] = {
{ N_("Emails"), "stock_mail", SERVICE_EMAILS , NULL, NULL, FALSE, 0, 0,0 },
{ N_("All Files"), "system-file-manager", SERVICE_FILES , NULL, NULL, FALSE, 0, 0,0 },
// { N_("Conversations"),"system-file-manager", SERVICE_CONVERSATIONS , NULL, NULL, FALSE, 0, 0,0 },
// { N_("Applications"), "system-file-manager", SERVICE_APPLICATIONS , NULL, NULL, FALSE, 0, 0,0 },
// { N_("Attachments"), "system-file-manager", SERVICE_EMAILATTACHMENTS , NULL, NULL, FALSE, 0, 0,0 },
{ N_("Folders"), "folder", SERVICE_FOLDERS , NULL, NULL, FALSE, 0, 0,0 },
{ N_("Documents"), "x-office-document", SERVICE_DOCUMENTS , NULL, NULL, FALSE, 0, 0,0 },
{ N_("Images"), "image-x-generic", SERVICE_IMAGES , NULL, NULL, FALSE, 0, 0,0 },
{ N_("Documents"), "x-office-document", SERVICE_DOCUMENTS , NULL, NULL, FALSE, 0, 0,0 },
{ N_("Images"), "image-x-generic", SERVICE_IMAGES , NULL, NULL, FALSE, 0, 0,0 },
{ N_("Music"), "audio-x-generic", SERVICE_MUSIC , NULL, NULL, FALSE, 0, 0,0 },
{ N_("Videos"), "video-x-generic", SERVICE_VIDEOS , NULL, NULL, FALSE, 0, 0,0 },
{ N_("Text"), "text-x-generic", SERVICE_TEXT_FILES , NULL, NULL, FALSE, 0, 0,0 },
......
......@@ -145,6 +145,11 @@ message_func (DBusConnection *conn,
rec->action = DBUS_ACTION_GET_VERSION;
} else if (dbus_message_is_method_call (message, TRACKER_INTERFACE, TRACKER_METHOD_GET_STATUS)) {
dbus_message_ref (message);
rec->action = DBUS_ACTION_GET_STATUS;
} else if (dbus_message_is_method_call (message, TRACKER_INTERFACE_METADATA, TRACKER_METHOD_METADATA_GET)) {
......
......@@ -43,6 +43,7 @@
#define TRACKER_METHOD_GET_STATS "GetStats"
#define TRACKER_METHOD_GET_SERVICES "GetServices"
#define TRACKER_METHOD_GET_VERSION "GetVersion"
#define TRACKER_METHOD_GET_STATUS "GetStatus"
/* metadata interface */
#define TRACKER_METHOD_METADATA_GET "Get"
......@@ -112,6 +113,7 @@ typedef enum {
DBUS_ACTION_GET_SERVICES,
DBUS_ACTION_GET_STATS,
DBUS_ACTION_GET_VERSION,
DBUS_ACTION_GET_STATUS,
DBUS_ACTION_METADATA_GET,
DBUS_ACTION_METADATA_SET,
......
......@@ -1435,6 +1435,18 @@ process_user_request_queue_thread (void)
break;
case DBUS_ACTION_GET_STATUS:
reply = dbus_message_new_method_return (rec->message);
char *tracker_status[] = {"Initializing","Watching","Indexing","Pending","Optimizing","Idle","Shutdown"};
char* status = tracker_status[tracker->status];
dbus_message_append_args (reply,
DBUS_TYPE_STRING, &status,
DBUS_TYPE_INVALID);
dbus_connection_send (rec->connection, reply, NULL);
dbus_message_unref (reply);
break;
case DBUS_ACTION_METADATA_GET:
......
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