Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-14375

"CurrentProject" environment variable is wrong

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • Qt Creator 3.4.0
    • All Other Issues
    • None

    Description

      Current behavior:

      The "CurrentProject" environment variable indicates the project that the file that happens to be open in the editor view belongs to.

      The above is confusing from at least two points of view
      1) the "current" project is being considered as being different from the "active" project
      2) if a source file is part of two (or more) projects in a session, then having said file as the active file in the editor cannot uniquely determine which project it belongs to (because it belongs to more than one project)

      The current behavior in Creator is that, given a file F that is part of two projects P1 and P2 in a session, if you open the project explorer (in the sidebar) and double-click and open the file F listed inside project P1 then the "current project" is set to be P1, while if you double-click and open the file F listed inside project P2 then P2 is set as the "current project".

      Things get even nastier when instead of using the project explorer you use the "Open Documents" list in the sidebar: in this case the "current project" is the last project for which a file with a unique project association was active in the editor (e.g. given a file F1a unique to project P1 and a file F2a unique to project P2, then opening F from the "Open Documents" list will leave the "current project" variable as it was set by the last file, F1a or F2a, that was active in the editor and which was unique to one project)

      Expected behavior:

      The "current project" environment variable should probably be renamed to "active project" to avoid confusions, and it should indicate the "active project" in the session

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              con Eike Ziller
              gyll Gyll
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes