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



commit cb2cd1fb8c01e072797a84581afb4ad2e77321b4
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 7deab83..092816b 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -2995,7 +2995,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);
 	}
@@ -3300,7 +3300,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;
 	}
@@ -3412,7 +3412,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;
 		}
@@ -3467,7 +3467,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);
 		}
@@ -3501,7 +3501,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);
 	}
@@ -3540,7 +3540,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);
 	}
@@ -3573,7 +3573,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);
 	}
@@ -3670,7 +3670,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 {
@@ -3690,7 +3690,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 {
@@ -3706,7 +3706,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);
 			}
 		}
@@ -3756,7 +3756,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;
@@ -3839,7 +3839,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
@@ -3968,7 +3968,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;
@@ -4221,7 +4221,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);
 	}
@@ -4267,7 +4267,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);
 	}
@@ -4419,7 +4419,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;
@@ -4464,7 +4464,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);
@@ -4513,7 +4513,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);
 	}
@@ -4841,7 +4841,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]