Ver código fonte

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

Sascha Zelzer 12 anos atrás
pai
commit
d171a08d74
1 arquivos alterados com 7 adições e 4 exclusões
  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));
+    }
   }
 }