summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg
Unidiff
Diffstat (limited to 'noncore/unsupported/oipkg') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/main.cpp2
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp74
-rw-r--r--noncore/unsupported/oipkg/pmipkg.h6
3 files changed, 7 insertions, 75 deletions
diff --git a/noncore/unsupported/oipkg/main.cpp b/noncore/unsupported/oipkg/main.cpp
index c579df8..f989f30 100644
--- a/noncore/unsupported/oipkg/main.cpp
+++ b/noncore/unsupported/oipkg/main.cpp
@@ -5,3 +5,3 @@
5#include <qstring.h> 5#include <qstring.h>
6//#include <qmessagebox.h> 6#include <unistd.h>
7int debugLevel; 7int debugLevel;
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 @@
14 14
15#include <opie/oprocess.h> 15//#include <opie/oprocess.h>
16#include <qpe/resource.h> 16#include <qpe/resource.h>
@@ -38,3 +38,2 @@
38 38
39//#define OPROCESS
40 39
@@ -45,11 +44,6 @@ PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlag
45 runwindow = new RunWindow( p, name, true, f ); 44 runwindow = new RunWindow( p, name, true, f );
46#ifdef OPROCESS
47 ipkgProcess = new OProcess();
48 connect ( ipkgProcess, SIGNAL(receivedStdout(OProcess*,char*,int)),
49 this, SLOT(getIpkgOutput(OProcess*,char*,int)));
50 45
51 connect ( ipkgProcess, SIGNAL(receivedStderr(OProcess*,char*,int)), 46 Config cfg( "oipkg", Config::User );
52 this, SLOT(getIpkgOutput(OProcess*,char*,int))); 47 cfg.setGroup( "ipkg" );
53 installDialog = 0; 48 ipkg_cmd = cfg.readEntry( "cmd", "ipkg" );
54#endif
55} 49}
@@ -58,5 +52,2 @@ PmIpkg::~PmIpkg()
58{ 52{
59#ifdef OPROCESS
60 delete ipkgProcess;
61#endif
62} 53}
@@ -67,9 +58,3 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
67 QDir::setCurrent("/tmp"); 58 QDir::setCurrent("/tmp");
68 QString cmd = "/usr/bin/ipkg "; 59 QString cmd = ipkg_cmd;
69#ifdef OPROCESS
70 ipkgProcess->kill();
71 ipkgProcess->clearArguments();
72 *ipkgProcess << "/usr/bin/ipkg ";
73 cmd = "";
74#endif
75 pvDebug( 3,"PmIpkg::runIpkg got dest="+dest); 60 pvDebug( 3,"PmIpkg::runIpkg got dest="+dest);
@@ -100,39 +85,2 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
100 pvDebug(2,"running:"+cmd); 85 pvDebug(2,"running:"+cmd);
101#ifdef OPROCESS
102 *ipkgProcess << args;
103 out( "running:\n" + cmd);
104 *ipkgProcess << cmd;
105
106//debug
107 delete ipkgProcess;
108 ipkgProcess = new OProcess();
109 ipkgProcess->clearArguments();
110 *ipkgProcess << "/bin/ls ";
111//debug
112 QValueList<QCString> a = ipkgProcess->args();
113 QValueList<QCString>::Iterator it;
114 for( it = a.begin(); it != a.end(); ++it )
115 {
116 out( *it );
117 cmd += *it;
118 }
119
120 pvDebug(2,"running:"+cmd);
121 qApp->processEvents();
122// sleep(1);
123 ret = ipkgProcess->start(OProcess::NotifyOnExit,OProcess::AllOutput);
124 if ( !ret ) {
125 pvDebug(2,"Could not execute '" + cmd);
126 out("\nError while executing "+ cmd+"\n\n");
127 out("\nError while executing\n\n");
128 // return false;
129 }
130
131 while ( ipkgProcess->isRunning() )
132 {
133 out(".");
134 pvDebug(7,"wait for oprocess to terminate");
135 qApp->processEvents();
136 };
137#else
138 qApp->processEvents(); 86 qApp->processEvents();
@@ -162,4 +110,2 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
162 pclose(fp); 110 pclose(fp);
163#endif
164 //out( "Finished!");
165 pvDebug(2,QString(ret?"success\n":"failure\n")); 111 pvDebug(2,QString(ret?"success\n":"failure\n"));
@@ -495,11 +441 @@ void PmIpkg::clearLists()
495
496void PmIpkg::getIpkgOutput(OProcess *proc, char *buffer, int buflen)
497{
498 QString lineStr, lineStrOld;
499 lineStr = buffer;
500 lineStr=lineStr.left(buflen);
501 //Configuring opie-oipkg...Done
502 if (lineStr!=lineStrOld)
503 out(lineStr);
504 lineStrOld = lineStr;
505}
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h
index c84acfa..2f4d6ae 100644
--- a/noncore/unsupported/oipkg/pmipkg.h
+++ b/noncore/unsupported/oipkg/pmipkg.h
@@ -12,4 +12,2 @@
12 12
13
14#include <opie/oprocess.h>
15#include <qobject.h> 13#include <qobject.h>
@@ -51,7 +49,5 @@ public slots:
51 49
52//private slots:
53 void getIpkgOutput(OProcess *proc, char *buffer, int buflen);
54 50
55private: 51private:
56 OProcess *ipkgProcess; 52 QString ipkg_cmd;
57 PackageManagerSettings* settings; 53 PackageManagerSettings* settings;