[PC-BSD Commits] r17318 - pcbsd/current/src-qt4/life-preserver

svn at pcbsd.org svn at pcbsd.org
Tue Jun 19 10:16:35 PDT 2012


Author: kenmoore
Date: 2012-06-19 17:16:33 +0000 (Tue, 19 Jun 2012)
New Revision: 17318

Modified:
   pcbsd/current/src-qt4/life-preserver/lifePreserverUserExclude.cpp
Log:
Have life-preserver check for symbolic links in the given path and fix it when adding that path to the include/exclude list.



Modified: pcbsd/current/src-qt4/life-preserver/lifePreserverUserExclude.cpp
===================================================================
--- pcbsd/current/src-qt4/life-preserver/lifePreserverUserExclude.cpp	2012-06-19 16:23:00 UTC (rev 17317)
+++ pcbsd/current/src-qt4/life-preserver/lifePreserverUserExclude.cpp	2012-06-19 17:16:33 UTC (rev 17318)
@@ -64,8 +64,18 @@
 
 void pUserExclude::slotAddExclude()
 {
-  if( ! lineNewExclude->text().isEmpty() )
-    listExcludes->addItem(lineNewExclude->text());
+  QString newExclude = lineNewExclude->text();
+  //Check for symbolic links in the given path
+  QDir dir(newExclude);
+  QString canonical = dir.canonicalPath(); //removes symbolic links (if any)
+  if(canonical != newExclude){
+    qDebug() << "Symbolic links detected in the given path:"<< newExclude;
+    qDebug() << " - Changing to real path:"<<canonical;
+    newExclude = canonical;
+  }
+  
+  if( ! newExclude.isEmpty() )
+    listExcludes->addItem(newExclude);
   lineNewExclude->clear();
 }
 



More information about the Commits mailing list