mirror of
https://github.com/parchlinux/calamares.git
synced 2025-07-03 04:15:37 -04:00
[fsresizer] Refactor finding device
- Find device in separate function - If device isn't found, bail out
This commit is contained in:
parent
1c2714d832
commit
9e1c95ad05
2 changed files with 41 additions and 24 deletions
|
@ -28,6 +28,10 @@
|
|||
|
||||
#include <PluginDllMacro.h>
|
||||
|
||||
class CoreBackend; // From KPMCore
|
||||
class Device; // From KPMCore
|
||||
class Partition;
|
||||
|
||||
class PLUGINDLLEXPORT ResizeFSJob : public Calamares::CppJob
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -74,6 +78,7 @@ public:
|
|||
|
||||
void setConfigurationMap( const QVariantMap& configurationMap ) override;
|
||||
|
||||
/** @brief Is the configuration of this job valid? */
|
||||
bool isValid() const
|
||||
{
|
||||
return ( !m_fsname.isEmpty() || !m_devicename.isEmpty() ) &&
|
||||
|
@ -85,6 +90,10 @@ private:
|
|||
RelativeSize m_atleast;
|
||||
QString m_fsname; // Either this, or devicename, is set, not both
|
||||
QString m_devicename;
|
||||
|
||||
using PartitionMatch = QPair<Device*, Partition*>;
|
||||
/** @brief Find the configured FS using KPMCore @p backend */
|
||||
PartitionMatch findPartition( CoreBackend* backend );
|
||||
};
|
||||
|
||||
CALAMARES_PLUGIN_FACTORY_DECLARATION( ResizeFSJobFactory )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue