diff --git a/src/gui/partitionmanagerwidget.cpp b/src/gui/partitionmanagerwidget.cpp
index c973870..0f3441f 100644
--- a/src/gui/partitionmanagerwidget.cpp
+++ b/src/gui/partitionmanagerwidget.cpp
@@ -675,36 +675,20 @@ bool PartitionManagerWidget::showInsertDialog(Partition& insertedPartition, qint
if (result != KDialog::Accepted)
return false;
}
- else
- {
- if (selectedPartition()->capacity() > insertedPartition.fileSystem().maxCapacity())
- {
- KMessageBox::sorry(this, i18nc("@info",
- "The target partition is bigger than the source allows."
- "You are trying to paste a %2 partition onto an existing partition "
- "that is bigger than %1, the maximum capacity of a %2 file system.",
- Capacity(insertedPartition.fileSystem().maxCapacity()).toString(Capacity::AppendUnit),
- insertedPartition.fileSystem().name()
- ),
- i18nc("@title:window", "Target Partition Too Big"));
- return false;
- }
-
- if (KMessageBox::warningContinueCancel(this,
- i18nc("@info", "You are about to lose all data on partition "
- "%1."
- "Overwriting one partition with another (or with an image file) will "
- "destroy all data on this target partition."
- "If you continue now and apply the resulting operation in the main "
- "window, all data currently stored on %1 will "
- "unrecoverably be overwritten.",
- selectedPartition()->deviceNode()),
- i18nc("@title:window", "Really Overwrite Existing Partition?"),
- KGuiItem(i18nc("@action:button", "Overwrite Partition"), "arrow-right"),
- KStandardGuiItem::cancel(),
- "reallyOverwriteExistingPartition") == KMessageBox::Cancel)
- return false;
- }
+ else if (KMessageBox::warningContinueCancel(this,
+ i18nc("@info", "You are about to lose all data on partition "
+ "%1."
+ "Overwriting one partition with another (or with an image file) will "
+ "destroy all data on this target partition."
+ "If you continue now and apply the resulting operation in the main "
+ "window, all data currently stored on %1 will "
+ "unrecoverably be overwritten.",
+ selectedPartition()->deviceNode()),
+ i18nc("@title:window", "Really Overwrite Existing Partition?"),
+ KGuiItem(i18nc("@action:button", "Overwrite Partition"), "arrow-right"),
+ KStandardGuiItem::cancel(),
+ "reallyOverwriteExistingPartition") == KMessageBox::Cancel)
+ return false;
if (insertedPartition.length() < sourceLength)
{
diff --git a/src/ops/copyoperation.cpp b/src/ops/copyoperation.cpp
index 0baedce..23a55c9 100644
--- a/src/ops/copyoperation.cpp
+++ b/src/ops/copyoperation.cpp
@@ -318,5 +318,8 @@ bool CopyOperation::canPaste(const Partition* p, const Partition* source)
if (source->length() > p->length())
return false;
+ if (!p->roles().has(PartitionRole::Unallocated) && p->capacity() > source->fileSystem().maxCapacity())
+ return false;
+
return true;
}