summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/pmipkg.cpp
Side-by-side diff
Diffstat (limited to 'noncore/unsupported/oipkg/pmipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp74
1 files changed, 5 insertions, 69 deletions
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index bffad15..a7deb8f 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -14,3 +14,3 @@
-#include <opie/oprocess.h>
+//#include <opie/oprocess.h>
#include <qpe/resource.h>
@@ -38,3 +38,2 @@
-//#define OPROCESS
@@ -45,11 +44,6 @@ PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlag
runwindow = new RunWindow( p, name, true, f );
-#ifdef OPROCESS
- ipkgProcess = new OProcess();
- connect ( ipkgProcess, SIGNAL(receivedStdout(OProcess*,char*,int)),
- this, SLOT(getIpkgOutput(OProcess*,char*,int)));
- connect ( ipkgProcess, SIGNAL(receivedStderr(OProcess*,char*,int)),
- this, SLOT(getIpkgOutput(OProcess*,char*,int)));
- installDialog = 0;
-#endif
+ Config cfg( "oipkg", Config::User );
+ cfg.setGroup( "ipkg" );
+ ipkg_cmd = cfg.readEntry( "cmd", "ipkg" );
}
@@ -58,5 +52,2 @@ PmIpkg::~PmIpkg()
{
-#ifdef OPROCESS
- delete ipkgProcess;
-#endif
}
@@ -67,9 +58,3 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
QDir::setCurrent("/tmp");
- QString cmd = "/usr/bin/ipkg ";
-#ifdef OPROCESS
- ipkgProcess->kill();
- ipkgProcess->clearArguments();
- *ipkgProcess << "/usr/bin/ipkg ";
- cmd = "";
-#endif
+ QString cmd = ipkg_cmd;
pvDebug( 3,"PmIpkg::runIpkg got dest="+dest);
@@ -100,39 +85,2 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
pvDebug(2,"running:"+cmd);
-#ifdef OPROCESS
- *ipkgProcess << args;
- out( "running:\n" + cmd);
- *ipkgProcess << cmd;
-
-//debug
- delete ipkgProcess;
- ipkgProcess = new OProcess();
- ipkgProcess->clearArguments();
- *ipkgProcess << "/bin/ls ";
-//debug
- QValueList<QCString> a = ipkgProcess->args();
- QValueList<QCString>::Iterator it;
- for( it = a.begin(); it != a.end(); ++it )
- {
- out( *it );
- cmd += *it;
- }
-
- pvDebug(2,"running:"+cmd);
- qApp->processEvents();
-// sleep(1);
- ret = ipkgProcess->start(OProcess::NotifyOnExit,OProcess::AllOutput);
- if ( !ret ) {
- pvDebug(2,"Could not execute '" + cmd);
- out("\nError while executing "+ cmd+"\n\n");
- out("\nError while executing\n\n");
- // return false;
- }
-
- while ( ipkgProcess->isRunning() )
- {
- out(".");
- pvDebug(7,"wait for oprocess to terminate");
- qApp->processEvents();
- };
-#else
qApp->processEvents();
@@ -162,4 +110,2 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
pclose(fp);
-#endif
- //out( "Finished!");
pvDebug(2,QString(ret?"success\n":"failure\n"));
@@ -495,11 +441 @@ void PmIpkg::clearLists()
-void PmIpkg::getIpkgOutput(OProcess *proc, char *buffer, int buflen)
-{
- QString lineStr, lineStrOld;
- lineStr = buffer;
- lineStr=lineStr.left(buflen);
- //Configuring opie-oipkg...Done
- if (lineStr!=lineStrOld)
- out(lineStr);
- lineStrOld = lineStr;
-}