From 44698448aa9605819166e9de07dfb7bc76a4241f Mon Sep 17 00:00:00 2001 From: Curtis Gedak Date: Mon, 9 Aug 2010 13:33:28 -0600 Subject: [PATCH] Add new method partition_in_operation_queue_count --- include/Win_GParted.h | 1 + src/Win_GParted.cc | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/Win_GParted.h b/include/Win_GParted.h index 0272f3a1..742cfddf 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 3156882d..06de2c3e 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 )