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

Qt Creator hangs when creating a new file in cmake project

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • Qt Creator 12.0.2
    • Qt Creator 11.0.3
    • None
    • Ubuntu 20.04.3 LTS, cmake project
    • Linux/X11
    • 1c59014d7 (12.0)

    Description

      When I have an open project and selects "Add New" -> "C/C+" -> "C/C+ Header File" qtcreator hangs. 

      I have debuged this and it is hanging in source file src/plugins/[projectexplorer/projectnodes.cpp |https://github.com/qt-creator/qt-creator/tree/master/src/plugins/projectexplorer]at line 351-352. That is, it is stuck in:
      ...
      while ((!fi.exists() || !fi.isDir()) && !fi.isRoot())
          fi.setFile(fi.absolutePath());
      ...
      The context is that fi.fileName() == fi.absolutePath() (both are empty strings), and thus qtcreator is stuck in the while loop. Adding extra condition to the while loop seems to fix the problem (at least for me):
      +    while ((!fi.exists() || !fi.isDir()) && !fi.isRoot() &&
      +           (fi.fileName() != fi.absolutePath()))
      +      fi.setFile(fi.absolutePath());
       
      Hope this helps developing the tool

      Attachments

        For Gerrit Dashboard: QTCREATORBUG-30067
        # Subject Branch Project Status CR V

        Activity

          People

            kandeler Christian Kandeler
            jochumsson Thorvaldur Jochumsson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes