[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Bkdevplatform=5D_plugins/grepview=3A_Patch_by_Lamber?=
From:       Olivier JG <olivier.jg () gmail ! com>
Date:       2011-02-24 22:57:13
Message-ID: 20110224225713.DD9C2A60A9 () git ! kde ! org
[Download RAW message or body]

Git commit 75425b390551c3f82cfe31f6e4051847b2b99821 by Olivier JG.
Committed on 24/02/2011 at 23:51.
Pushed by olivierjg into branch 'master'.

Patch by Lambert CLARA: Add url for the activeDocument to grepview's "Locations" even if out of project.

M  +10   -1    plugins/grepview/grepdialog.cpp     

http://commits.kde.org/kdevplatform/75425b390551c3f82cfe31f6e4051847b2b99821

diff --git a/plugins/grepview/grepdialog.cpp b/plugins/grepview/grepdialog.cpp
index 10f7438..41cc012 100644
--- a/plugins/grepview/grepdialog.cpp
+++ b/plugins/grepview/grepdialog.cpp
@@ -197,14 +197,23 @@ QMenu* GrepDialog::createSyncButtonMenu()
         url.cd("..");
         while(m_plugin->core()->projectController()->findProjectForUrl(url))
         {
+            url.adjustPath(KUrl::RemoveTrailingSlash);
             if(hadUrls.contains(url))
                 break;
-            url.adjustPath(KUrl::RemoveTrailingSlash);
             hadUrls.insert(url);
             addUrlToMenu(ret, url);
             if(!url.cd(".."))
                 break;
         }
+
+        // if the current file's parent directory is not in the project, add it
+        url = doc->url().upUrl();
+        url.adjustPath(KUrl::RemoveTrailingSlash);
+        if(!hadUrls.contains(url))
+        {
+            hadUrls.insert(url);
+            addUrlToMenu(ret, url);
+        }
     }
     
     foreach(IProject* project, m_plugin->core()->projectController()->projects())

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic