summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/aqpkg/ipkg.cpp22
-rw-r--r--noncore/settings/aqpkg/ipkg.h2
2 files changed, 24 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
@@ -41,2 +41,3 @@ Ipkg :: Ipkg()
{
+ proc = 0;
}
@@ -139,2 +140,5 @@ bool Ipkg :: runIpkg( )
+ if ( aborted )
+ return false;
+
if ( option == "install" || option == "reinstall" )
@@ -258,4 +262,13 @@ 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;
+
@@ -319,2 +332,3 @@ void Ipkg::processFinished()
delete proc;
+ proc = 0;
finished = true;
@@ -323,2 +337,10 @@ void Ipkg::processFinished()
+void Ipkg :: abort()
+{
+ if ( proc )
+ {
+ proc->kill();
+ aborted = true;
+ }
+}
diff --git a/noncore/settings/aqpkg/ipkg.h b/noncore/settings/aqpkg/ipkg.h
index 25bae59..f08667b 100644
--- a/noncore/settings/aqpkg/ipkg.h
+++ b/noncore/settings/aqpkg/ipkg.h
@@ -61,2 +61,3 @@ public slots:
void processFinished();
+ void abort();
@@ -65,2 +66,3 @@ private:
bool createLinks;
+ bool aborted;
QString option;