[baobab] Do not clear the model when cancelling a completed scan
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab] Do not clear the model when cancelling a completed scan
- Date: Sat, 4 Aug 2012 10:00:57 +0000 (UTC)
commit 28d674b6b3a4444d6708bbdd036966f06372048d
Author: Paolo Borelli <pborelli gnome org>
Date: Sat Aug 4 11:50:54 2012 +0200
Do not clear the model when cancelling a completed scan
src/baobab-scanner.vala | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/src/baobab-scanner.vala b/src/baobab-scanner.vala
index 8f05ab6..6025c03 100644
--- a/src/baobab-scanner.vala
+++ b/src/baobab-scanner.vala
@@ -325,10 +325,7 @@ namespace Baobab {
}
if (!successful) {
- cancel ();
-
- cancellable.reset ();
- scan_error = null;
+ cancel_and_reset ();
// the thread owns a reference on the Scanner object
this.self = this;
@@ -341,7 +338,7 @@ namespace Baobab {
}
}
- public virtual void cancel () {
+ void cancel_and_reset () {
cancellable.cancel ();
if (thread != null) {
@@ -361,9 +358,18 @@ namespace Baobab {
}
base.clear ();
+
+ cancellable.reset ();
+ scan_error = null;
+ }
+
+ public void cancel () {
+ if (!successful) {
+ cancel_and_reset ();
+ }
}
- public virtual void finish () throws Error {
+ public void finish () throws Error {
if (scan_error != null) {
throw scan_error;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]