Commit 7c794c95 authored by Martyn James Russell's avatar Martyn James Russell

Also sorted all properties returned by tracker-services.

	* src/tracker-utils/tracker-services.c: Also sorted all properties
	returned by tracker-services. 

	* src/tracker-utils/tracker-files.c: 
	* src/tracker-utils/tracker-info.c: 
	* src/tracker-utils/tracker-meta-folder.c:
	* src/tracker-utils/tracker-query.c: 
	* src/tracker-utils/tracker-search.c: 
	* src/tracker-utils/tracker-tag.c: 
	* src/tracker-utils/tracker-unique.c: Added extra warning to all
	utils which have a --limit option so the user knows that there are
	more results if the limit is reached and not listed to stdout.
	Fixed the singular/plural issues with "Results".

svn path=/trunk/; revision=2931
parent 9ab8c171
2009-02-16 Martyn Russell <martyn@imendio.com>
* src/tracker-utils/tracker-services.c: Also sorted all properties
returned by tracker-services.
* src/tracker-utils/tracker-files.c:
* src/tracker-utils/tracker-info.c:
* src/tracker-utils/tracker-meta-folder.c:
* src/tracker-utils/tracker-query.c:
* src/tracker-utils/tracker-search.c:
* src/tracker-utils/tracker-tag.c:
* src/tracker-utils/tracker-unique.c: Added extra warning to all
utils which have a --limit option so the user knows that there are
more results if the limit is reached and not listed to stdout.
Fixed the singular/plural issues with "Results".
2009-02-16 Philip Van Hoof <philip@codeminded.be>
* src/tracker-extract/tracker-extract-ps.c
......@@ -7,7 +23,7 @@
2009-02-12 Mikael Ottela <mikael.ottela@ixonos.com>
* src/tracker-extract/tracker-extract-png.c:
data/services/default.service: Handle also sketch/png mime
data/services/default.service: Handle also sketch/png mime
correctly.
Fixes NB #101593
......@@ -61,8 +77,7 @@
2009-02-12 Martyn Russell <martyn@imendio.com>
* src/libtracker-common/tracker-ioprio.c:
* src/tracker-indexer
/tracker-main.c:
* src/tracker-indexer/tracker-main.c:
* src/trackerd/tracker-main.c: Use SCHED_IDLE for the process
scheduling to improve responsiveness of phone calls and other real
time applications. Fixes NB#95573.
......
......@@ -101,7 +101,8 @@ main (int argc, char **argv)
if (service) {
gchar **array;
gchar **p_strarray;
gchar **p;
gint length;
type = tracker_service_name_to_type (service);
......@@ -133,11 +134,31 @@ main (int argc, char **argv)
return EXIT_FAILURE;
}
g_print ("%s:\n",
_("Results"));
length = g_strv_length (array);
for (p_strarray = array; *p_strarray; p_strarray++) {
g_print (" %s\n", *p_strarray);
g_print (g_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);
......@@ -146,6 +167,7 @@ main (int argc, char **argv)
if (mimes) {
gchar **array;
gchar **p;
gint length;
array = tracker_files_get_by_mime_type (client,
time (NULL),
......@@ -170,13 +192,33 @@ main (int argc, char **argv)
return EXIT_FAILURE;
}
g_print ("%s:\n",
_("Results"));
length = g_strv_length (array);
g_print (g_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);
}
......
......@@ -54,7 +54,7 @@ print_property_value (gpointer value)
pair = value;
g_print ("%s - %s\n", pair[0], pair[1]);
g_print (" '%s' = '%s'\n", pair[0], pair[1]);
}
int
......@@ -146,8 +146,16 @@ main (int argc, char **argv)
g_print ("%s\n",
_("No metadata available for that uri"));
} else {
g_print ("%s\n",
_("Results:"));
gint length;
length = results->len;
g_print (g_dngettext (NULL,
_("Result: %d"),
_("Results: %d"),
length),
length);
g_print ("\n");
g_ptr_array_foreach (results, (GFunc) print_property_value, NULL);
g_ptr_array_foreach (results, (GFunc) g_strfreev, NULL);
......
......@@ -167,7 +167,7 @@ main (int argc, char **argv)
summary = g_strconcat (_("To use multiple meta-data types simply list them, for example:"),
"\n"
"\n"
" -p ", _("PATH"), " File:Size File:Type",
" -p ", _("PATH"), " File:Size",
NULL);
g_option_context_set_summary (context, summary);
......@@ -259,9 +259,17 @@ main (int argc, char **argv)
g_print ("%s\n",
_("No meta-data found for files in that directory"));
} else {
g_print ("%s:\n",
_("Results"));
gint length;
length = array->len;
g_print (g_dngettext (NULL,
_("Result: %d"),
_("Results: %d"),
length),
length);
g_print ("\n");
print_header (fields_resolved);
g_ptr_array_foreach (array,
......
......@@ -240,8 +240,33 @@ main (int argc, char **argv)
g_print ("%s\n",
_("No results found matching your query"));
} else {
gint length;
length = array->len;
g_print (g_dngettext (NULL,
_("Result: %d"),
_("Results: %d"),
length),
length);
g_print ("\n");
g_ptr_array_foreach (array, (GFunc) get_meta_table_data, NULL);
g_ptr_array_free (array, TRUE);
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"));
}
}
tracker_disconnect (client);
......
......@@ -216,8 +216,16 @@ main (int argc, char **argv)
g_print ("%s\n",
_("No results found matching your query"));
} else {
g_print ("%s\n",
_("Results:"));
gint length;
length = g_strv_length (strv);
g_print (g_dngettext (NULL,
_("Result: %d"),
_("Results: %d"),
length),
length);
g_print ("\n");
g_ptr_array_foreach (array, (GFunc) get_meta_table_data, NULL);
g_ptr_array_free (array, TRUE);
......@@ -247,8 +255,16 @@ main (int argc, char **argv)
g_print ("%s\n",
_("No results found matching your query"));
} else {
g_print ("%s:\n",
_("Results"));
gint length;
length = g_strv_length (strv);
g_print (g_dngettext (NULL,
_("Result: %d"),
_("Results: %d"),
length),
length);
g_print ("\n");
for (p = strv; *p; p++) {
gchar *s;
......@@ -263,6 +279,21 @@ main (int argc, char **argv)
g_free (s);
}
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_free (strv);
}
}
......
......@@ -46,19 +46,6 @@ static GOptionEntry entries[] = {
{ NULL }
};
static void
print_strv (gchar **values)
{
guint i;
for (i = 0; values[i] != NULL; i++) {
g_print (" - %s\n", values[i]);
}
g_print ("\n");
}
int
main (int argc, char **argv)
{
......@@ -89,6 +76,7 @@ main (int argc, char **argv)
return EXIT_FAILURE;
}
g_option_context_free (context);
client = tracker_connect (FALSE);
......@@ -115,16 +103,20 @@ main (int argc, char **argv)
g_print ("%s\n",
_("No services available"));
} else {
g_print ("%s\n\n",
_("Service types available in Tracker:"));
gchar **p;
g_print ("%s:\n",
_("Service types available in Tracker"));
print_strv (array);
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) {
......@@ -140,14 +132,28 @@ main (int argc, char **argv)
g_print ("%s\n",
_("No properties available"));
} else {
g_print ("%s\n\n",
_("Properties available in Tracker:"));
GList *sorted, *l;
gchar **p;
g_print ("%s:\n",
_("Properties available in Tracker"));
for (p = array; *p; p++) {
sorted = g_list_insert_sorted (sorted,
*p,
(GCompareFunc) strcmp);
}
print_strv (array);
for (l = sorted; l; l = g_list_next (l)) {
g_print (" %s\n", (const gchar*) l->data);
}
g_list_free (sorted);
g_strfreev (array);
}
}
tracker_disconnect (client);
return EXIT_SUCCESS;
......
......@@ -307,8 +307,7 @@ main (int argc, char **argv)
if ((files && list) ||
(files && (!add && !remove && !remove_all))) {
g_print ("%s:\n",
_("Tags found"));
g_print ("%s:\n", _("Found"));
for (i = 0, j = 0; files_resolved[i] != NULL; i++) {
gchar **tags;
......@@ -374,12 +373,37 @@ main (int argc, char **argv)
g_print ("%s\n",
_("No tags found"));
} else {
gint length;
length = g_strv_length (results);
g_print (g_dngettext (NULL,
_("Result: %d"),
_("Results: %d"),
length),
length);
g_print ("\n");
for (i = 0; results[i] != NULL; i++) {
g_print (" %s\n", results[i]);
}
}
g_strfreev (results);
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 (results);
}
}
finish:
......
......@@ -216,8 +216,16 @@ main (int argc, char **argv)
g_print ("%s\n",
_("No results found matching your query"));
} else {
g_print ("%s:\n",
_("Results"));
gint length;
length = array->len;
g_print (g_dngettext (NULL,
_("Result: %d"),
_("Results: %d"),
length),
length);
g_print ("\n");
g_ptr_array_foreach (array, (GFunc) get_meta_table_data, NULL);
g_ptr_array_free (array, TRUE);
......
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