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

Moving files by renaming them fails and removes ui focus from project tree

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • Qt Creator 15.0.0
    • Qt Creator 13.0.1
    • None
    • Linux/X11
    • 78faa2fbe (master)

    Description

      In my project, I want to move a file using the very handy shortcut of renaming the file to include a new folder directly in the tree view of the project. (See attached screen capture).

      Steps to reproduce:

      1. Select file in tree view
      2. Press F2 keyboard shortcut to rename file - or - right click and select Rename... in the context menu. (Both produces the same outcome)
      3. Type in a foldername/ in front of the existing filename (in the screen capture, I type ui/ in front of ConnectionSolver.cpp to form ui/ConnectionSolver.cpp
      4. Press enter to trigger the rename/move of the file

      Expected outcome:

      1. If the folder did not exist, the folder should be created
      2. If the file in question is part of a pair (such as filename.cpp and filename.hpp), it should ask wether you also want to rename/move the other file in the pair
      3. The file(s) should be renamed/moved
      4. KEYBOARD FOCUS SHOULD STAY IN THE TREE EDITOR so that you can navigate with keys and possibly edit other files without using the mouse

      Actual outcome:

      1. The folder is created ✅
      2. It asks if I want to also move/rename the other file in the pair ✅
      3. The first file is successfully moved ✅
      4. The second file of the pair is NOT moved ❌
      5. An error message about not being able to update the project file is displayed The file /home/... /tracker/ConnectionSolver.cpp was renamed to /home/.../tracker/ui/ConnectionSolver.cpp, but the project file singularity could not be automatically changed.
      6. KEYBOARD FOCUS is now in a dropdown displaying symbols above the currently open file in the editor (!!)❌

      I understand this might be due to my use of Qbs as the project format, and spesifically because I use wildcards for my file list, but I suspect the error can be relevant regardless of which project file format is in use, and that it can be fixed independently.

       

      Here is my project file in full for reference:

      Unable to find source-code formatter for language: qbs. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml 
       
      Project{
      
          name: "Singularity"
      
          QtApplication {
              install: true
              installDir: qbs.targetOS.contains("qnx") ? FileInfo.joinPaths("/tmp", name, "bin") : base
                      
              Depends {
                  name: "Qt"
                  submodules: [
                        "core"
                      , "gui"
                      , "multimedia"
                      , "multimediawidgets"
                      , "network"
                      , "openglwidgets"
                      , "sql"
                      , "widgets"
                      , "concurrent"
                  ]
              }
              cpp.includePaths:[
                   "temp/"
                  , "pitch/"
                  ,"src/"
              ]
              cpp.defines: [
                  // You can make your code fail to compile if it uses deprecated APIs.
                  // In order to do so, uncomment the following line.
                  //"QT_DISABLE_DEPRECATED_BEFORE=0x060000" // disables all the APIs deprecated before Qt 6.0.0
                  "QT_DEPRECATED_WARNINGS"
                  , "USE_PITCH_3"
              ]
                      Group{
                  name: "Code"
                  prefix: "src"
                  excludeFiles: [
                      "/**/internal/**/*",
                      "/**/__pycache__/**/*",
                      "/**/eggs/**/*",
                      "/**/.eggs/**/*",
                      "/**/.egg-info/**/*",
                      "*.egg",
                      "*.py[cod]",
                  ]
                  files: [
                      "/**/*.html",
                      "/**/*.py",
                      "/**/*.cpp",
                      "/**/*.hpp",
                      "/**/*.c",
                      "/**/*.h",
                      "/**/*.sql",
                      "/**/*.ui",
                  ]
              }
              
              Group{
                  name: "Resources"
                  prefix: "data"
                  excludeFiles: "/**/internal/**/*"
                  files: [
                      "/**/*.html",
                      "/**/*.jpeg",
                      "/**/*.js",
                      "/**/*.mjs",
                      "/**/*.md",
                      "/**/*.mp4",
                      "/**/*.ots",
                      "/**/*.png",
                      "/**/*.svg",
                      "/**/*.ttf",
                      "/**/*.otf",
                      "/**/*.qrc",
                      "/**/*.woff*",
                  ]
              }
              Group{
                  name: "Meta"
                  prefix: "./"
                  excludeFiles: "/**/internal/**/*"
                  files: [
                      // Ignore files for docker context
                      ".gitignore",
                      // Gitlab files such as CI/CD yaml
                      ".gitlab/*",
                      // Make file with dependencies
                      "Makefile*",
                      // README generated from template
                      "README.md",
                      // Resource files
                      "resources/*",
                      // Main project file for IDE
                      "project.qbs",
                  ]
              }
          }
      } 

       

       

       

       

       

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            lennartrolland@gmail.com Lennart Rolland
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes