[Libreoffice-commits] core.git: bin/gbuild-to-ide

Michel Renon michel.renon at free.fr
Mon Jul 27 06:38:36 PDT 2015


 bin/gbuild-to-ide |   23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

New commits:
commit dcec162ea083b3604ff82c4dc3ca43d2b5054ea7
Author: Michel Renon <michel.renon at free.fr>
Date:   Tue Jul 14 23:40:04 2015 +0200

    tdf#92561 : QtCreator doesn't find any generated c++ headers.
    
    Use lib.include to list :
    - all include paths (with generated c++ headers),
    - header files for each lib/module.
    
    Change-Id: I44f20ddbcaf2ffa844ec02977dea10f32fe9d92f
    Reviewed-on: https://gerrit.libreoffice.org/17055
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Maxim Monastirsky <momonasmon at gmail.com>
    Tested-by: Maxim Monastirsky <momonasmon at gmail.com>

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index af1b20a..82d1634 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1298,8 +1298,13 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
                 return os.path.relpath(path, lib.location)
                 
             sources_list = []
-            headers_list = []
             includepath_list = []
+            # The explicit headers list is not mandatory :
+            # QtCreator just needs 'include_path_list' to find all headers files.
+            # But files listed in 'header_list' will be shown
+            # in a specific "Headers" folder in QtCreator's Project panel.
+            # We will list here only headers files of current lib.
+            headers_list = []
             for file_ in lib.cxxobjects:
                 # the file has no extension : search it
                 # self._log("\n    file : %s" % file_)
@@ -1312,21 +1317,19 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
                 if ext:
                     headers_list.append(lopath(file_+ext))
             
-            # List all headers
+            # List all include paths
             for hdir in lib.include:
-                # except from "workdir" folder
-                if "workdir" not in hdir:
+                hf_lopath = lopath(hdir)
+                includepath_list.append(hf_lopath)
+
+            # List headers files from current lib
+            for hdir in lib.include:
+                if hdir.startswith(lib.location):
                     for hf in os.listdir(hdir):
                         if hf.endswith(('.h', '.hxx', '.hpp', '.hrc')):
                             hf_lopath = lopath(os.path.join(hdir, hf))
                             headers_list.append(hf_lopath)
             
-            # We also need to have a list of include paths
-            for header in headers_list:
-                header_path = os.path.dirname(header)
-                if header_path not in includepath_list:
-                    includepath_list.append(header_path)
-            
             # All datas are prepared, store them for the lib.
             if lib_folder in self.data_libs:
                 self.data_libs[lib_folder]['sources'] |= set(sources_list)


More information about the Libreoffice-commits mailing list