[gparted] Remove unused index parameter from Add_Operation() (#755214)



commit a1ab21285bb9ebe6080f4e99ac212ff72a829ec2
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Sun Sep 27 09:14:04 2015 +0100

    Remove unused index parameter from Add_Operation() (#755214)
    
    Since this commit earlier in the patchset the second optional parameter
    of method Win_GParted::Add_Operation() is no longer used.  Remove it.
        Replace open coded merge of resize/move into create operation
        (#755214)
    
    Bug 755214 - Refactor operation merging

 include/Win_GParted.h |    2 +-
 src/Win_GParted.cc    |    8 ++------
 2 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/include/Win_GParted.h b/include/Win_GParted.h
index c3118ed..148a2c8 100644
--- a/include/Win_GParted.h
+++ b/include/Win_GParted.h
@@ -66,7 +66,7 @@ private:
        //Fill txtview_device_info_buffer with some information about the selected device
        void Fill_Label_Device_Info( bool clear = false );
 
-       void Add_Operation( Operation * operation, int index = -1 ) ;
+       void Add_Operation( Operation * operation );
        bool merge_two_operations( unsigned int first, unsigned int second );
        void merge_operations( MergeType mergetype );
        void Refresh_Visual();
diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc
index 18d642b..63162b3 100644
--- a/src/Win_GParted.cc
+++ b/src/Win_GParted.cc
@@ -700,7 +700,7 @@ bool Win_GParted::on_delete_event( GdkEventAny *event )
        return ! Quit_Check_Operations();
 }      
 
-void Win_GParted::Add_Operation( Operation * operation, int index )
+void Win_GParted::Add_Operation( Operation * operation )
 {
        if ( operation )
        { 
@@ -719,11 +719,7 @@ void Win_GParted::Add_Operation( Operation * operation, int index )
                   )
                {
                        operation ->create_description() ;
-
-                       if ( index >= 0 && index < static_cast<int>( operations .size() ) )
-                               operations .insert( operations .begin() + index, operation ) ;
-                       else
-                               operations .push_back( operation );
+                       operations.push_back( operation );
                }
                else
                {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]