[tracker/wip/miner-priority-queues: 8/19] libtracker-miner: remove TRACKER_QUEUE_PRIORITY* in favor of G_PRIORITY*



commit 5d1a728b40699c8fd8fce1cc4427a8c79b288c6a
Author: Carlos Garnacho <carlos lanedo com>
Date:   Mon Jul 4 15:28:16 2011 +0200

    libtracker-miner: remove TRACKER_QUEUE_PRIORITY* in favor of G_PRIORITY*
    
    No need to reinvent the wheel

 src/libtracker-miner/tracker-miner-fs.c       |   38 ++++++++++++------------
 src/libtracker-miner/tracker-priority-queue.h |    5 ---
 2 files changed, 19 insertions(+), 24 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 94dd974..6427b70 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -2962,7 +2962,7 @@ remove_unexisting_file_cb (gpointer key,
 		trace_eq_push_tail ("DELETED", file, "No longer exists");
 		tracker_priority_queue_add (fs->priv->items_deleted,
 		                            g_object_ref (file),
-		                            TRACKER_QUEUE_PRIORITY_LOW);
+		                            G_PRIORITY_LOW);
 
 		item_queue_handlers_set_up (fs);
 	}
@@ -3267,7 +3267,7 @@ should_process_file (TrackerMinerFS *fs,
 			trace_eq_push_tail ("DELETED", file, "No longer to be indexed");
 			tracker_priority_queue_add (fs->priv->items_deleted,
 			                            g_object_ref (file),
-			                            TRACKER_QUEUE_PRIORITY_DEFAULT);
+			                            G_PRIORITY_DEFAULT);
 		}
 		return FALSE;
 	}
@@ -3379,7 +3379,7 @@ check_item_queues (TrackerMinerFS *fs,
 			         "for source file, merging both events together");
 			tracker_priority_queue_add (fs->priv->items_created,
 			                            g_object_ref (other_file),
-			                            TRACKER_QUEUE_PRIORITY_DEFAULT);
+			                            G_PRIORITY_DEFAULT);
 
 			return FALSE;
 		}
@@ -3434,7 +3434,7 @@ monitor_item_created_cb (TrackerMonitor *monitor,
 			trace_eq_push_tail ("CREATED", file, "On monitor event");
 			tracker_priority_queue_add (fs->priv->items_created,
 			                            g_object_ref (file),
-			                            TRACKER_QUEUE_PRIORITY_DEFAULT);
+			                            G_PRIORITY_DEFAULT);
 
 			item_queue_handlers_set_up (fs);
 		}
@@ -3468,7 +3468,7 @@ monitor_item_updated_cb (TrackerMonitor *monitor,
 		trace_eq_push_tail ("UPDATED", file, "On monitor event");
 		tracker_priority_queue_add (fs->priv->items_updated,
 		                            g_object_ref (file),
-		                            TRACKER_QUEUE_PRIORITY_DEFAULT);
+		                            G_PRIORITY_DEFAULT);
 
 		item_queue_handlers_set_up (fs);
 	}
@@ -3507,7 +3507,7 @@ monitor_item_attribute_updated_cb (TrackerMonitor *monitor,
 		trace_eq_push_tail ("UPDATED", file, "On monitor event (attributes)");
 		tracker_priority_queue_add (fs->priv->items_updated,
 		                            g_object_ref (file),
-		                            TRACKER_QUEUE_PRIORITY_DEFAULT);
+		                            G_PRIORITY_DEFAULT);
 
 		item_queue_handlers_set_up (fs);
 	}
@@ -3540,7 +3540,7 @@ monitor_item_deleted_cb (TrackerMonitor *monitor,
 		trace_eq_push_tail ("DELETED", file, "On monitor event");
 		tracker_priority_queue_add (fs->priv->items_deleted,
 		                            g_object_ref (file),
-		                            TRACKER_QUEUE_PRIORITY_DEFAULT);
+		                            G_PRIORITY_DEFAULT);
 
 		item_queue_handlers_set_up (fs);
 	}
@@ -3637,7 +3637,7 @@ monitor_item_moved_cb (TrackerMonitor *monitor,
 					trace_eq_push_tail ("CREATED", other_file, "On move monitor event");
 					tracker_priority_queue_add (fs->priv->items_created,
 					                            g_object_ref (other_file),
-					                            TRACKER_QUEUE_PRIORITY_DEFAULT);
+					                            G_PRIORITY_DEFAULT);
 
 					item_queue_handlers_set_up (fs);
 				} else {
@@ -3657,7 +3657,7 @@ monitor_item_moved_cb (TrackerMonitor *monitor,
 				trace_eq_push_tail ("DELETED", file, "On move monitor event");
 				tracker_priority_queue_add (fs->priv->items_deleted,
 				                            g_object_ref (file),
-				                            TRACKER_QUEUE_PRIORITY_DEFAULT);
+				                            G_PRIORITY_DEFAULT);
 				item_queue_handlers_set_up (fs);
 			}
 		} else {
@@ -3673,7 +3673,7 @@ monitor_item_moved_cb (TrackerMonitor *monitor,
 				trace_eq_push_tail_2 ("MOVED", file, other_file, "On monitor event");
 				tracker_priority_queue_add (fs->priv->items_moved,
 				                            item_moved_data_new (other_file, file),
-				                            TRACKER_QUEUE_PRIORITY_DEFAULT);
+				                            G_PRIORITY_DEFAULT);
 				item_queue_handlers_set_up (fs);
 			}
 		}
