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

Renaming includes is one-way-street for files with long headers

    XMLWordPrintable

Details

    Description

      1. Create a new Qt Widgets Application project.
      2. Open the project's mainwindow.h.
      3. At the beginning of the file, insert the attached header. It's taken from an old example project.
      4. Save and close all files.
      5. Right-click on mainwindow.h in Projects view and rename it to "FILE".
        It moves to "Other files".
      6. Oops, wrong file name. Rename it to "file".
      7. Oops, wrong again. rename it to "rightname.h".
      8. Open main.cpp
        The first line reads:
        #include "file"
        

      Creator should not lose track of the headers during renaming.

      IIRC this happens because only the beginning of files is being parsed to recognize their type. The copyright header is so long that Creator doesn't find any C++ and thus does not notice it is a header file.

      Found with the help of Squish test tst_rename_file.

      Attachments

        Activity

          People

            davschul David Schulz
            rlohning Robert Löhning
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: