Menu

#188 Loosing edits when renaming directory

3.7.0
closed
nobody
None
9
2018-12-23
2018-11-04
Bert Wesarg
No

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.

Discussion

  • Bert Wesarg

    Bert Wesarg - 2018-11-04

    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:

    $ mkdir foo
    $ cd foo
    $ wget https://archive.org/download/testmp3testfile/mpthreetest.mp3
    $ cd ..
    <expand 'foo' directory>
    <select 'mpthreetest.mp3' file>
    <change 'Title'>
    <select 'foo' directory>
    <press F2>
    <enter 'bar'>
    <select 'OK'>
    <expand 'bar' directory>
    <select 'mpthreetest.mp3' file>
    # modifications are lost
    <press Ctrl+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
  • Urs Fleisch

    Urs Fleisch - 2018-11-06

    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.

     
    • Bert Wesarg

      Bert Wesarg - 2018-11-06

      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?

       
  • Urs Fleisch

    Urs Fleisch - 2018-11-07

    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.

     
  • Urs Fleisch

    Urs Fleisch - 2018-11-15

    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.

     
  • Urs Fleisch

    Urs Fleisch - 2018-12-23

    Fixed in Kid3 3.7.0.

     
  • Urs Fleisch

    Urs Fleisch - 2018-12-23
    • status: open --> closed
    • Group: 3.6.1 --> 3.7.0
     
MongoDB Logo MongoDB