[gparted] Add new method partition_in_operation_queue_count
- From: Curtis Gedak <gedakc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gparted] Add new method partition_in_operation_queue_count
- Date: Mon, 9 Aug 2010 19:38:20 +0000 (UTC)
commit 44698448aa9605819166e9de07dfb7bc76a4241f
Author: Curtis Gedak <gedakc gmail com>
Date: Mon Aug 9 13:33:28 2010 -0600
Add new method partition_in_operation_queue_count
include/Win_GParted.h | 1 +
src/Win_GParted.cc | 15 ++++++++++++++-
2 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/include/Win_GParted.h b/include/Win_GParted.h
index 0272f3a..742cfdd 100644
--- a/include/Win_GParted.h
+++ b/include/Win_GParted.h
@@ -168,6 +168,7 @@ private:
void activate_undo();
void remove_operation( int index = -1, bool remove_all = false ) ;
+ int partition_in_operation_queue_count( const Partition & partition ) ;
void activate_apply();
//private variables
diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc
index 3156882..06de2c3 100644
--- a/src/Win_GParted.cc
+++ b/src/Win_GParted.cc
@@ -2002,7 +2002,20 @@ void Win_GParted::activate_undo()
if ( ! operations .size() )
close_operationslist() ;
}
-
+
+int Win_GParted::partition_in_operation_queue_count( const Partition & partition )
+{
+ int operation_count = 0 ;
+
+ for ( unsigned int t = 0 ; t < operations .size() ; t++ )
+ {
+ if ( partition .get_path() == operations[ t ] ->partition_original .get_path() )
+ operation_count++ ;
+ }
+
+ return operation_count ;
+}
+
void Win_GParted::remove_operation( int index, bool remove_all )
{
if ( remove_all )
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]