From a38a6cd35d1c085fce9f40ed740b0ec469677fdc Mon Sep 17 00:00:00 2001 From: abhijeet sharma Date: Thu, 22 Mar 2018 01:28:56 +0530 Subject: [PATCH] Fixed the "remove existing mount point" bug Summary: The QString "contains method" is also searching for empty QStrings. Due to this all entries in /etc/fstab were removed . After this patch it is searching for only non-empty strings in removeMountPoint() function. Reviewers: stikonas Reviewed By: stikonas Tags: #kde_partition_manager Differential Revision: https://phabricator.kde.org/D11542 --- src/gui/editmountpointdialogwidget.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/editmountpointdialogwidget.cpp b/src/gui/editmountpointdialogwidget.cpp index 7591a83..624b599 100644 --- a/src/gui/editmountpointdialogwidget.cpp +++ b/src/gui/editmountpointdialogwidget.cpp @@ -163,9 +163,9 @@ void EditMountPointDialogWidget::removeMountPoint() { int i=0; for (const auto &e : fstabEntries()) { - if(e.fsSpec().contains(partition().deviceNode()) || e.fsSpec().contains(partition().fileSystem().uuid()) || - e.fsSpec().contains(partition().fileSystem().label()) || e.fsSpec().contains(partition().label()) || e.fsSpec().contains(partition().uuid()) ) - { + if((e.fsSpec().contains(partition().deviceNode()) && !partition().deviceNode().isEmpty() ) || (e.fsSpec().contains(partition().fileSystem().uuid()) && !partition().fileSystem().uuid().isEmpty()) || + (e.fsSpec().contains(partition().fileSystem().label()) && !partition().fileSystem().label().isEmpty()) || (e.fsSpec().contains(partition().label()) && !partition().label().isEmpty() ) || (e.fsSpec().contains(partition().uuid()) && !partition().uuid().isEmpty() ) ) + { fstabEntries().removeAt(i); partition().setMountPoint(QString()); i--;