[gparted] Rename function relay_update



commit d6260e17b377a0146fc690f7689c48f80dc8b9aa
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Thu May 2 21:05:14 2013 +0100

    Rename function relay_update
    
    Rename function to update_command_output() to better reflect that this
    callback updates the UI with the latest output read from the command
    being executed.
    
    This makes more sense knowing a future change will add a separate
    callback which parses the output read from the command and updates the
    progress bar.  This function should be named update_command_progress().

 src/FileSystem.cc |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/FileSystem.cc b/src/FileSystem.cc
index f3064a6..54a3fc3 100644
--- a/src/FileSystem.cc
+++ b/src/FileSystem.cc
@@ -62,7 +62,9 @@ void FileSystem::store_exit_status( GPid pid, int status )
        Glib::spawn_close_pid( pid );
 }
 
-static void relay_update( OperationDetail *operationdetail, Glib::ustring *str )
+//Callback passing the latest partial output from the external command
+//  to operation detail for updating in the UI
+static void update_command_output( OperationDetail *operationdetail, Glib::ustring *str )
 {
        operationdetail->set_description( *str, FONT_ITALIC );
 }
@@ -118,10 +120,10 @@ int FileSystem::execute_command( const Glib::ustring & command, OperationDetail
        operationdetail.get_last_child().add_child(
                OperationDetail( error, STATUS_NONE, FONT_ITALIC ) );
        std::vector<OperationDetail> &children = operationdetail.get_last_child().get_childs();
-       outputcapture.signal_update.connect( sigc::bind( sigc::ptr_fun( relay_update ),
+       outputcapture.signal_update.connect( sigc::bind( sigc::ptr_fun( update_command_output ),
                                                         &(children[children.size() - 2]),
                                                         &output ) );
-       errorcapture.signal_update.connect( sigc::bind( sigc::ptr_fun( relay_update ),
+       errorcapture.signal_update.connect( sigc::bind( sigc::ptr_fun( update_command_output ),
                                                        &(children[children.size() - 1]),
                                                        &error ) );
        outputcapture.connect_signal();


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