summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/ipkg.cpp
authoralwin <alwin>2004-03-02 12:21:11 (UTC)
committer alwin <alwin>2004-03-02 12:21:11 (UTC)
commitb6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (side-by-side diff)
treed3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /noncore/settings/aqpkg/ipkg.cpp
parent0d59c780513da78033f4d9040475dee9db0256d4 (diff)
downloadopie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip
opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz
opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2
applied the patch generated by the optimize_connect script from
TT.
Diffstat (limited to 'noncore/settings/aqpkg/ipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/ipkg.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp
index 3761b67..866afed 100644
--- a/noncore/settings/aqpkg/ipkg.cpp
+++ b/noncore/settings/aqpkg/ipkg.cpp
@@ -243,104 +243,104 @@ void Ipkg :: removeStatusEntry()
value = value.stripWhiteSpace();
} else {
key = "";
value = "";
}
if ( key == "Package" && value == package )
{
//skip lines from the deleted package
while ( ( !readStream.atEnd() ) && ( line.stripWhiteSpace() != "" ) )
{
line = readStream.readLine();
}
} else {
//write other lines into the tempfile
writeStream << line << "\n";
// Improve UI responsiveness
i++;
if ( ( i % 50 ) == 0 )
qApp->processEvents();
}
}
readFile.close();
writeFile.close();
// Remove old status file and put tmp stats file in its place
remove( statusFile );
rename( outStatusFile, statusFile );
}
int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ )
{
// If one is already running - should never be but just to be safe
if ( proc )
{
delete proc;
proc = 0;
}
// OK we're gonna use OProcess to run this thing
proc = new OProcess();
aborted = false;
// Connect up our slots
- connect(proc, SIGNAL(processExited(OProcess *)),
+ connect(proc, SIGNAL(processExited(OProcess*)),
this, SLOT( processFinished()));
- connect(proc, SIGNAL(receivedStdout(OProcess *, char *, int)),
- this, SLOT(commandStdout(OProcess *, char *, int)));
+ connect(proc, SIGNAL(receivedStdout(OProcess*,char*,int)),
+ this, SLOT(commandStdout(OProcess*,char*,int)));
- connect(proc, SIGNAL(receivedStderr(OProcess *, char *, int)),
- this, SLOT(commandStderr(OProcess *, char *, int)));
+ connect(proc, SIGNAL(receivedStderr(OProcess*,char*,int)),
+ this, SLOT(commandStderr(OProcess*,char*,int)));
for ( QStringList::Iterator it = cmd.begin(); it != cmd.end(); ++it )
{
*proc << (*it).latin1();
}
// Start the process going
finished = false;
if(!proc->start(OProcess::NotifyOnExit, OProcess::All))
{
emit outputText( tr("Couldn't start ipkg process" ) );
}
}
void Ipkg::commandStdout(OProcess*, char *buffer, int buflen)
{
QString lineStr = buffer;
if ( lineStr[buflen-1] == '\n' )
buflen --;
lineStr = lineStr.left( buflen );
emit outputText( lineStr );
// check if we are installing dependant packages
if ( option == "install" || option == "reinstall" )
{
// Need to keep track of any dependant packages that get installed
// so that we can create links to them as necessary
if ( lineStr.startsWith( "Installing " ) )
{
int start = lineStr.find( " " ) + 1;
int end = lineStr.find( " ", start );
QString *package = new QString( lineStr.mid( start, end-start ) );
dependantPackages->append( package );
}
}
else if ( option == "remove" && !( flags & FORCE_DEPENDS ) &&
lineStr.find( "is depended upon by packages:" ) != -1 )
{
// Ipkg should send this to STDERR, but doesn't - so trap here
error = true;
}
buffer[0] = '\0';
}
void Ipkg::commandStderr(OProcess*, char *buffer, int buflen)
{
QString lineStr = buffer;