[tracker/journal-rotating] Some fixes to squash



commit cb59f7c9504376c42928113a489d4ddfe3171b5a
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed May 12 13:48:45 2010 +0200

    Some fixes to squash

 src/libtracker-db/tracker-db-journal.c |   22 +++++-----------------
 1 files changed, 5 insertions(+), 17 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-journal.c b/src/libtracker-db/tracker-db-journal.c
index 7fc05a6..e84e7e2 100644
--- a/src/libtracker-db/tracker-db-journal.c
+++ b/src/libtracker-db/tracker-db-journal.c
@@ -138,17 +138,9 @@ tracker_db_journal_set_rotating (gboolean     do_rotating,
                                  gsize        chunk_size,
                                  const gchar *rotate_to)
 {
-	static gboolean once_set = FALSE;
-
 	rotating_settings.do_rotating = do_rotating;
 	rotating_settings.chunk_size = chunk_size;
-
-	if (once_set) {
-		g_free (rotating_settings.rotate_to);
-	}
-
-	once_set = TRUE;
-
+	g_free (rotating_settings.rotate_to);
 	if (rotate_to) {
 		rotating_settings.rotate_to = g_strdup (rotate_to);
 	} else {
@@ -1446,20 +1438,16 @@ static gboolean
 tracker_db_journal_rotate (void)
 {
 	gchar *fullpath;
-	static guint max = 0;
-	static gboolean needs_move = FALSE;
+	static gint max = -1;
+	static gboolean needs_move;
 
-	if (max == 0) {
+	if (max == -1) {
 		gchar *directory;
 		GDir *journal_dir;
 		const gchar *f_name;
 
 		directory = g_path_get_dirname (writer.journal_filename);
-
-		if (!needs_move) {
-			needs_move = (g_strcmp0 (rotating_settings.rotate_to, directory) != 0);
-		}
-
+		needs_move = (g_strcmp0 (rotating_settings.rotate_to, directory) != 0);
 		journal_dir = g_dir_open (directory, 0, NULL);
 
 		f_name = g_dir_read_name (journal_dir);



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