Selaa lähdekoodia

Do not complain about paths which have already been added to the widget.

Sascha Zelzer 12 vuotta sitten
vanhempi
commit
d171a08d74
1 muutettua tiedostoa jossa 7 lisäystä ja 4 poistoa
  1. 7 4
      Libs/Widgets/ctkPathListButtonsWidget.cpp

+ 7 - 4
Libs/Widgets/ctkPathListButtonsWidget.cpp

@@ -306,14 +306,17 @@ void ctkPathListButtonsWidgetPrivate::addPathsWithWarningMessage(const QStringLi
     QString problematicPaths;
     foreach(const QString& path, paths)
     {
-      if (!addedPaths.contains(path))
+      if (!addedPaths.contains(path) && !this->PathListWidget->contains(path))
       {
         problematicPaths += path + '\n';
       }
     }
-    QMessageBox::information(q, tr("Adding paths failed"),
-                             QString(tr("Failed to add the following paths:\n\n%1\nPlease check your permissions."))
-                             .arg(problematicPaths));
+    if (!problematicPaths.isEmpty())
+    {
+      QMessageBox::information(q, tr("Adding paths failed"),
+                               QString(tr("Failed to add the following paths:\n\n%1\nPlease check your permissions."))
+                               .arg(problematicPaths));
+    }
   }
 }