Created attachment 104608 [details] Rename window Rename file with overwrite is impossible – name is highlighted in red, and OK button is inactive. See an attachment.
An overwrite of existing files is not desired when renaming. The renaming runns automatically without question dialogs. So we check if a file with the new name already exists. Maik
(In reply to Maik Qualmann from comment #1) > An overwrite of existing files is not desired when renaming. The renaming > runns automatically without question dialogs. So we check if a file with the > new name already exists. In digiKam 4 it was possible, after confirm with dialog box. Now for rename it is necessary to delete first old file with all metadata, or use external application.
Created attachment 104779 [details] Add option to overwrite existing files in advance rename dialog This adds a checkbox to the advanced rename dialog to allow replacing existing files by moving them to trash before renaming. For the rename progress dialog I needed signals from iojobthreads for deletion as well. Previously there was a special case in place just for renaming. I generalized it such that for any kind of jobs signals are provided and the type of job is identified via the enum Operation that is now in its own namespace IOOperation located in iojobsthread.h. This was necessary as this enum is needed over several "levels" of classes.
Created attachment 104795 [details] Add option to overwrite existing files in advance rename dialog (V2) Update for current master.
@Gilles, Maik, Mario: Did you already have time to look at this?
I have compiler warnings here: /home/maik/Devel/digikam-software-compilation/core/utilities/advancedrename/advancedrenameprocessdialog.cpp: In member function ‘void Digikam::AdvancedRenameProcessDialog::slotCancel(int, const QList<QUrl>&)’: /home/maik/Devel/digikam-software-compilation/core/utilities/advancedrename/advancedrenameprocessdialog.cpp:166:50: warning: unused parameter ‘operation’ [-Wunused-parameter] void AdvancedRenameProcessDialog::slotCancel(int operation, const QList<QUrl>& srcFiles) /home/maik/Devel/digikam-software-compilation/core/utilities/advancedrename/advancedrenameprocessdialog.cpp:166:80: warning: unused parameter ‘srcFiles’ [-Wunused-parameter] void AdvancedRenameProcessDialog::slotCancel(int operation, const QList<QUrl>& srcFiles) /home/maik/Devel/digikam-software-compilation/core/utilities/advancedrename/advancedrenameprocessdialog.cpp: In member function ‘void Digikam::AdvancedRenameProcessDialog::slotRenameFailed(int, const QList<QUrl>&)’: /home/maik/Devel/digikam-software-compilation/core/utilities/advancedrename/advancedrenameprocessdialog.cpp:208:56: warning: unused parameter ‘operation’ [-Wunused-parameter] void AdvancedRenameProcessDialog::slotRenameFailed(int operation, const QList<QUrl>& srcFiles) /home/maik/Devel/digikam-software-compilation/core/utilities/advancedrename/advancedrenameprocessdialog.cpp:208:86: warning: unused parameter ‘srcFiles’ [-Wunused-parameter] void AdvancedRenameProcessDialog::slotRenameFailed(int operation, const QList<QUrl>& srcFiles) Maik
I have now strange error messages in the console: digikam.database: No location could be retrieved for "file:///daten/Bilder/Zugang/2017-03-08/Screenshot-004.jpg" digikam.general: Video file "file:///daten/Bilder/Zugang/2017-03-08/Screenshot-004.jpg" does not exist. digikam.general: Failed to extract video thumbnail for "file:///daten/Bilder/Zugang/2017-03-08/Screenshot-004.jpg" These messages I have without the patch is not. Same files renamed. Another thing is the OK button is not activated properly when a conflict has been detected and now the checkbox is activated to move images in the trash. Maik
Created attachment 105227 [details] Add option to overwrite existing files in advance rename dialog (V3) Is there an option to make compilation fail on warnings? I can only find a switch to make it carry on, but it already does that. Regarding the ok button, I cannot reproduce the problem, it activates and disables correctly here. I will look into these weird errors (location is at least related, but video thumbnails on jpgs and raws???).
(In reply to Maik Qualmann from comment #7) > digikam.database: No location could be retrieved for > "file:///daten/Bilder/Zugang/2017-03-08/Screenshot-004.jpg" The offending part for this is: QString destFile = d->currentInfo.first.toString(QUrl::RemoveFilename) + d->currentInfo.second; // refresh thumbnail ThumbnailLoadThread::deleteThumbnail(destFile); // clean LoadingCache as well LoadingCacheInterface::fileChanged(destFile); This was previously executed before the tests in a separate function, however it should be at the exact same position regarding real actions. Commenting these lines out makes the error disappear and has not perceivable downside. Any idea what these commands are for? > digikam.general: Video file > "file:///daten/Bilder/Zugang/2017-03-08/Screenshot-004.jpg" does not exist. > > digikam.general: Failed to extract video thumbnail for > "file:///daten/Bilder/Zugang/2017-03-08/Screenshot-004.jpg" I have no idea yet what this Video business is about.
Created attachment 105276 [details] Add option to overwrite existing files in advance rename dialog (V4) Removing these two lines makes all problems (that I have) disappear. These lines were introduced in 2010 and last touched (i.e. moved around) in 2012. I don't see any reason to regenerate the thumbnail on move: The image doesn't change and e.g. copy operations don't do it either. So these lines are out of the current patch. Maik, do you still have the problem with the ok button? And if so, can you describe how to reproduce it, because I can't - thanks in advance.
A quick test: - compiling is OK - Messages in the console is OK - OK Button enabled state not. Make sure the "move to trash" checkbox ist disabled. Open renaming and have a conflict (red entries and button is disabled). Activate the checkbox now, entries not red, but the button is disabled. Maik
Thanks for testing. Can you provide more details or screenshots, I really can't observe the same: http://i.imgur.com/oLK907n.png http://i.imgur.com/QTc2muy.png
Ok, the cause is clear. Try to rename the same file with the same name. This case is not solvable, the file would be moved into the trash and can not be renamed. This case should still create a red entry or renaming should skip this file. Maik
Created attachment 105286 [details] Add option to overwrite existing files in advance rename dialog (V5) Ah right, I think that case wasn't handled before either, so I missed it. Now I introduced a new "state": Unchanged. It is signified by the filenames being in gray. These are ignored, meaning the ok button is activated, unless all files are unchanged.
Simon, I have now always red entries when I try to rename several files. Maik
Created attachment 105304 [details] Add option to overwrite existing files in advance rename dialog (V6) Shuffling code around usually causes side-effects, sorry for not testing. Now I did a fair bit of renaming and did find a small issue with auto-detected sidecar files, which is also fixed in V6.
Created attachment 105497 [details] Add option to overwrite existing files in advance rename dialog (V7) Update to master.
Simon, Maik, Mario, The next 5.6.0 is planed this Sunday. I propose to delay by 2 weeks this release to permit to generate a test AppImage including this patch (and also other recent commits from Simon), at least to see if nothing is broken through users feedback. Gilles
Yes, this is a good idea to move the release time. I do not know if it is a good thing to move the files at the conflicts in the trash. I can easily simulate a scenario, where all files from an album move in the trash and only one remains left. Perhaps it would be better to rename the files with a unique name. Maik
(In reply to caulier.gilles from comment #18) > Simon, Maik, Mario, > > The next 5.6.0 is planed this Sunday. I propose to delay by 2 weeks this > release to permit to generate a test AppImage including this patch (and also > other recent commits from Simon), at least to see if nothing is broken > through users feedback. > > Gilles Hey, I agree. I am currently quite busy with preparations for a publication. And I would like to test some scenarios and fixe some more bugs. You already pointed me to some problems.
Git commit 296632cb79d67b6166840d406182bcd71623ca6d by Maik Qualmann. Committed on 13/03/2018 at 21:45. Pushed by mqualmann into branch 'development/6.0.0'. first step to factoring the IOJob class with a IOJobData container To perform database operations only after successful file operation or to add a dialog for user intervention Related: bug 372763, bug 381625 M +125 -173 libs/database/utils/dio.cpp M +23 -31 libs/database/utils/dio.h M +1 -0 libs/iojobs/CMakeLists.txt A +219 -0 libs/iojobs/iojobdata.cpp [License: GPL (v2+)] A +91 -0 libs/iojobs/iojobdata.h [License: GPL (v2+)] M +12 -8 libs/iojobs/iojobsmanager.cpp M +10 -16 libs/iojobs/iojobsmanager.h M +22 -26 libs/iojobs/iojobsthread.cpp M +11 -22 libs/iojobs/iojobsthread.h https://commits.kde.org/digikam/296632cb79d67b6166840d406182bcd71623ca6d
Git commit 2b26c502d2f1cd9ef9fe661271df530922e6096a by Maik Qualmann. Committed on 15/03/2018 at 20:31. Pushed by mqualmann into branch 'development/6.0.0'. now we can skip the file if the renamed file name already exists Related: bug 372763 M +1 -1 libs/database/utils/dio.cpp M +0 -1 utilities/advancedrename/advancedrenamedialog.cpp M +7 -4 utilities/advancedrename/advancedrenameprocessdialog.cpp https://commits.kde.org/digikam/2b26c502d2f1cd9ef9fe661271df530922e6096a
Git commit c72fea726ea7a3051eb981a2d82757e499523940 by Maik Qualmann. Committed on 26/03/2018 at 18:03. Pushed by mqualmann into branch 'master'. add possibility to rename failed items again M +38 -13 core/app/items/digikamimageview.cpp M +38 -12 core/app/views/tableview/tableview.cpp M +12 -3 core/utilities/advancedrename/advancedrenameprocessdialog.cpp M +3 -1 core/utilities/advancedrename/advancedrenameprocessdialog.h https://commits.kde.org/digikam/c72fea726ea7a3051eb981a2d82757e499523940
Simon, Maik has work hard with iojob component with 6.0.0 code. It's the good time to review changes and to update your patch for a future integration in this release.
Git commit 83aebefea3e6dcb3c0e02060a9f9e60c11c52896 by Maik Qualmann. Committed on 13/05/2018 at 17:53. Pushed by mqualmann into branch 'master'. after a failed rename, you can rename it again or rename the images by overwriting FIXED-IN: 6.0.0 M +2 -1 NEWS M +2 -2 core/app/items/imageviewutilities.cpp M +1 -1 core/app/items/imageviewutilities.h M +11 -3 core/libs/database/utils/dio.cpp M +1 -1 core/libs/database/utils/dio.h M +12 -5 core/libs/iojobs/iojob.cpp M +11 -1 core/libs/iojobs/iojobdata.cpp M +4 -1 core/libs/iojobs/iojobdata.h M +58 -19 core/utilities/advancedrename/advancedrenameprocessdialog.cpp https://commits.kde.org/digikam/83aebefea3e6dcb3c0e02060a9f9e60c11c52896