[Bug 56429] Can't open two files with the same name (but from different directories) in the editor

Hamish Rodda meddie at yoyo.its.monash.edu.au
Mon Apr 7 14:42:02 UTC 2003


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
     
http://bugs.kde.org/show_bug.cgi?id=56429     
meddie at yoyo.its.monash.edu.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From meddie at yoyo.its.monash.edu.au  2003-04-07 14:41 -------
Subject: kdevelop/src

CVS commit by rodda: 

Fix bug 56429: unable to open files with same name in different directories.

CCMAIL:56429-done at bugs.kde.org


  M +11 -6     partcontroller.cpp   1.76


--- kdevelop/src/partcontroller.cpp  #1.75:1.76
@@ -157,9 +157,12 @@ void PartController::setEncoding(const Q
 void PartController::editDocument(const KURL &inputUrl, int lineNum)
 {
+  kdDebug(9000) << k_funcinfo << inputUrl.prettyURL() << " linenum " << lineNum << endl;
+
   KURL url = inputUrl;
   bool localUrl = url.url().startsWith("file:/");
 
   // Make sure the URL exists
-  if (!url.isValid() || (!localUrl && !KIO::NetAccess::exists(url))) {
+  // KDE 3.0 compatibility hack: use KIO::NetAccess for everything >= KDE 3.1
+  if (!url.isValid() || (localUrl ? !QFile(url.path()).exists() : !KIO::NetAccess::exists(url))) {
     // Try to find this file in the current project's list instead
     KDevProject* project = API::getInstance()->project();
@@ -178,5 +181,5 @@ void PartController::editDocument(const 
 
     localUrl = url.url().startsWith("file:/");
-    if (!url.isValid() || (!localUrl && !KIO::NetAccess::exists(url))) {
+    if (!url.isValid() || (localUrl ? !QFile(url.path()).exists() : !KIO::NetAccess::exists(url))) {
       // See if this url is relative to the current project's directory
       url = project->projectDirectory() + "/" + url.url();
@@ -184,5 +187,5 @@ void PartController::editDocument(const 
 
     localUrl = url.url().startsWith("file:/");
-    if (!url.isValid() || (!localUrl && !KIO::NetAccess::exists(url))) {
+    if (!url.isValid() || (localUrl ? !QFile(url.path()).exists() : !KIO::NetAccess::exists(url))) {
       // Here perhaps we should prompt the user to find the file?
       return;
@@ -190,4 +193,6 @@ void PartController::editDocument(const 
   }
 
+  // We now have a url that exists ;)
+
   url.cleanPath(true);
 
@@ -390,5 +395,5 @@ QPopupMenu *PartController::contextPopup
 
 
-static bool urlIsEqual(const KURL &a, const KURL &b)
+/*static bool urlIsEqual(const KURL &a, const KURL &b)
 {
   if (a.isLocalFile() && b.isLocalFile())
@@ -404,5 +409,5 @@ static bool urlIsEqual(const KURL &a, co
 
   return a == b;
-}
+}*/
 
 KParts::Part *PartController::partForURL(const KURL &url)
@@ -412,5 +417,5 @@ KParts::Part *PartController::partForURL
   {
     KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(it.current());
-    if (ro_part && urlIsEqual(url, ro_part->url()))
+    if (ro_part && url == ro_part->url())
       return ro_part;
   }




More information about the KDevelop-devel mailing list