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

List:       kde-commits
Subject:    extragear/sdk/kdevplatform
From:       Aleix Pol Gonzalez <aleixpol () gmail ! com>
Date:       2010-02-16 22:29:56
Message-ID: 1266359396.877716.11056.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1091473 by apol:

Added IProject::itemsForUrl method.

Helps optimize some cases.


 M  +6 -2      interfaces/iproject.h  
 M  +6 -0      shell/project.cpp  
 M  +1 -0      shell/project.h  


--- trunk/extragear/sdk/kdevplatform/interfaces/iproject.h #1091472:1091473
@@ -46,6 +46,7 @@
 class IPlugin;
 class IProjectFileManager;
 class IBuildSystemManager;
+class ProjectBaseItem;
 class ProjectFileItem;
 class ProjectFolderItem;
 class IndexedString;
@@ -111,10 +112,13 @@
     /** Get a list of all files in the project */
     Q_SCRIPTABLE virtual QList<ProjectFileItem*> files() const = 0;
 
-    /** Get all items corresponding to the @p file url */
+    /** Get all items corresponding to the @p folder url */
+    Q_SCRIPTABLE virtual QList<ProjectBaseItem*> itemsForUrl( const KUrl& url ) const = 0;
+    
+    /** Get all file items corresponding to the @p file url */
     Q_SCRIPTABLE virtual QList<ProjectFileItem*> filesForUrl( const KUrl& file ) const = 0;
 
-    /** Get all items corresponding to the @p folder url */
+    /** Get all folder items corresponding to the @p folder url */
     Q_SCRIPTABLE virtual QList<ProjectFolderItem*> foldersForUrl( const KUrl& folder ) const = 0;
 
     /** Make the model to reload */
--- trunk/extragear/sdk/kdevplatform/shell/project.cpp #1091472:1091473
@@ -230,6 +230,7 @@
         }
         return files;
     }
+    
     QList<ProjectBaseItem*> itemsForUrl( const KUrl& url ) const
     {
         if( !url.isValid() ) {
@@ -588,6 +589,11 @@
     return files;
 }
 
+QList< ProjectBaseItem* > Project::itemsForUrl(const KUrl& url) const
+{
+    return d->itemsForUrl(url);
+}
+
 QList<ProjectFileItem*> Project::filesForUrl(const KUrl& url) const
 {
     QList<ProjectFileItem*> items;
--- trunk/extragear/sdk/kdevplatform/shell/project.h #1091472:1091473
@@ -71,6 +71,7 @@
 
     virtual QList<ProjectFileItem*> files() const;
 
+    virtual QList< ProjectBaseItem* > itemsForUrl(const KUrl& url) const;
     virtual QList<ProjectFileItem*> filesForUrl( const KUrl& ) const;
     virtual QList<ProjectFolderItem*> foldersForUrl(const KUrl& ) const;
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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