mirror of
https://gitlab.gnome.org/GNOME/gparted
synced 2024-08-27 11:40:03 +00:00
![Mike Fleetwood](/assets/img/avatar_default.png)
The copy, resize/move and new dialog classes (Dialog_Partition_Copy, Dialog_Partition_Resize_Move and Dialog_Partition_New respectively) had to be used like this: construct dialog object passing some parameters call Set_Data() to pass more parameters run() dialog call Get_New_Partition() There is nothing in the classes which forces Set_Data() to be called, but it must be called for the dialogs to work and prevent GParted from crashing. Make these class APIs safer by making it impossible to program incorrectly in this regard. Move all the additional parameters from each Set_Data() method to each constructor. The constructors just call the now private set_data() methods.
40 lines
1.4 KiB
C++
40 lines
1.4 KiB
C++
/* Copyright (C) 2004 Bart
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef GPARTED_DIALOG_PARTITION_RESIZE_MOVE_H
|
|
#define GPARTED_DIALOG_PARTITION_RESIZE_MOVE_H
|
|
|
|
#include "../include/Dialog_Base_Partition.h"
|
|
|
|
namespace GParted
|
|
{
|
|
|
|
class Dialog_Partition_Resize_Move : public Dialog_Base_Partition
|
|
{
|
|
public:
|
|
Dialog_Partition_Resize_Move( const FS & fs, const Partition & selected_partition,
|
|
const std::vector <Partition> & partitions );
|
|
|
|
private:
|
|
void set_data( const Partition & selected_partition, const std::vector <Partition> & partitions );
|
|
void Resize_Move_Normal( const std::vector <Partition> & partitions ) ;
|
|
void Resize_Move_Extended( const std::vector <Partition> & partitions ) ;
|
|
};
|
|
|
|
} //GParted
|
|
|
|
#endif /* GPARTED_DIALOG_PARTITION_RESIZE_MOVE_H */
|