When renaming a directory where there are files with modifications, after the renaming the directory, any modifications are lost without warning. This is really awkward.
I could reproduce this with the latest kid3 from ppa:ufleisch/kid3 bionic 3.6.2-0bionic3. Also 'kid3' notified about unsaved changes after the rename at exit. But by selcting 'yes' nothing is changed at all. 'no' is as expacted. 'cancel' goes back.
How to reproduce:
$mkdirfoo$cdfoo$wgethttps://archive.org/download/testmp3testfile/mpthreetest.mp3$cd..<expand'foo'directory><select'mpthreetest.mp3'file><change'Title'><select'foo'directory><pressF2><enter'bar'><select'OK'><expand'bar'directory><select'mpthreetest.mp3'file># modifications are lost<pressCtrl+Q># warning dialog about 'The current directory has been modified. Do you want to save it?'<case'yes'># nothing is saved<case'no'># nothing is changed
Last edit: Bert Wesarg 2018-11-04
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the report. When using the menu item "Tools/Rename Directory", Kid3 asks to save when there are unsaved changes. But when using "Rename" from the file list context menu (or its keyboard shortcut F2), changes are lost, which is really not how it should be. Probably this is a problem with the Qt file system model, which does not correctly update renamed directories. And when using the model to rename items, it can display a message box, which will crash the program when it is not using a GUI (such as kid3-cli). After all, I am not very satisfied with this file system model and think about replacing it. However, this could take some time.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm not sure, what you conslusion is? Do you keep the current behaviour, until you came along with changing "file system model". Or can we somehow prevent issueing a directory rename at all, if it contains modifications?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No need to worry, I will try to fix it really soon. I am not going to replace the whole QFileSystemModel with something homegrown, I will take the QFileSystemModel and adapt it to be built outside of Qt, then I will be able to fix its shortcomings. This is the beauty of Open Source. So I will see soon if this can fix the bug.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can now find a development snapshot kid3-git20181114 in the development folder. It uses a fixed file system model which allows to directly rename its nodes. However, the file system model alone is not enough. The audio files itself have to support changing their path. This feature is only available for the TaglibMetadata plugin, so you should enable only this plugin in the "Metadata Plugins & Priority" section of the Plugins settings (after changing the plugins you have to restart Kid3). This should not be a problem because TagLib supports all audio file types. Then you should be able to rename files or folders (using Rename from the file list context menu or the F2 key) without loosing edits.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I could reproduce this with the latest kid3 from ppa:ufleisch/kid3 bionic 3.6.2-0bionic3. Also 'kid3' notified about unsaved changes after the rename at exit. But by selcting 'yes' nothing is changed at all. 'no' is as expacted. 'cancel' goes back.
How to reproduce:
Last edit: Bert Wesarg 2018-11-04
Thanks for the report. When using the menu item "Tools/Rename Directory", Kid3 asks to save when there are unsaved changes. But when using "Rename" from the file list context menu (or its keyboard shortcut F2), changes are lost, which is really not how it should be. Probably this is a problem with the Qt file system model, which does not correctly update renamed directories. And when using the model to rename items, it can display a message box, which will crash the program when it is not using a GUI (such as kid3-cli). After all, I am not very satisfied with this file system model and think about replacing it. However, this could take some time.
I'm not sure, what you conslusion is? Do you keep the current behaviour, until you came along with changing "file system model". Or can we somehow prevent issueing a directory rename at all, if it contains modifications?
No need to worry, I will try to fix it really soon. I am not going to replace the whole QFileSystemModel with something homegrown, I will take the QFileSystemModel and adapt it to be built outside of Qt, then I will be able to fix its shortcomings. This is the beauty of Open Source. So I will see soon if this can fix the bug.
You can now find a development snapshot kid3-git20181114 in the development folder. It uses a fixed file system model which allows to directly rename its nodes. However, the file system model alone is not enough. The audio files itself have to support changing their path. This feature is only available for the TaglibMetadata plugin, so you should enable only this plugin in the "Metadata Plugins & Priority" section of the Plugins settings (after changing the plugins you have to restart Kid3). This should not be a problem because TagLib supports all audio file types. Then you should be able to rename files or folders (using Rename from the file list context menu or the F2 key) without loosing edits.
Fixed in Kid3 3.7.0.