Bug 207053 - Replace current renaming in AlbumUI with AdvancedRename utility
Summary: Replace current renaming in AlbumUI with AdvancedRename utility
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Albums-MainView (show other bugs)
Version: 1.0.0
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-11 10:59 UTC by Andi Clemens
Modified: 2012-06-27 11:07 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 1.0.0


Attachments
ManualRenameDialog patch (17.53 KB, patch)
2009-09-11 11:00 UTC, Andi Clemens
Details
new version against trunk (16.38 KB, patch)
2009-09-11 18:51 UTC, Andi Clemens
Details
3rd update (16.42 KB, patch)
2009-09-12 17:33 UTC, Andi Clemens
Details
4th update (15.54 KB, patch)
2009-09-13 11:46 UTC, Andi Clemens
Details
patch against new modifier code (15.93 KB, patch)
2009-09-15 12:27 UTC, Andi Clemens
Details
threaded version (95.80 KB, patch)
2009-09-16 19:00 UTC, Andi Clemens
Details
tool was renamed, sync with trunk (23.99 KB, patch)
2009-09-18 18:12 UTC, Andi Clemens
Details

Note You need to log in before you can comment on or make changes to this bug.
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