Different *.user file extension for Windows and Linux?



  • Is it somehow possible to choose another file extension than .user for the user settings?

    Actually I am using the same source code and CMakeTexts.txt file for Windows and Linux compilation. So far I always have to properly rename the CMakeTexts.txt.user file to something with .linux and .windows and back again when switching to the other system - with the permanent danger that one day I forget it and then QtCreator starts to run amok in the "wrong" file!

    Hmm - I am afraid that this is not possible: Qt Creator somehow treats the *.user files as it's "private property" where I should normally not fiddle around in any way...

    Still - if somebody has found a more convenient solution for the switching I would be happy to hear about it!



  • @CoBo Are you working with the same working copy on Windows and Linux? Than I'm afraid you're on your own.

    better way is to use a vcs like git and sync two working copies with it. of course the .user should not be checked in. thats also the official recommendation.

    Regards

    Edit: of course you could patch Creator on one platform to use another extension, but if that's really worth the trouble...



  • @aha_1980 Yes, I am working with the same source code for both systems!

    In the past I had a very small project where I had the code on a USB stick, and I changed between a Windows and a Linux computer. Now the Windows computer is virtual and has direct access to the same source code - in principle even at the same time, so I have to be very careful...

    CMake is in that sense better to handle because it leaves no traces in the source directory, and by specifying two different target (binary) directories the codes are separated. Only that *.user file is a problem!

    So maybe the "hacker solution" with patching some QtCreator is still worth a try...



  • @CoBo said in Different *.user file extension for Windows and Linux?:

    In the past I had a very small project where I had the code on a USB stick, and I changed between a Windows and a Linux computer. Now the Windows computer is virtual and has direct access to the same source code - in principle even at the same time, so I have to be very careful...

    That sounds as if you don't use a version control system. I strongly recommend using one. The best thing I can recommend is git, it's perfectly integrated into QtCreator and can be used as local VCS without a server.

    Even if you work on the same working copy you could commit changes and undo them later if needed. The only thing you would need to do is to choose Tools -> Git -> Create Repository from Creator and then commit your initial state.

    But note that git does more for you: if you have two working copies (one for Windows, one for Linux), it also converts the line endings to a common style when you commit changes on one side and pull them on the other.

    CMake is in that sense better to handle because it leaves no traces in the source directory, and by specifying two different target (binary) directories the codes are separated. Only that *.user file is a problem!

    But that's the same with QMake if you use shadow building. All build artefacts are in the build directory, only the .pro.user is in the source dir.

    So maybe the "hacker solution" with patching some QtCreator is still worth a try...

    Of course you are free to do this :)



  • Actually you are right: doing the step and go using git is in a way overdue for me!

    I was using version control software for many years when I was working on projects together with others (first CVS, later SVN), and I could not even think of doing it otherwise in a team.

    So what holds me back so far?

    • First of all the fact that despite of several efforts I finally never really understood the way how git is working: It is somehow "different" than CVS and SVN (which are somehow "logical" for me), also it must be somehow "genial", but how? I hate it to jump on such a train without some basic understanding of what I am doing!

    • I am working on the project all alone, so the urgency is somewhat less. However, the possibility to step back if at one moment I was running in the wrong direction for a while can be very valuable! Because it is almost sure that the last full backup was either a bit too early or too late for bringing me back to the exact point where I want to restart...

    PS: This is starting to be a bit off-topic, so I will stop this git related thing here! Except for the point of course that it would also solve my initial problem with the duplicate *.user files.



  • @CoBo said in Different *.user file extension for Windows and Linux?:

    First of all the fact that despite of several efforts I finally never really understood the way how git is working: It is somehow "different" than CVS and SVN (which are somehow "logical" for me), also it must be somehow "genial", but how? I hate it to jump on such a train without some basic understanding of what I am doing!

    Yeah, getting off-topic, so I'll stop here also.

    But one last hint: just start using git. I did it also - and learned on the way. first you only need to commit your changes. Later you will learn all the other stuff.

    Yeah, and a second one: do backups. Until you are fluent with git and push your changes to an other station, do at least file system based backups.

    I still combine both and it works very well for me.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.