[tracker/tracker-0.12] tracker-control: Don't finalize TrackerMinerManager with --pause-for-process



commit 2e6c76db621e262e5e7bc025c8322a455a4634c4
Author: Martyn Russell <martyn lanedo com>
Date:   Wed Sep 21 14:18:22 2011 +0100

    tracker-control: Don't finalize TrackerMinerManager with --pause-for-process
    
    This command line option was useless, the finalize meant we resumed
    immediately afterwards instead of waiting for the Ctrl+C for the main loop we
    use.
    
    This was noticed by Rainer M. Krug.

 src/tracker-control/tracker-control-miners.c |   25 ++++++++++---------------
 1 files changed, 10 insertions(+), 15 deletions(-)
---
diff --git a/src/tracker-control/tracker-control-miners.c b/src/tracker-control/tracker-control-miners.c
index f010ffd..b683cf2 100644
--- a/src/tracker-control/tracker-control-miners.c
+++ b/src/tracker-control/tracker-control-miners.c
@@ -138,12 +138,20 @@ miner_pause (const gchar *miner,
 	str = g_strdup_printf (_("Cookie is %d"), cookie);
 	g_print ("  %s\n", str);
 	g_free (str);
-	g_object_unref (manager);
 
 	if (for_process) {
+		GMainLoop *main_loop;
+
 		g_print ("%s\n", _("Press Ctrl+C to end pause"));
+
+		main_loop = g_main_loop_new (NULL, FALSE);
+		/* Block until Ctrl+C */
+		g_main_loop_run (main_loop);
+		g_object_unref (main_loop);
 	}
 
+	g_object_unref (manager);
+
 	return EXIT_SUCCESS;
 }
 
@@ -452,20 +460,7 @@ tracker_control_miners_run (void)
 	}
 
 	if (pause_for_process_reason) {
-		gint retval;
-
-		retval = miner_pause (miner_name, pause_for_process_reason, TRUE);
-
-		if (retval == EXIT_SUCCESS) {
-			GMainLoop *main_loop;
-
-			main_loop = g_main_loop_new (NULL, FALSE);
-			/* Block until Ctrl+C */
-			g_main_loop_run (main_loop);
-			g_object_unref (main_loop);
-		}
-
-		return retval;
+		return miner_pause (miner_name, pause_for_process_reason, TRUE);
 	}
 
 	if (resume_cookie != -1) {



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