summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/ipkg.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/aqpkg/ipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/ipkg.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp
index 407abe9..7afe04f 100644
--- a/noncore/settings/aqpkg/ipkg.cpp
+++ b/noncore/settings/aqpkg/ipkg.cpp
@@ -40,4 +40,5 @@ using namespace std;
Ipkg :: Ipkg()
{
+ proc = 0;
}
@@ -138,4 +139,7 @@ bool Ipkg :: runIpkg( )
ret = executeIpkgCommand( commands, option );
+ if ( aborted )
+ return false;
+
if ( option == "install" || option == "reinstall" )
{
@@ -257,6 +261,15 @@ void Ipkg :: removeStatusEntry()
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
@@ -318,8 +331,17 @@ void Ipkg::processFinished()
{
delete proc;
+ proc = 0;
finished = true;
}
+void Ipkg :: abort()
+{
+ if ( proc )
+ {
+ proc->kill();
+ aborted = true;
+ }
+}
/*