Bug 207053

Summary: Replace current renaming in AlbumUI with AdvancedRename utility
Product: [Applications] digikam Reporter: Andi Clemens <andi.clemens>
Component: Albums-MainViewAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: caulier.gilles, pietras.sp
Priority: NOR    
Version: 1.0.0   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In: 1.0.0
Sentry Crash Report:
Attachments: ManualRenameDialog patch
new version against trunk
3rd update
4th update
patch against new modifier code
threaded version
tool was renamed, sync with trunk

Description Andi Clemens 2009-09-11 10:59:04 UTC
Version:           1.0.0-beta5 (using 4.3.1 (KDE 4.3.1), Arch Linux)
Compiler:          gcc
OS:                Linux (i686) release 2.6.30-ARCH

Renaming in digiKam is not very intuitive at the moment.
To rename multiple files, you either need to

a) use the KIPI Batchplugins (not very powerful for renaming)
b) use BQM 

The problem with b) is that you need to copy the files to a new target folder first (and apply some batch tool, otherwise BQM doesn't start).
This problem can be solved with a dedicated RenameTool for BQM, which will be another bugreport.

The general renaming issue could be fixed with a renaming dialog based on the ManualRename utility, that is used in CameraUI and BQM now.
It is capable of adding a lot of information to the filename, like metadata etc.

I will provide a patch in this bugreport that will make use of a ManualRenameDialog widget, that can replace the current renaming method in AlbumUI.

The only problem at the moment is that it is very slow, I guess because every rename action will create a separate kio_file process.

Gilles, Marcel,

any idea how to make this faster?
If you use the patch, PLEASE test it only with a few images, not 3000 files or so :-)

I think this feature is quite important, because renaming with BQM only is confusing, especially for new users (and at the moment renaming actually isn't working anyway, it is more a copy action that also requires at least one assigned tool).

Andi
Comment 1 Andi Clemens 2009-09-11 11:00:44 UTC
Created attachment 36864 [details]
ManualRenameDialog patch

This patch will enable the ManualRenameDialog for AlbumUI
Comment 2 caulier.gilles 2009-09-11 12:06:27 UTC
Andi,

I'm agree. Thsi feature is very important !

Do you use DIO method from digiKam core, to rename file, or kio_file process ?

Gilles
Comment 3 Andi Clemens 2009-09-11 12:39:27 UTC
DIO (actually I just call the old rename method: ImageViewUtilities::rename()), I only added a second parameter 'newName' to the method.
Comment 4 Andi Clemens 2009-09-11 18:51:03 UTC
Created attachment 36873 [details]
new version against trunk

New version of the patch, since trunk changed the way parsing is done.
Please note that you need to disable the building of tests at the moment, because ManualRename will not link against digikamcore anymore (I still don't understand why).
Comment 5 Andi Clemens 2009-09-12 17:33:10 UTC
Created attachment 36904 [details]
3rd update

update against trunk
Comment 6 Andi Clemens 2009-09-13 11:46:54 UTC
Created attachment 36916 [details]
4th update

sync with trunk, a lot changed in there so patch needs some love :)
No new features so far, still the old problem with slow renaming.
Comment 7 Andi Clemens 2009-09-13 15:28:47 UTC
I just played with renaming in AlbumUI again.
When I rename 88 images with this patch, I get 83 kio_digikamalbums slaves that are not closed as long as digiKam is running.
Something is going terribly wrong here.

Do I need to do renaming in a different way then by just calling DIO::move()?
Comment 8 Andi Clemens 2009-09-13 15:29:24 UTC
DIO::rename I mean of course
Comment 9 Andi Clemens 2009-09-13 15:32:51 UTC
Just realized something else: I also have 64 kio_file slaves open, and they don't close even digiKam is shut down.
I can only kill them by hand.

Calling DIO::rename() multiple times doesn't seem to be the right way.
I know there is a move() method for multiple files, the problem is that it has a single target, so it is not suitable for renaming tasks.
Comment 10 Andi Clemens 2009-09-15 12:27:38 UTC
Created attachment 36970 [details]
patch against new modifier code

sync with trunk
Comment 11 caulier.gilles 2009-09-15 13:03:00 UTC
Looking in your patch, how do you process files renaming in background ? 

Why not to use a separate thread running KDE::rename() trough a queued list of items to process one by one ?

Gilles
Comment 12 Andi Clemens 2009-09-15 13:18:11 UTC
Oh, never had a look at KDE::rename. I will check this later.
Comment 13 caulier.gilles 2009-09-15 13:25:32 UTC
Image Editor already use it. Look there :

http://lxr.kde.org/source/extragear/graphics/digikam/utilities/imageeditor/editor
/editorwindow.cpp#1762

Gilles
Comment 14 Andi Clemens 2009-09-16 19:00:27 UTC
Created attachment 36998 [details]
threaded version

I added a thread but I'm not sure if I use it correctly, never done this before.
Could you please take a look at
RenameThread() and its interaction with ImageViewUtilities()?

Andi
Comment 15 Andi Clemens 2009-09-18 18:12:17 UTC
Created attachment 37041 [details]
tool was renamed, sync with trunk
Comment 16 Bartek Pietrasiak 2009-09-29 10:40:25 UTC
One remark. I would be nice if the same renamame dialog would be used during import from camera. I can remember that in 0.9 the rename during import was not able to handle my simple pattern so I had to do this after import with normal digikam rename.
Comment 17 Andi Clemens 2009-09-29 10:44:10 UTC
The new renaming tool is used in CameraUI (import) and BQM (Batch Queue Manager) for months :-)
It was not used in the main application due to threading problems (that in some way still exist, but at least renaming is working now).
Comment 18 Andi Clemens 2009-09-29 10:45:37 UTC
Since I committed everything (and only some minor tweaks have to be made), I will close this wish now.
Comment 19 caulier.gilles 2009-09-29 10:58:22 UTC
Andi,

Let's me hear when Renaming tool will be ready to use in Album GUI, to prepare 1.0.0-beta5 tarball.

Gilles