[gparted] Rename signals update and eof



commit 0d52cd19d7ead3aaca39caf79ecaec87866f5224
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Thu May 2 08:35:17 2013 +0100

    Rename signals update and eof
    
    Rename the libsigc++ signals to signal_update and signal_eof to match
    the naming used for signals in GParted.
        fgrep 'sigc::signal' include/*.h
    
    Also explicitly use the emit() method rather than using the object
    operator().  This again is to match the convention in GParted and make
    it more obvious what is happening.
        fgrep '.emit(' include/*.h

 include/PipeCapture.h |    4 ++--
 src/FileSystem.cc     |   16 ++++++++--------
 src/PipeCapture.cc    |    4 ++--
 src/Utils.cc          |    6 ++----
 4 files changed, 14 insertions(+), 16 deletions(-)
---
diff --git a/include/PipeCapture.h b/include/PipeCapture.h
index 2ed2a3e..b6552c9 100644
--- a/include/PipeCapture.h
+++ b/include/PipeCapture.h
@@ -40,8 +40,8 @@ public:
        PipeCapture( int fd, Glib::ustring &buffer );
        void connect_signal();
        ~PipeCapture();
-       sigc::signal<void> eof;
-       sigc::signal<void> update;
+       sigc::signal<void> signal_eof;
+       sigc::signal<void> signal_update;
 };
 
 } // namepace GParted
diff --git a/src/FileSystem.cc b/src/FileSystem.cc
index 2dc0d28..f3064a6 100644
--- a/src/FileSystem.cc
+++ b/src/FileSystem.cc
@@ -111,19 +111,19 @@ int FileSystem::execute_command( const Glib::ustring & command, OperationDetail
        pipecount = 2;
        PipeCapture outputcapture( out, output );
        PipeCapture errorcapture( err, error );
-       outputcapture.eof.connect( sigc::mem_fun( *this, &FileSystem::execute_command_eof ) );
-       errorcapture.eof.connect( sigc::mem_fun( *this, &FileSystem::execute_command_eof ) );
+       outputcapture.signal_eof.connect( sigc::mem_fun( *this, &FileSystem::execute_command_eof ) );
+       errorcapture.signal_eof.connect( sigc::mem_fun( *this, &FileSystem::execute_command_eof ) );
        operationdetail.get_last_child().add_child(
                OperationDetail( output, STATUS_NONE, FONT_ITALIC ) );
        operationdetail.get_last_child().add_child(
                OperationDetail( error, STATUS_NONE, FONT_ITALIC ) );
        std::vector<OperationDetail> &children = operationdetail.get_last_child().get_childs();
-       outputcapture.update.connect( sigc::bind( sigc::ptr_fun( relay_update ),
-                                                 &(children[children.size() - 2]),
-                                                 &output ) );
-       errorcapture.update.connect( sigc::bind( sigc::ptr_fun( relay_update ),
-                                                &(children[children.size() - 1]),
-                                                &error ) );
+       outputcapture.signal_update.connect( sigc::bind( sigc::ptr_fun( relay_update ),
+                                                        &(children[children.size() - 2]),
+                                                        &output ) );
+       errorcapture.signal_update.connect( sigc::bind( sigc::ptr_fun( relay_update ),
+                                                       &(children[children.size() - 1]),
+                                                       &error ) );
        outputcapture.connect_signal();
        errorcapture.connect_signal();
 
diff --git a/src/PipeCapture.cc b/src/PipeCapture.cc
index e4086c3..02dba80 100644
--- a/src/PipeCapture.cc
+++ b/src/PipeCapture.cc
@@ -74,13 +74,13 @@ bool PipeCapture::OnReadable( Glib::IOCondition condition )
                                ++linelength;
                        }
                }
-               update();
+               signal_update.emit();
                return true;
        }
        if (status != Glib::IO_STATUS_EOF)
                std::cerr << "Pipe IOChannel read failed" << std::endl;
        // signal completion
-       eof();
+       signal_eof.emit();
        return false;
 }
 
diff --git a/src/Utils.cc b/src/Utils.cc
index a6c4be7..0968e3d 100644
--- a/src/Utils.cc
+++ b/src/Utils.cc
@@ -497,10 +497,8 @@ int Utils::execute_command( const Glib::ustring & command,
                status.mutex.lock();
        PipeCapture outputcapture( out, output );
        PipeCapture errorcapture( err, error );
-       outputcapture.eof.connect( sigc::mem_fun(
-                status, &CommandStatus::execute_command_eof ));
-       errorcapture.eof.connect( sigc::mem_fun(
-                status, &CommandStatus::execute_command_eof ));
+       outputcapture.signal_eof.connect( sigc::mem_fun( status, &CommandStatus::execute_command_eof ) );
+       errorcapture.signal_eof.connect( sigc::mem_fun( status, &CommandStatus::execute_command_eof ) );
        outputcapture.connect_signal();
        errorcapture.connect_signal();
 


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