[tracker] Remove tracker-files and tracker-services utilities
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Subject: [tracker] Remove tracker-files and tracker-services utilities
- Date: Thu, 16 Apr 2009 05:06:49 -0400 (EDT)
commit 5803c7cfb39f6721ec7a21984553a46e5b0a4028
Author: Jürg Billeter <j bitron ch>
Date: Wed Apr 15 15:59:02 2009 +0200
Remove tracker-files and tracker-services utilities
---
docs/manpages/Makefile.am | 2 -
docs/manpages/tracker-files.1 | 30 -----
docs/manpages/tracker-services.1 | 79 ------------
po/POTFILES.in | 2 -
src/tracker-utils/.gitignore | 3 -
src/tracker-utils/Makefile.am | 9 +--
src/tracker-utils/tracker-files.c | 232 ----------------------------------
src/tracker-utils/tracker-services.c | 163 ------------------------
8 files changed, 1 insertions(+), 519 deletions(-)
diff --git a/docs/manpages/Makefile.am b/docs/manpages/Makefile.am
index b99a3a2..376acc1 100644
--- a/docs/manpages/Makefile.am
+++ b/docs/manpages/Makefile.am
@@ -14,7 +14,6 @@ endif
man_MANS = \
tracker-extract.1 \
- tracker-files.1 \
tracker-search.1 \
tracker-stats.1 \
trackerd.1 \
@@ -22,7 +21,6 @@ man_MANS = \
tracker-tag.1 \
tracker-status.1 \
tracker.cfg.5 \
- tracker-services.1 \
tracker-info.1 \
$(tst) \
$(ta) \
diff --git a/docs/manpages/tracker-files.1 b/docs/manpages/tracker-files.1
deleted file mode 100644
index c7350d4..0000000
--- a/docs/manpages/tracker-files.1
+++ /dev/null
@@ -1,30 +0,0 @@
-.TH tracker-files 1 "July 2007" GNU "User Commands"
-
-.SH NAME
-tracker-files \- Return files filtered by the mime type or their category
-(called ServiceType)
-
-.SH SYNOPSIS
-.B tracker-files
-[-s ServiceType|-m MimeType]
-
-.SH DESCRIPTION
-.B tracker-files
-returns files that match the ServiceType or the mime-type provided.
-
-.SH OPTIONS
-.TP
-\-s ServiceType
-Specify the kind of the files you want to find. For more information on
-valid ServiceType see
-.BR tracker-services (1).
-
-.TP
-\-m MimeType
-Specify the mime-type of the files you want to find; see
-http://www.iana.org/assignments/media-types/ for the complete list of
-existing mime-type.
-
-.SH SEE ALSO
-.BR trackerd (1),
-.BR tracker-services (1).
diff --git a/docs/manpages/tracker-services.1 b/docs/manpages/tracker-services.1
deleted file mode 100644
index bf95f59..0000000
--- a/docs/manpages/tracker-services.1
+++ /dev/null
@@ -1,79 +0,0 @@
-.TH tracker-services 1 "July 2007" GNU "Conventions"
-
-.SH NAME
-tracker-services \- shows service types and propeties available in trackerd
-
-.SH SYNOPSIS
-.B tracker-services
-[-sp]
-
-.SH DESCRIPTION
-.PP
-.B tracker-services
-returns the services types and properties available in
-.BR tracker (1)
-.PP
-Trackerd understands a number of different service types which are used to
-group search results and documents together. All searches and queries can
-be refined by specifying a service type to search from.
-.PP
-For example one could search for "Roses" in the service Conversations
-which would only return hits from chat conversations.
-
-.SH OPTIONS
-.TP
-\-s
-Return service types.
-.TP
-\-p
-Return properties.
-.PP
-These options can be used simultaneously.
-
-.SH SERVICE TYPES
-Default services types (Note than applications can add more):
-.TP
-Files
-Search for files only. This does not include Emails or Conversations.
-.TP
-Folders
-Search for folders i.e. directories.
-.TP
-Documents
-Searches for general documents like word processing,
-spreadsheets or PDF.
-.TP
-Emails
-Searches for Emails.
-.TP
-EmailAttachments
-Search es for Email attachments.
-.TP
-Music
-Search for music files.
-.TP
-Images
-Search for image files.
-.TP
-Videos
-Search for video files.
-.TP
-Text
-Search for plain text files.
-.TP
-Development
-Search for development files. This includes make files,
-source code files and the like.
-.TP
-Other
-Search for documents which could not be put in one of the other services.
-.TP
-Applications
-Search for applications.
-
-.SH SEE ALSO
-.BR trackerd (1),
-.BR tracker-search (1),
-.BR tracker-search-tool (1),
-.BR tracker-query (1),
-.BR tracker-files (1).
diff --git a/po/POTFILES.in b/po/POTFILES.in
index afe2c4b..076264c 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -25,12 +25,10 @@ src/tracker-search-tool/tracker-search-tool-callbacks.c
src/tracker-search-tool/tracker-search-tool-support.c
src/tracker-search-tool/tracker-search-tool.c
src/tracker-search-tool/tracker-search-tool.desktop.in.in
-src/tracker-utils/tracker-files.c
src/tracker-utils/tracker-info.c
src/tracker-utils/tracker-meta-folder.c
src/tracker-utils/tracker-processes.c
src/tracker-utils/tracker-search.c
-src/tracker-utils/tracker-services.c
src/tracker-utils/tracker-stats.c
src/tracker-utils/tracker-status.c
src/tracker-utils/tracker-tag.c
diff --git a/src/tracker-utils/.gitignore b/src/tracker-utils/.gitignore
index 3cf2682..e2e28c9 100644
--- a/src/tracker-utils/.gitignore
+++ b/src/tracker-utils/.gitignore
@@ -1,10 +1,7 @@
-tracker-files
tracker-info
-tracker-meta-folder
tracker-processes
tracker-query
tracker-search
-tracker-services
tracker-stats
tracker-status
tracker-tag
diff --git a/src/tracker-utils/Makefile.am b/src/tracker-utils/Makefile.am
index 3e215f7..3f67376 100644
--- a/src/tracker-utils/Makefile.am
+++ b/src/tracker-utils/Makefile.am
@@ -23,11 +23,9 @@ bin_PROGRAMS = \
tracker-search \
tracker-stats \
tracker-tag \
- tracker-files \
tracker-status \
tracker-info \
- tracker-processes \
- tracker-services
+ tracker-processes
tracker_search_SOURCES = tracker-search.c
tracker_search_LDADD = $(libs)
@@ -38,9 +36,6 @@ tracker_stats_LDADD = $(libs)
tracker_tag_SOURCES = tracker-tag.c
tracker_tag_LDADD = $(libs)
-tracker_files_SOURCES = tracker-files.c
-tracker_files_LDADD = $(libs)
-
tracker_status_SOURCES = tracker-status.c
tracker_status_LDADD = $(libs)
@@ -50,5 +45,3 @@ tracker_info_LDADD = $(libs)
tracker_processes_SOURCES = tracker-processes.c
tracker_processes_LDADD = $(libs)
-tracker_services_SOURCES = tracker-services.c
-tracker_services_LDADD = $(libs)
diff --git a/src/tracker-utils/tracker-files.c b/src/tracker-utils/tracker-files.c
deleted file mode 100644
index e9108aa..0000000
--- a/src/tracker-utils/tracker-files.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2006, Mr Jamie McCracken (jamiemcc gnome org)
- * Copyright (C) 2008, Nokia
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <locale.h>
-
-#include <glib.h>
-#include <glib/gi18n.h>
-
-#include <libtracker/tracker.h>
-#include <libtracker-common/tracker-common.h>
-
-static gchar *service;
-static gchar **mimes;
-static gint limit = 512;
-static gint offset;
-
-static GOptionEntry entries[] = {
- { "service", 's', 0, G_OPTION_ARG_STRING, &service,
- N_("Search for specified service"),
- /* Translators: this will appear like --option=STRING running --help */
- N_("STRING")
- },
- { "limit", 'l', 0, G_OPTION_ARG_INT, &limit,
- N_("Set the total number of displayed results (default 512)"),
- /* Translators: this will appear like --option=NUMBER running --help */
- N_("NUMBER")
- },
- { "offset", 'o', 0, G_OPTION_ARG_INT, &offset,
- N_("Set the offset for displayed results (default 0)"),
- /* Translators: this will appear like --option=NUMBER running --help */
- N_("NUMBER")
- },
- { "add-mime", 'm', 0, G_OPTION_ARG_STRING_ARRAY, &mimes,
- N_("Search for specified MIME type (can be used multiple times)"),
- /* Translators: this will appear like --option=STRING running --help */
- N_("STRING")
- },
- { NULL }
-};
-
-int
-main (int argc, char **argv)
-{
- TrackerClient *client;
- ServiceType type;
- GOptionContext *context;
- GError *error = NULL;
-
- setlocale (LC_ALL, "");
-
- bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
- context = g_option_context_new (_("- Search for files by service or by MIME type"));
- g_option_context_add_main_entries (context, entries, NULL);
- g_option_context_parse (context, &argc, &argv, NULL);
-
- if (!service && !mimes) {
- gchar *help;
-
- help = g_option_context_get_help (context, TRUE, NULL);
- g_option_context_free (context);
- g_printerr ("%s", help);
- g_free (help);
-
- return EXIT_FAILURE;
- }
-
- g_option_context_free (context);
-
- client = tracker_connect (FALSE);
-
- if (!client) {
- g_printerr ("%s\n",
- _("Could not establish a DBus connection to Tracker"));
- return EXIT_FAILURE;
- }
-
- /* TODO: Port to SPARQL */
-#if 0
- if (service) {
- gchar **array;
- gchar **p;
- gint length;
-
- type = tracker_service_name_to_type (service);
-
- if (type == SERVICE_OTHER_FILES && g_ascii_strcasecmp (service, "Other")) {
- g_printerr ("%s\n",
- _("Service not recognized, searching in other files..."));
- }
-
- array = tracker_files_get_by_service_type (client,
- time (NULL),
- type,
- offset,
- limit,
- &error);
-
- if (error) {
- g_printerr ("%s:'%s', %s\n",
- _("Could not get files by service type"),
- service,
- error->message);
- g_error_free (error);
-
- return EXIT_FAILURE;
- }
-
- if (!array) {
- g_print ("%s\n",
- _("No files found by that service type"));
- return EXIT_FAILURE;
- }
-
- length = g_strv_length (array);
-
- g_print (tracker_dngettext (NULL,
- _("Result: %d"),
- _("Results: %d"),
- length),
- length);
- g_print ("\n");
-
- for (p = array; *p; p++) {
- g_print (" %s\n", *p);
- }
-
- if (length >= limit) {
- /* Display '...' so the user thinks there is
- * more items.
- */
- g_print (" ...\n");
-
- /* Display warning so the user knows this is
- * not the WHOLE data set.
- */
- g_printerr ("\n"
- "%s\n",
- _("NOTE: Limit was reached, there are more items in the database not listed here"));
- }
-
- g_strfreev (array);
- }
-
- if (mimes) {
- gchar **array;
- gchar **p;
- gint length;
-
- array = tracker_files_get_by_mime_type (client,
- time (NULL),
- mimes,
- offset,
- limit,
- &error);
-
- if (error) {
- g_printerr ("%s, %s\n",
- _("Could not get files by MIME type"),
- error->message);
- g_error_free (error);
-
- return EXIT_FAILURE;
- }
-
- if (!array) {
- g_print ("%s\n",
- _("No files found by those MIME types"));
-
- return EXIT_FAILURE;
- }
-
- length = g_strv_length (array);
-
- g_print (tracker_dngettext (NULL,
- _("Result: %d"),
- _("Results: %d"),
- length),
- length);
- g_print ("\n");
-
- for (p = array; *p; p++) {
- g_print (" %s\n", *p);
- }
-
- if (length >= limit) {
- /* Display '...' so the user thinks there is
- * more items.
- */
- g_print (" ...\n");
-
- /* Display warning so the user knows this is
- * not the WHOLE data set.
- */
- g_printerr ("\n"
- "%s\n",
- _("NOTE: Limit was reached, there are more items in the database not listed here"));
- }
-
- g_strfreev (array);
- }
-#endif
-
- tracker_disconnect (client);
-
- return EXIT_SUCCESS;
-}
diff --git a/src/tracker-utils/tracker-services.c b/src/tracker-utils/tracker-services.c
deleted file mode 100644
index 878e7fd..0000000
--- a/src/tracker-utils/tracker-services.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2006, Mr Jamie McCracken (jamiemcc gnome org)
- * Copyright (C) 2008, Nokia
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <locale.h>
-
-#include <glib.h>
-#include <glib/gi18n.h>
-
-#include <libtracker/tracker.h>
-
-static gboolean services = FALSE;
-static gboolean properties = FALSE;
-
-static GOptionEntry entries[] = {
- { "service-types", 's', 0, G_OPTION_ARG_NONE, &services,
- N_("Return the known service types"),
- NULL
- },
- { "properties", 'p', 0, G_OPTION_ARG_NONE, &properties,
- N_("Return the known properties"),
- NULL
- },
- { NULL }
-};
-
-int
-main (int argc, char **argv)
-{
- TrackerClient *client;
- GOptionContext *context;
- gchar **array;
- GError *error = NULL;
-
- setlocale (LC_ALL, "");
-
- bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
- /* Translators: this messagge will apper immediately after the */
- /* usage string - Usage: COMMAND [OPTION]... <THIS_MESSAGE> */
- context = g_option_context_new (_(" - Show all available service types and properties in tracker"));
- g_option_context_add_main_entries (context, entries, "tracker-services");
- g_option_context_parse (context, &argc, &argv, NULL);
-
- if (!services && !properties) {
- gchar *help;
-
- help = g_option_context_get_help (context, TRUE, NULL);
- g_option_context_free (context);
- g_printerr ("%s", help);
- g_free (help);
-
- return EXIT_FAILURE;
- }
-
- g_option_context_free (context);
-
- client = tracker_connect (FALSE);
-
- if (!client) {
- g_printerr ("%s\n",
- _("Could not establish a DBus connection to Tracker"));
- return EXIT_FAILURE;
- }
-
- /* TODO: Port to SPARQL */
-#if 0
- if (services) {
- array = tracker_metadata_get_registered_classes (client, &error);
-
- if (error) {
- g_printerr ("%s, %s\n",
- _("Could not get Tracker services"),
- error->message);
- g_error_free (error);
-
- return EXIT_FAILURE;
- }
-
- if (!array) {
- g_print ("%s\n",
- _("No services available"));
- } else {
- gchar **p;
-
- g_print ("%s:\n",
- _("Service types available in Tracker"));
-
- for (p = array; *p; p++) {
- g_print (" %s\n", *p);
- }
-
- g_strfreev (array);
- }
- }
-
- if (properties) {
- array = tracker_metadata_get_registered_types (client, "*", &error);
-
- if (error) {
- g_printerr ("%s, %s\n",
- _("Could not get Tracker properties"),
- error->message);
- g_error_free (error);
-
- return EXIT_FAILURE;
- }
-
- if (!array) {
- g_print ("%s\n",
- _("No properties available"));
- } else {
- GList *l, *sorted = NULL;
- gchar **p;
-
- g_print ("%s:\n",
- _("Properties available in Tracker"));
-
- for (p = array; *p; p++) {
- sorted = g_list_insert_sorted (sorted,
- *p,
- (GCompareFunc) strcmp);
- }
-
- for (l = sorted; l; l = g_list_next (l)) {
- g_print (" %s\n", (const gchar*) l->data);
- }
-
- g_list_free (sorted);
- g_strfreev (array);
- }
-
- }
-#endif
-
- tracker_disconnect (client);
-
- return EXIT_SUCCESS;
-}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]