[tracker] tracker-needle: Remove unused code
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] tracker-needle: Remove unused code
- Date: Thu, 24 Mar 2011 23:19:07 +0000 (UTC)
commit 7003478c26eb44157a2d6ede94fb24c6e9a33469
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Mar 22 18:53:49 2011 +0100
tracker-needle: Remove unused code
src/tracker-needle/tracker-needle.vala | 246 --------------------------
src/tracker-needle/tracker-result-store.vala | 5 +-
2 files changed, 1 insertions(+), 250 deletions(-)
---
diff --git a/src/tracker-needle/tracker-needle.vala b/src/tracker-needle/tracker-needle.vala
index 9b479be..340aea0 100644
--- a/src/tracker-needle/tracker-needle.vala
+++ b/src/tracker-needle/tracker-needle.vala
@@ -51,7 +51,6 @@ public class Tracker.Needle {
private int size_small = 0;
private int size_medium = 0;
private int size_big = 0;
- static bool current_view = true;
static bool current_find_in = true;
private ResultStore categories_model;
@@ -293,19 +292,6 @@ public class Tracker.Needle {
return false;
}
- private ListStore? get_store_for_active_view () {
- // if (view_icons.active) {
- // return sw_icons.store;
- // } else if (view_filelist.active) {
- // return sw_filelist.store;
- // } else if (view_categories.active) {
- // return sw_categories.store;
- // }
-
- debug ("No views active to get store?!?!");
- return null;
- }
-
private void search_changed (Editable editable) {
if (last_search_id != 0) {
Source.remove (last_search_id);
@@ -323,238 +309,6 @@ public class Tracker.Needle {
search_run ();
}
- private async void search_simple (ListStore store) requires (store != null) {
- /*
- Tracker.Query query = new Tracker.Query ();
- Tracker.Sparql.Cursor cursor = null;
-
- query.limit = 1000;
- query.criteria = search.get_text ();
-
- debug ("Doing simple search using store:%p", store);
-
- try {
- if (find_in_contents.active) {
- cursor = yield query.perform_async (query.Type.ALL, null);
- } else {
- cursor = yield query.perform_async (query.Type.ALL_ONLY_IN_TITLES, null);
- }
-
- if (cursor == null) {
- search_finished (store);
- return;
- }
-
- store.clear ();
-
- var screen = window.get_screen ();
- var theme = IconTheme.get_for_screen (screen);
-
- while (true) {
- bool b = yield cursor.next_async ();
- if (!b) {
- break;
- }
-
- for (int i = 0; i < cursor.n_columns; i++) {
- if (i == 0) {
- debug ("--> %s", cursor.get_string (i));
- } else {
- debug (" --> %s", cursor.get_string (i));
- }
- }
-
- // Get icon
- string urn = cursor.get_string (0);
- string _file = cursor.get_string (1);
- string title = cursor.get_string (2);
- string _file_time = cursor.get_string (3);
- string _file_size = cursor.get_string (4);
- string tooltip = cursor.get_string (7);
- Gdk.Pixbuf pixbuf_small = tracker_pixbuf_new_from_file (theme, _file, size_small, false);
- Gdk.Pixbuf pixbuf_big = tracker_pixbuf_new_from_file (theme, _file, size_big, false);
- string file_size = GLib.format_size_for_display (_file_size.to_int());
- string file_time = tracker_time_format_from_iso8601 (_file_time);
-
- // Insert into model
- TreeIter iter;
-
- // FIXME: should optimise this a bit more, inserting 2 images into a list eek
- store.append (out iter);
- store.set (iter,
- 0, pixbuf_small, // Small Image
- 1, pixbuf_big, // Large Image
- 2, urn, // URN
- 3, _file, // URL
- 4, title, // Title
- 5, null, // Subtitle
- 6, file_time, // Column2: Time
- 7, file_size, // Column3: Size
- 8, tooltip, // Tooltip
- -1);
- }
- } catch (GLib.Error e) {
- warning ("Could not iterate query results: %s", e.message);
- search_finished (store);
- return;
- }
-
- search_finished (store);
- */
- }
-
- private async void search_detailed (ResultStore store) requires (store != null) {
- /*
- Tracker.Query.Type[] categories = {
- Tracker.Query.Type.APPLICATIONS,
- Tracker.Query.Type.MUSIC,
- Tracker.Query.Type.VIDEOS,
- Tracker.Query.Type.DOCUMENTS,
- Tracker.Query.Type.MAIL,
- Tracker.Query.Type.IMAGES,
- Tracker.Query.Type.FOLDERS
- };
-
- Tracker.Query query = new Tracker.Query ();
-
-
- store.clear ();
-
- debug ("Doing detailed search using store:%p", store);
-
- var screen = window.get_screen ();
- var theme = IconTheme.get_for_screen (screen);
- bool odd = false;
-
- foreach (Tracker.Query.Type type in categories) {
- int count = 0;
-
- Tracker.Sparql.Cursor cursor;
-
- query.limit = 1000;
- query.criteria = search.get_text ();
-
- try {
- cursor = yield query.perform_async (type, null);
-
- if (cursor == null) {
- search_finished (store);
- return;
- }
-
- while (true) {
- bool b = yield cursor.next_async ();
- if (!b) {
- break;
- }
-
- for (int i = 0; i < cursor.n_columns; i++) {
- if (i == 0) {
- debug ("--> %s", cursor.get_string (i));
- } else {
- debug (" --> %s", cursor.get_string (i));
- }
- }
-
- string urn = cursor.get_string (0);
- string _file = cursor.get_string (1);
- string title = cursor.get_string (2);
- string subtitle = null;
- string column2 = null;
- string column3 = null;
- string tooltip = cursor.get_string (5);
- Gdk.Pixbuf pixbuf_small = null;
-
- // Special cases
- switch (type) {
- case Tracker.Query.Type.APPLICATIONS:
- if (count == 0) {
- pixbuf_small = tracker_pixbuf_new_from_name (theme, "package-x-generic", size_medium);
- }
- break;
- case Tracker.Query.Type.MUSIC:
- if (count == 0) {
- pixbuf_small = tracker_pixbuf_new_from_name (theme, "audio-x-generic", size_medium);
- }
- column2 = tracker_time_format_from_seconds (cursor.get_string (4));
- break;
- case Tracker.Query.Type.IMAGES:
- if (count == 0) {
- pixbuf_small = tracker_pixbuf_new_from_name (theme, "image-x-generic", size_medium);
- }
- column2 = GLib.format_size_for_display (cursor.get_string (4).to_int ());
- break;
- case Tracker.Query.Type.VIDEOS:
- if (count == 0) {
- pixbuf_small = tracker_pixbuf_new_from_name (theme, "video-x-generic", size_medium);
- }
- column2 = tracker_time_format_from_seconds (cursor.get_string (4));
- break;
- case Tracker.Query.Type.DOCUMENTS:
- if (count == 0) {
- pixbuf_small = tracker_pixbuf_new_from_name (theme, "x-office-presentation", size_medium);
- }
- break;
- case Tracker.Query.Type.MAIL:
- if (count == 0) {
- pixbuf_small = tracker_pixbuf_new_from_name (theme, "emblem-mail", size_medium);
- }
- column2 = tracker_time_format_from_iso8601 (cursor.get_string (4));
- break;
- case Tracker.Query.Type.FOLDERS:
- if (count == 0) {
- pixbuf_small = tracker_pixbuf_new_from_name (theme, "folder", size_medium);
- }
- column2 = tracker_time_format_from_iso8601 (cursor.get_string (4));
- break;
-
- default:
- break;
- }
-
- if (subtitle == null) {
- subtitle = cursor.get_string (3);
- }
-
- if (column2 == null) {
- column2 = cursor.get_string (4);
- }
-
- // Insert into model
- TreeIter iter;
-
- // FIXME: should optimise this a bit more, inserting 2 images into a list eek
- store.append (out iter);
- store.set (iter,
- 0, pixbuf_small, // Small Image
- 1, null, // Large Image
- 2, urn, // URN
- 3, _file, // URL
- 4, title, // Title
- 5, subtitle, // Subtitle
- 6, column2, // Column2
- 7, column3, // Column3
- 8, tooltip, // Tooltip
- 9, odd, // Category hint
- -1);
-
- count++;
- }
- } catch (GLib.Error e) {
- warning ("Could not iterate query results: %s", e.message);
- search_finished (store);
- return;
- }
-
- if (count > 0) {
- odd = !odd;
- }
- }
-
- search_finished (store);
- */
- }
-
private void search_finished (ResultStore? store) {
// Check if we have any results, if we don't change the view
if (store == null || !store.has_results ()) {
diff --git a/src/tracker-needle/tracker-result-store.vala b/src/tracker-needle/tracker-result-store.vala
index d13ab78..a454cff 100644
--- a/src/tracker-needle/tracker-result-store.vala
+++ b/src/tracker-needle/tracker-result-store.vala
@@ -252,7 +252,7 @@ public class Tracker.ResultStore : Gtk.TreeModel, GLib.Object {
}
private void clear_results () {
- int i, j;
+ int j;
while (categories.length > 0) {
CategoryNode cat = categories[0];
@@ -801,9 +801,6 @@ public class Tracker.ResultStore : Gtk.TreeModel, GLib.Object {
var l = va_list ();
string str = null;
string [] args = null;
- CategoryNode cat;
- TreeIter iter;
- TreePath path;
QueryData query_data;
do {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]