Hi all,

we have been discussing about a nice way to share settings from a 
project. Naturally, there are different approaches for doing this, but 
the aspects we considered to be more relevant were flexibility on what 
to share, intuitiveness on how it's done, and a minimal impact in the 
user's workflow.

If you would like to grab Creator from master and try it out, this is 
what you can expect: In order to enable shared settings you need to 
create a myproj.pro.shared file in the project's directory. This file 
must have the exact same XML structure as a myproj.pro.user would have. 
But naturally, it should contain only the settings which will be shared. 
In addition, it should also contain the file version. An example .shared 
file would look like the following.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by Qt Creator 2.3.81, 2011-09-30T15:15:32. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="int" key="EditorConfiguration.TabSize">14</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">10</value>
</data>
</qtcreator>

How do we update the project settings? In the first time your project is 
loaded with .shared settings, those will overwrite your .user settings 
(if there's no .user file yet, only settings available in the .shared 
file take effect). However, if for any reason you don't want to use a 
particular setting the project maintainer specified, you can still 
change it and we'll mark this as a *sticky* setting. So for the next 
time the project is loaded, we will only update this particular setting 
if it's not a sticky one. Note that sticky settings are tracked in the 
.user file and can "unstick" if the .user and .shared values eventually 
become equal (this is to avoid a permanent sticky setting which was 
created just because you wanted to try something out).

About creating/editing the .shared file: Yes, it's not that nice, but 
this file shouldn't change that often. Nevertheless, we are still 
thinking of a nice form to automate this (we don't want to simply 
propagate .user settings to the .shared file).

Feel free to provide feedback on design of the feature by following on 
this email. Depending on the case we can still try to change something 
for Creator 2.4. However, if it's just a bug in the implementation, 
please use the bug-tracker.

Cheers,
Leandro

-- 
Leandro T. C. Melo
Software Engineer
Nokia, Qt Development Frameworks

Nokia gate5 GmbH
Firmensitz: Invalidenstr. 117, 10115 Berlin, Germany
Registergericht: Amtsgericht Charlottenburg, Berlin: HRB 106443B
Umsatzsteueridentifikationsnummer: DE 812 845 193
Geschäftsführer: Dr. Michael Halbherr, Karim Tähtivuori

_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-creator

Reply via email to