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

Refactoring offers to add includes with wrong Capitalization and already existing includes

    XMLWordPrintable

Details

    • Windows
    • 3a03b50c7cf5c1ff2d8285c005649d954636dc12 (qt-creator/qt-creator/master)

    Description

      In a method in a newly setup GuiApplication I typed:

      QFIleDialog (yes a capital I ... should be i)

      Ok, how to fix the 'I' to become an 'i'?
      Idea: Use refactoring:

      1. Use Alt+Enter to ask for the include, that is missing anyway.
      2. Use Ctrl+Space to let QtCreator fix the class name.

       

      Ok, 1. gives me the option to add include <QFIleDialog> ... with an capital 'I'. I confirm adding it. It is marked with a "non portable path" warning. Cool.

      Anyway, for 2. I press Ctrl+Space again (with my cursor still on QFIleInfo) and QtCreator offers me to fix it to QFileInfo ... I confirm. Yeah.

      Ok, I remove the "non portable path" warning by positioning the cursor in the "include" statement and press Alt+Enter to have it fixed. Very cool. The waring vanishes.

      Now I continue to add a static method ::getOpenFileName() after my "now fixed" QFileDialog.

      As I want to have the return value as a local variable I press Alt+Enter again to choose the refactoring option.

      But hey: It offers me:

      • Add #include <QFileDialog> .... I already have this ... why is it presented here?
      • Add #include <QFIleDialog> ... hey, with a capital 'I' again ... there is no reason to have this

      I think it should not offer to have an additional #include <QFileDialog> and it should not offer a QFIleDialog to be included, too.

       

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            moellney Michael Möllney
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes