Kaydet (Commit) 5e188b4e authored tarafından Michel Renon's avatar Michel Renon Kaydeden (comit) Maxim Monastirsky

QtCreator integration : remove unnecessary whitespaces.

Change-Id: Iee8a6add830be94e6a6942dc9c4464b1a91656ff
Reviewed-on: https://gerrit.libreoffice.org/17389Reviewed-by: 's avatarMaxim Monastirsky <momonasmon@gmail.com>
Tested-by: 's avatarMaxim Monastirsky <momonasmon@gmail.com>
üst fb8d0663
...@@ -1015,15 +1015,15 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator): ...@@ -1015,15 +1015,15 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
'nb' : '9', 'nb' : '9',
} }
return xml return xml
# By default, QtCreator creates 2 BuildStepList : "Build" et "Clean" # By default, QtCreator creates 2 BuildStepList : "Build" et "Clean"
# but the "clean" can be empty. # but the "clean" can be empty.
build_configs_template = """ build_configs_template = """
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.%(index)s"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.%(index)s">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">%(base_folder)s</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">%(base_folder)s</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
...@@ -1037,13 +1037,13 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator): ...@@ -1037,13 +1037,13 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">%(arg)s</value> <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">%(arg)s</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap> </valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap> </valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
...@@ -1063,7 +1063,7 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator): ...@@ -1063,7 +1063,7 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
def generate_deploy_configs(self, lib_folder): def generate_deploy_configs(self, lib_folder):
xml = QtCreatorIntegrationGenerator.deploy_configs_template % {} xml = QtCreatorIntegrationGenerator.deploy_configs_template % {}
return xml return xml
deploy_configs_template = """ deploy_configs_template = """
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
...@@ -1079,9 +1079,9 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator): ...@@ -1079,9 +1079,9 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
</valuemap> </valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
""" """
def generate_run_configs(self, lib_folder): def generate_run_configs(self, lib_folder):
# If we use 'soffice', it's ok only for "Run", not for "Debug". # If we use 'soffice', it's ok only for "Run", not for "Debug".
# So we put "soffice.bin" that is ok for both. # So we put "soffice.bin" that is ok for both.
loexec = "%s/instdir/program/soffice.bin" % self.base_folder loexec = "%s/instdir/program/soffice.bin" % self.base_folder
...@@ -1090,7 +1090,7 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator): ...@@ -1090,7 +1090,7 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
'workdir' : self.base_folder 'workdir' : self.base_folder
} }
return xml return xml
run_configs_template = """ run_configs_template = """
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
...@@ -1129,7 +1129,7 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator): ...@@ -1129,7 +1129,7 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
</valuelist> </valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value> <value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value> <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%(loexec)s</value> <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">%(loexec)s</value>
<value type="bool" key="ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal">false</value> <value type="bool" key="ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal">false</value>
...@@ -1212,7 +1212,7 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator): ...@@ -1212,7 +1212,7 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value> <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>ProjectExplorer.Project.PluginSettings</variable> <variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap"/> <valuemap type="QVariantMap"/>
...@@ -1276,18 +1276,18 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator): ...@@ -1276,18 +1276,18 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
if os.path.isfile(path+ext): if os.path.isfile(path+ext):
return ext return ext
return "" return ""
def get_header_extension(self, src_file): def get_header_extension(self, src_file):
path = os.path.join(self.base_folder, src_file) path = os.path.join(self.base_folder, src_file)
for ext in (".hxx", ".hpp", ".h"): for ext in (".hxx", ".hpp", ".h"):
if os.path.isfile(path+ext): if os.path.isfile(path+ext):
return ext return ext
return "" return ""
def build_data_libs(self): def build_data_libs(self):
self.data_libs = {} self.data_libs = {}
all_libs = set(self.gbuildparser.libs) | set(self.gbuildparser.exes) all_libs = set(self.gbuildparser.libs) | set(self.gbuildparser.exes)
for lib in all_libs: for lib in all_libs:
self._log("\nlibrary : %s, loc=%s" % (lib.short_name(), lib.location)) self._log("\nlibrary : %s, loc=%s" % (lib.short_name(), lib.location))
...@@ -1296,7 +1296,7 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator): ...@@ -1296,7 +1296,7 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
def lopath(path): def lopath(path):
return os.path.relpath(path, lib.location) return os.path.relpath(path, lib.location)
sources_list = [] sources_list = []
includepath_list = [] includepath_list = []
# The explicit headers list is not mandatory : # The explicit headers list is not mandatory :
...@@ -1311,12 +1311,12 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator): ...@@ -1311,12 +1311,12 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
ext = self.get_source_extension(file_) ext = self.get_source_extension(file_)
if ext: if ext:
sources_list.append(lopath(file_+ext)) sources_list.append(lopath(file_+ext))
# few cxxobject files have a header beside # few cxxobject files have a header beside
ext = self.get_header_extension(file_) ext = self.get_header_extension(file_)
if ext: if ext:
headers_list.append(lopath(file_+ext)) headers_list.append(lopath(file_+ext))
# List all include paths # List all include paths
for hdir in lib.include: for hdir in lib.include:
hf_lopath = lopath(hdir) hf_lopath = lopath(hdir)
...@@ -1329,7 +1329,7 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator): ...@@ -1329,7 +1329,7 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
if hf.endswith(('.h', '.hxx', '.hpp', '.hrc')): if hf.endswith(('.h', '.hxx', '.hpp', '.hrc')):
hf_lopath = lopath(os.path.join(hdir, hf)) hf_lopath = lopath(os.path.join(hdir, hf))
headers_list.append(hf_lopath) headers_list.append(hf_lopath)
# All datas are prepared, store them for the lib. # All datas are prepared, store them for the lib.
if lib_folder in self.data_libs: if lib_folder in self.data_libs:
self.data_libs[lib_folder]['sources'] |= set(sources_list) self.data_libs[lib_folder]['sources'] |= set(sources_list)
...@@ -1345,7 +1345,7 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator): ...@@ -1345,7 +1345,7 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
} }
def emit(self): def emit(self):
# we remove existing '.pro' and '.pro.user' files # we remove existing '.pro' and '.pro.user' files
self.remove_qt_files() self.remove_qt_files()
...@@ -1362,11 +1362,11 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator): ...@@ -1362,11 +1362,11 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
includepath_list = sorted(self.data_libs[lib_folder]['includepath']) includepath_list = sorted(self.data_libs[lib_folder]['includepath'])
lib_loc = self.data_libs[lib_folder]['loc'] lib_loc = self.data_libs[lib_folder]['loc']
lib_name = self.data_libs[lib_folder]['name'] lib_name = self.data_libs[lib_folder]['name']
sources = " \\\n".join(sources_list) sources = " \\\n".join(sources_list)
headers = " \\\n".join(headers_list) headers = " \\\n".join(headers_list)
includepath = " \\\n".join(includepath_list) includepath = " \\\n".join(includepath_list)
# create .pro file # create .pro file
qt_pro_file = '%s/%s.pro' % (lib_loc, lib_name) qt_pro_file = '%s/%s.pro' % (lib_loc, lib_name)
try: try:
...@@ -1375,28 +1375,28 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator): ...@@ -1375,28 +1375,28 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
with open(qt_pro_file, mode) as fpro: with open(qt_pro_file, mode) as fpro:
fpro.write(content) fpro.write(content)
self._log("created %s\n" % qt_pro_file) self._log("created %s\n" % qt_pro_file)
except Exception as e: except Exception as e:
print("ERROR : creating pro file="+qt_pro_file, file=sys.stderr) print("ERROR : creating pro file="+qt_pro_file, file=sys.stderr)
print(e, file=sys.stderr) print(e, file=sys.stderr)
temp = traceback.format_exc() # .decode('utf8') temp = traceback.format_exc() # .decode('utf8')
print(temp, file=sys.stderr) print(temp, file=sys.stderr)
print("\n\n", file=sys.stderr) print("\n\n", file=sys.stderr)
# create .pro.user file # create .pro.user file
qt_pro_user_file = '%s/%s.pro.user' % (lib_loc, lib_name) qt_pro_user_file = '%s/%s.pro.user' % (lib_loc, lib_name)
try: try:
with open(qt_pro_user_file, mode) as fprouser: with open(qt_pro_user_file, mode) as fprouser:
fprouser.write(self.generate_pro_user_content(lib_folder)) fprouser.write(self.generate_pro_user_content(lib_folder))
self._log("created %s\n" % qt_pro_user_file) self._log("created %s\n" % qt_pro_user_file)
except Exception as e: except Exception as e:
print("ERROR : creating pro.user file="+qt_pro_user_file, file=sys.stderr) print("ERROR : creating pro.user file="+qt_pro_user_file, file=sys.stderr)
print(e, file=sys.stderr) print(e, file=sys.stderr)
temp = traceback.format_exc() temp = traceback.format_exc()
print(temp, file=sys.stderr) print(temp, file=sys.stderr)
print("\n\n", file=sys.stderr) print("\n\n", file=sys.stderr)
# create meta .pro file (lists all sub projects) # create meta .pro file (lists all sub projects)
qt_meta_pro_file = 'lo.pro' qt_meta_pro_file = 'lo.pro'
try: try:
...@@ -1411,9 +1411,9 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator): ...@@ -1411,9 +1411,9 @@ class QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
temp = traceback.format_exc() temp = traceback.format_exc()
print(temp, file=sys.stderr) print(temp, file=sys.stderr)
print("\n\n", file=sys.stderr) print("\n\n", file=sys.stderr)
self.log_close() self.log_close()
pro_template = """TEMPLATE = app pro_template = """TEMPLATE = app
CONFIG += console CONFIG += console
CONFIG -= app_bundle CONFIG -= app_bundle
...@@ -1427,7 +1427,7 @@ HEADERS += %(headers)s ...@@ -1427,7 +1427,7 @@ HEADERS += %(headers)s
""" """
pro_meta_template = """TEMPLATE = subdirs pro_meta_template = """TEMPLATE = subdirs
SUBDIRS = %(subdirs)s SUBDIRS = %(subdirs)s
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment