kdevelop

Andras Mantia amantia at freemail.hu
Tue Jul 15 19:57:08 UTC 2003


CVS commit by amantia: 

Resolve symlinks before opening a local file, so you won't end up with the same file opened twice. I gave a quick test and it's ok when you open the files from the Project View, File->Open, Message window, Grep window and the Framestack window.
The downside is that the titlebar now shows the canonical path. KDevelopers, if you have a better place for the symlink resolvation, move the code there!
Add "-follow" to the "find" arguments, so it will follow the links and the files will be greped even if they are under a symlinked directory.	
	

CCMAIL: kdevelop-devel at kdevelop.org


  M +3 -0      ChangeLog   1.1062
  M +1 -1      parts/grepview/grepviewwidget.cpp   1.23
  M +14 -0     src/partcontroller.cpp   1.90


--- kdevelop/ChangeLog  #1.1061:1.1062
@@ -1,2 +1,5 @@
+2003-07-15 Andras Mantia <amantia at freemail.hu>
+    * resolve links before opening a local file
+    * add "-follow" as a switch for "find" to successfully grep even in symlinked directories
 2003-07-14 Amilcar Lucas <a.lucas at tu-bs.de>
     * If no Main Program was selected in Project Options...-> Run Options, then use the

--- kdevelop/parts/grepview/grepviewwidget.cpp  #1.22:1.23
@@ -180,5 +180,5 @@ void GrepViewWidget::searchActivated()
     filepattern += " \\( -name ";
     filepattern += files;
-    filepattern += " \\) -print";
+    filepattern += " \\) -print -follow";
 
     QString command = filepattern + " " ;

--- kdevelop/src/partcontroller.cpp  #1.89:1.90
@@ -218,4 +218,10 @@ void PartController::editDocument(const 
 
   url.cleanPath(true);
+  if (url.isLocalFile())
+  {
+    QString path = url.path();
+    path = QDir(path).canonicalPath();
+    url.setPath(path);
+  }    
 
   KParts::Part *existingPart = partForURL(url);
@@ -476,4 +482,12 @@ QPopupMenu *PartController::contextPopup
 KParts::Part *PartController::partForURL(const KURL &url)
 {
+  KURL urlToTest = url;
+  if (url.isLocalFile())
+  {
+    QString path = url.path();
+    path = QDir(path).canonicalPath();
+    urlToTest.setPath(path);
+  }    
+  kdDebug(9000) << "partForURL : " << urlToTest.prettyURL() << endl;
   QPtrListIterator<KParts::Part> it(*parts());
   for ( ; it.current(); ++it)






More information about the KDevelop-devel mailing list