Bug 358144

Summary: moving images with special characters in the file name does not work
Product: [Applications] digikam Reporter: Thomas Eschenbacher <Thomas.Eschenbacher>
Component: Albums-MainViewAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: metzpinguin
Priority: NOR    
Version: 5.0.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.0.0
Sentry Crash Report:

Description Thomas Eschenbacher 2016-01-17 21:18:55 UTC
image files that contain special characters in the file name cannot be moved

Reproducible: Always

Steps to Reproduce:
1. within one album, store an image with a special character (or rename on the shell), for example "Picture(1).jpg"
2. try to drag&drop it into another location

Actual Results:  
nothing happens, the file is not moved, the drag&drop operation just does nothing, no debug or error message visible on the console.


This sounds related to bug #355256, but I guess it is a different cause, in my case I have file names with only "(number)" at the end and only ASCII characters, so it does not look like an UTF-8 encoding issue. When I rename the files manually on the console, so that they contain no brackets anymore, I can move them as expected, so there is not problem with permissions or so. I also cross-checked and renamed a file back, to "Picture(1).jpg" and it was no longer movable. AFAIR it is not drag&drop specific, also cut&paste does not work.

BTW: the thumbnail engine seems to have no problem with these files, thumbnails are shown
Comment 1 Maik Qualmann 2016-01-18 19:19:43 UTC
Git commit aa0fa10634ca971fc6ba8bd2243b32c5a059a938 by Maik Qualmann.
Committed on 18/01/2016 at 19:16.
Pushed by mqualmann into branch 'master'.

error messages from IOJob displayed with DNotificationWrapper

M  +1    -0    libs/database/CMakeLists.txt
M  +11   -2    libs/database/utils/dio.cpp
M  +0    -1    libs/iojobs/CMakeLists.txt
M  +8    -14   libs/iojobs/iojob.cpp
M  +0    -2    libs/iojobs/iojobsthread.cpp

http://commits.kde.org/digikam/aa0fa10634ca971fc6ba8bd2243b32c5a059a938
Comment 2 Maik Qualmann 2016-01-18 19:24:49 UTC
The problem is here not to reproduce. Try the latest git commit. Error messages of file operations was not displayed. Is an error message displayed?

Maik
Comment 3 Thomas Eschenbacher 2016-01-18 21:07:13 UTC
Interesting... after this patch I can see what was really wrong: there already are files with the same name! This was not obvious because file names were not shown in the Album view and no trace of an error message came out (before your latest commit).

In such a case, where the target file already exists, I would expect a dialog that shows both images as a thumbnail and offers the possibilities to overwrite, skip ore rename the image, just as Dolphin does...

Now I moved the images per Dolphin (and renamed them), switched back to digikam, and deleted the sub folder, which was empty now. The result was that digikam crashed with this assertion:

QMetaObject::indexOfSignal: signal finished() from Digikam::ActionThreadBase redefined in Digikam::DBJobsThread
QMetaObject::indexOfSignal: signal finished() from Digikam::ActionThreadBase redefined in Digikam::DBJobsThread
digikam.general: Action Thread run  1  new jobs
digikam.general: Data From DBJobsThread is null:  true
digikam.general: Cancel Main Thread
digikam.general: One job is done
digikam.general: Using  4  CPU core to run threads
QMetaObject::indexOfSignal: signal finished() from Digikam::ActionThreadBase redefined in Digikam::DBJobsThread
QMetaObject::indexOfSignal: signal finished() from Digikam::ActionThreadBase redefined in Digikam::DBJobsThread
digikam.general: Action Thread run  1  new jobs
digikam.general: One job is done
digikam.general: Using  4  CPU core to run threads
QMetaObject::indexOfSignal: signal finished() from Digikam::ActionThreadBase redefined in Digikam::IOJobsThread
digikam.general: Action Thread run  1  new jobs
digikam.iojob: DELETING:  "/home/user/Bilder/Z600/Z600/"  <====== here the folder seems to be deleted
FILE EXISTS?  true 
IS TO TRASH?  true
digikam.iojob: Thread Finished
digikam.general: One job is done
digikam.general: QFileSystemWatcher detected change at "/home/user/Bilder/Z600/Z600/"
digikam.general: Detected change, triggering rescan of directory "/home/user/Bilder/Z600/Z600"
digikam.general: QFileSystemWatcher detected change at "/home/user/Bilder/Z600/"
digikam.general: Detected change, triggering rescan of directory "/home/user/Bilder/Z600/"
digikam.database: Starting scan!
digikam.database: Removed items: () related items: ()
digikam.database: Folder does not exist or is not readable:  "/home/user/Bilder/Z600/Z600"   <======== yes, see above, I deleted it
digikam.general: Using  4  CPU core to run threads
QMetaObject::indexOfSignal: signal finished() from Digikam::ActionThreadBase redefined in Digikam::DBJobsThread
QMetaObject::indexOfSignal: signal finished() from Digikam::ActionThreadBase redefined in Digikam::DBJobsThread
digikam.general: Action Thread run  1  new jobs
ASSERT failure in QList::erase: "The specified iterator argument 'it' is invalid", file /usr/include/qt5/QtCore/qlist.h, line 499
Comment 4 Maik Qualmann 2016-01-18 21:22:52 UTC
Can you create a gdb backtrace?

Maik
Comment 5 Maik Qualmann 2016-02-08 20:52:45 UTC
Git commit 00cd3173c8354c4b65898968383140801e75139b by Maik Qualmann.
Committed on 07/02/2016 at 19:38.
Pushed by mqualmann into branch 'master'.

fix possible crashes from DBJobs
FIXED-IN: 5.0.0

M  +2    -1    NEWS
M  +17   -0    libs/album/albummanager.cpp

http://commits.kde.org/digikam/00cd3173c8354c4b65898968383140801e75139b
Comment 6 Maik Qualmann 2016-02-08 20:53:26 UTC
I close the bug report. I think the crash is resolved with the last commit. If necessary please re-open it.

Maik