@@ -3723,7 +3723,7 @@ crawler_check_directory_cb (TrackerCrawler *crawler,
 			trace_eq_push_tail ("DELETED", file, "while crawling directory");
 			tracker_priority_queue_add (fs->priv->items_deleted,
 			                            g_object_ref (file),
-			                            TRACKER_QUEUE_PRIORITY_DEFAULT);
+			                            G_PRIORITY_DEFAULT);
 		}
 	} else {
 		gboolean should_change_index;
@@ -3806,7 +3806,7 @@ crawler_check_directory_contents_cb (TrackerCrawler *crawler,
 			trace_eq_push_tail ("CREATED", parent, "while crawling directory, parent");
 			tracker_priority_queue_add (fs->priv->items_created,
 			                            g_object_ref (parent),
-			                            TRACKER_QUEUE_PRIORITY_DEFAULT);
+			                            G_PRIORITY_DEFAULT);
 			item_queue_handlers_set_up (fs);
 
 			/* As we already added here, specify that it shouldn't be added
@@ -3935,7 +3935,7 @@ crawler_directory_crawled_cb (TrackerCrawler *crawler,
 	dir_data = crawled_directory_data_new (tree);
 	tracker_priority_queue_add (fs->priv->crawled_directories,
 	                            dir_data,
-	                            TRACKER_QUEUE_PRIORITY_DEFAULT);
+	                            G_PRIORITY_DEFAULT);
 
 	/* Update stats */
 	fs->priv->directories_found += directories_found;
@@ -4188,7 +4188,7 @@ tracker_miner_fs_directory_add_internal (TrackerMinerFS *fs,
 	                                 data) == NULL) {
 		tracker_priority_queue_add (fs->priv->directories,
 		                            directory_data_ref (data),
-		                            TRACKER_QUEUE_PRIORITY_DEFAULT);
+		                            G_PRIORITY_DEFAULT);
 
 		crawl_directories_start (fs);
 	}
@@ -4234,7 +4234,7 @@ tracker_miner_fs_directory_add (TrackerMinerFS *fs,
 	                                 dir_data) == NULL) {
 		tracker_priority_queue_add (fs->priv->directories,
 		                            directory_data_ref (dir_data),
-		                            TRACKER_QUEUE_PRIORITY_DEFAULT);
+		                            G_PRIORITY_DEFAULT);
 
 		crawl_directories_start (fs);
 	}
@@ -4386,7 +4386,7 @@ tracker_miner_fs_directory_remove_full (TrackerMinerFS *fs,
 		trace_eq_push_tail ("DELETED", file, "on remove full");
 		tracker_priority_queue_add (fs->priv->items_deleted,
 		                            g_object_ref (file),
-		                            TRACKER_QUEUE_PRIORITY_DEFAULT);
+		                            G_PRIORITY_DEFAULT);
 		item_queue_handlers_set_up (fs);
 
 		return TRUE;
@@ -4431,7 +4431,7 @@ check_file_parents (TrackerMinerFS *fs,
 		trace_eq_push_tail ("UPDATED", p->data, "checking file parents");
 		tracker_priority_queue_add (fs->priv->items_updated,
 		                            p->data,
-		                            TRACKER_QUEUE_PRIORITY_DEFAULT);
+		                            G_PRIORITY_DEFAULT);
 	}
 
 	g_list_free (parents);
@@ -4480,7 +4480,7 @@ tracker_miner_fs_check_file (TrackerMinerFS *fs,
 		trace_eq_push_tail ("UPDATED", file, "Requested by application");
 		tracker_priority_queue_add (fs->priv->items_updated,
 		                            g_object_ref (file),
-		                            TRACKER_QUEUE_PRIORITY_DEFAULT);
+		                            G_PRIORITY_DEFAULT);
 
 		item_queue_handlers_set_up (fs);
 	}
@@ -4808,7 +4808,7 @@ tracker_miner_fs_force_recheck (TrackerMinerFS *fs)
 	while (directories) {
 		tracker_priority_queue_add (fs->priv->directories,
 		                            directory_data_ref (directories->data),
-		                            TRACKER_QUEUE_PRIORITY_LOW);
+		                            G_PRIORITY_LOW);
 		directories = directories->next;
 	}
 
diff --git a/src/libtracker-miner/tracker-priority-queue.h b/src/libtracker-miner/tracker-priority-queue.h
index da42c62..7426e10 100644
--- a/src/libtracker-miner/tracker-priority-queue.h
+++ b/src/libtracker-miner/tracker-priority-queue.h
@@ -24,11 +24,6 @@
 
 G_BEGIN_DECLS
 
-/* Some defines for priorities */
-#define TRACKER_QUEUE_PRIORITY_HIGH    -100
-#define TRACKER_QUEUE_PRIORITY_DEFAULT 0
-#define TRACKER_QUEUE_PRIORITY_LOW     100
-
 typedef struct _TrackerPriorityQueue TrackerPriorityQueue;
 
 TrackerPriorityQueue *tracker_priority_queue_new   (void);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]