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 )