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
This commit is contained in:
Mike Fleetwood 2013-05-02 08:35:17 +01:00 committed by Curtis Gedak
parent 30946cb812
commit 0d52cd19d7
4 changed files with 14 additions and 16 deletions

View File

@ -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

View File

@ -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();

View File

@ -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;
}

View File

@ -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();