diff --git a/src/modules/partition/core/PartitionCoreModule.cpp b/src/modules/partition/core/PartitionCoreModule.cpp index dafa6a9a0..c362dca0e 100644 --- a/src/modules/partition/core/PartitionCoreModule.cpp +++ b/src/modules/partition/core/PartitionCoreModule.cpp @@ -557,15 +557,17 @@ PartitionCoreModule::formatPartition( Device* device, Partition* partition ) void PartitionCoreModule::setFilesystemLabel( Device* device, Partition* partition, const QString& newLabel ) { - if ( newLabel.isEmpty() ) + if ( newLabel == PartitionInfo::label( partition ) ) { - // Don't bother return; } + auto deviceInfo = infoForDevice( device ); Q_ASSERT( deviceInfo ); OperationHelper helper( partitionModelForDevice( device ), this ); + PartitionInfo::setLabel( partition, newLabel ); + deviceInfo->takeJob< ChangeFilesystemLabelJob >( partition ); deviceInfo->makeJob< ChangeFilesystemLabelJob >( partition, newLabel ); } diff --git a/src/modules/partition/gui/EditExistingPartitionDialog.cpp b/src/modules/partition/gui/EditExistingPartitionDialog.cpp index 66f1fb3ef..7b815b296 100644 --- a/src/modules/partition/gui/EditExistingPartitionDialog.cpp +++ b/src/modules/partition/gui/EditExistingPartitionDialog.cpp @@ -54,7 +54,6 @@ updateLabel( PartitionCoreModule* core, Device* device, Partition* partition, co if ( partition->fileSystem().type() != FileSystem::Type::Unformatted && fsLabel != partition->fileSystem().label() ) { core->setFilesystemLabel( device, partition, fsLabel ); - PartitionInfo::setLabel(partition, fsLabel); } } @@ -84,7 +83,7 @@ EditExistingPartitionDialog::EditExistingPartitionDialog( Device* device, // The filesystem label field is always enabled, because we may want to change // the label on the current filesystem without formatting. - m_ui->fileSystemLabelEdit->setText( PartitionInfo::label(m_partition)); + m_ui->fileSystemLabelEdit->setText( PartitionInfo::label( m_partition ) ); m_ui->fileSystemLabel->setEnabled( true ); replacePartResizerWidget();