Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Different *.user file extension for Windows and Linux?
Forum Updated to NodeBB v4.3 + New Features

Different *.user file extension for Windows and Linux?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
6 Posts 2 Posters 2.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    deleted427
    wrote on 22 Nov 2017, 10:45 last edited by
    #1

    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!

    A 1 Reply Last reply 22 Nov 2017, 11:11
    0
    • D deleted427
      22 Nov 2017, 10:45

      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!

      A Offline
      A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on 22 Nov 2017, 11:11 last edited by aha_1980
      #2

      @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...

      Qt has to stay free or it will die.

      D 1 Reply Last reply 22 Nov 2017, 16:52
      2
      • A aha_1980
        22 Nov 2017, 11:11

        @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...

        D Offline
        D Offline
        deleted427
        wrote on 22 Nov 2017, 16:52 last edited by
        #3

        @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...

        A 1 Reply Last reply 23 Nov 2017, 07:21
        0
        • D deleted427
          22 Nov 2017, 16:52

          @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...

          A Offline
          A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on 23 Nov 2017, 07:21 last edited by
          #4

          @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 :)

          Qt has to stay free or it will die.

          1 Reply Last reply
          2
          • D Offline
            D Offline
            deleted427
            wrote on 23 Nov 2017, 07:41 last edited by
            #5

            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.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on 23 Nov 2017, 08:05 last edited by
              #6

              @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.

              Qt has to stay free or it will die.

              1 Reply Last reply
              1

              1/6

              22 Nov 2017, 10:45

              • Login

              • Login or register to search.
              1 out of 6
              • First post
                1/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved