I have made drag&drop for ProjectExplorer. Where is replaced header names for #include statement?
-
I have made drag&drop for ProjectExplorer. For it, I make method
FolderNavigationModel::dropMimeData and set some properties of m_listView & m_fileSystemModel.In result, it can move files from one folder to another, and it changes path in .pro file.
Remain make replace header names for #include statement, which work for simple rename, but not for change path.
It take place somewhere in DocumentManager::renamedFile, and farther probably in CppEditorDocument through signal filePathChanged.
Can someone explane me where take place the replacement of statement #include?
-
Hi @iss7gli7,
The replacement is done in
CppModelManager::renameIncludes
.That feature was added in https://codereview.qt-project.org/c/qt-creator/qt-creator/+/95658
Do you want to make your drag&drop function an official addition to QtCreator?
Regards
-
The replacement is done in CppModelManager::renameIncludes
Thanks, this what I need.
Do you want to make your drag&drop function an official addition to QtCreator?
I post it here a little bit later, if it interestingly. This feature is quite convenient.
I can make patch for official addition, if there accepted such my changes. -
Hi @iss7gli7,
cool!
I post it here a little bit later, if it interestingly. This feature is quite convenient.
I can make patch for official addition, if there accepted such my changes.I don't have the last word, but your patch sounds interesting for other users, so I see a high chance of getting accepted.
All contributions to Qt have to go through Gerrit. Don't get frightened, it looks like a big setup at first sight, but it's rather straigthforward.
If you have questions in that process, don't hesitate to ask here!
Regards
-
@aha_1980
Ok, thanks. But while I have mistake somewhere. Replace #include all work fine, but after in snapshot() collection of Document remain duplicate of file with previous path and in some cases it shows. When I fix it bag and other if has another, I will contribute it. -
@aha_1980
Hi, I did it again, and solve all errors, except my poor English).
I try push it to Gerrit, but it says:remote: error: branch refs/heads/master: remote: To push into this reference you need 'Push' rights. remote: User: (my email) remote: Contact an administrator to fix the permissions remote: Processing changes: refs: 1, done To ssh://codereview.qt-project.org/qt-creator/qt-creator ! [remote rejected] master -> master (prohibited by Gerrit: not permitted: update) error: failed to push some refs to 'ssh://codereview.qt-project.org/qt-creator/qt-creator' The command "/usr/bin/git" terminated with exit code 1.
What I need to do for the push?
In documentation "Setting up Gerrit" mentioned the init-repository script, but not says what it is. I simply did "git clone ..." and setting up connection, user and SSH.
Through "ssh codereview.qt-project.org gerrit stream-events" it connected.In message says, that I need contact to an administration, but where is button for it?
-
@iss7gli7 It is explained here: https://wiki.qt.io/Building_Qt_5_from_Git
$ cd qt5 $ perl init-repository
-