Bug 342996 - Corrections for rename settings in images import [patch]
Summary: Corrections for rename settings in images import [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: AdvancedRename-Import (show other bugs)
Version: 4.6.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-18 12:09 UTC by Maik Qualmann
Modified: 2017-08-16 05:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.7.0
Sentry Crash Report:


Attachments
importrename.patch (7.84 KB, patch)
2015-01-18 12:10 UTC, Maik Qualmann
Details
importrename2.patch (8.23 KB, patch)
2015-01-25 09:20 UTC, Maik Qualmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maik Qualmann 2015-01-18 12:09:26 UTC
-Better update the name in the icon view.
-This patch should close the bugs 342430 and 314441.
-Rename with metadata now work when a UMS-Drive is used.
-Conversion in lossless format and change the extension will be considered.

Reproducible: Always
Comment 1 Maik Qualmann 2015-01-18 12:10:03 UTC
Created attachment 90492 [details]
importrename.patch
Comment 2 Maik Qualmann 2015-01-21 12:14:43 UTC
I think I will add a wait cursor. The renaming of hundreds of images with metadata can take a moment.

Maik
Comment 3 caulier.gilles 2015-01-21 13:44:19 UTC
yes wait cursor is fine to use here...

Gilles
Comment 4 Teemu Rytilahti 2015-01-22 15:14:10 UTC
Wait cursor when setting the new name to the items, right? Just read the patch but didn't test it, nevertheless it looks good :)
Comment 5 Maik Qualmann 2015-01-22 20:57:42 UTC
I think rename with metadata in this patch to remove for digikam 4.7.0. For each change of about 800 images from an SD card, needs the renaming with metadata about 10-15 seconds. It needs optimization.
Comment 6 caulier.gilles 2015-01-22 21:57:12 UTC
The rename operation is not performed through a separated thread with cameracontroller ?

What's about to use progressbar for long operation as renaming ?

Gilles
Comment 7 caulier.gilles 2015-01-24 09:28:04 UTC
Maik,

Did you finalize your patch for 4.7.0 planed this Sunday evening ?

Gilles
Comment 8 Maik Qualmann 2015-01-24 11:57:17 UTC
Gilles,

Yes I create to Sunday a new patch. For the time being without renaming with metadata.
My idea is to add a metadata cache for advanced renaming. To reduce file access.

Maik
Comment 9 caulier.gilles 2015-01-24 12:00:05 UTC
Do you want to delay this patch inclusion for 4.8.0 release ?

Gilles
Comment 10 Maik Qualmann 2015-01-25 09:20:05 UTC
Created attachment 90637 [details]
importrename2.patch

Better updating the name in icon view, without moving the mouse over the icon view.
Converting jpg in a lossless format and renaming the extensions work now.
Code for renaming without function has removed.
Comment 11 caulier.gilles 2015-01-25 11:43:07 UTC
Git commit 7f3459d55dd453f257ece35398175bba22ea4109 by Gilles Caulier.
Committed on 25/01/2015 at 11:39.
Pushed by cgilles into branch 'master'.

Apply patch #90637 from Maik Qualmann to fix image renaming settings rules in Import Tool to work properly while downloading.
Related: bug 314441, bug 329438, bug 307253, bug 342430
FIXED-IN: 4.7.0

M  +3    -1    NEWS
M  +2    -2    utilities/importui/backend/cameracontroller.cpp
M  +67   -44   utilities/importui/main/importui.cpp
M  +1    -0    utilities/importui/main/importui.h
M  +5    -0    utilities/importui/views/importview.cpp
M  +1    -0    utilities/importui/views/importview.h

http://commits.kde.org/digikam/7f3459d55dd453f257ece35398175bba22ea4109
Comment 12 caulier.gilles 2015-01-25 11:46:38 UTC
Maik,

Patch is apply to git/master now and file closed.

There are few others entries where dysfunctions have been detected by end-users about renaming features in Import tool :

* bug 314441: closed now with this commit because this entry is supposed to be relevant of it.

* bug 329438 : still open. Please review if file still valid.
* bug 307253 : still open. Please review if file still valid.
* bug 342430 : still open. Please review if file still valid.

Gilles
Comment 13 caulier.gilles 2015-01-25 14:01:05 UTC
Git commit 0201e6fc8549ac849029daf36eaeadd6ebb4d4ae by Gilles Caulier.
Committed on 25/01/2015 at 13:58.
Pushed by cgilles into branch 'frameworks'.

Backport commit #7f3459d55dd453f257ece35398175bba22ea4109 from git/master to frameworks branch.
Related: bug 314441, bug 329438, bug 307253, bug 342430

M  +3    -3    utilities/importui/backend/cameracontroller.cpp
M  +74   -50   utilities/importui/main/importui.cpp
M  +1    -0    utilities/importui/main/importui.h
M  +5    -0    utilities/importui/views/importview.cpp
M  +1    -0    utilities/importui/views/importview.h

http://commits.kde.org/digikam/0201e6fc8549ac849029daf36eaeadd6ebb4d4ae
Comment 14 caulier.gilles 2015-01-25 14:04:06 UTC
Maik,

Just an important notice :

In frameworks branch dedicated to port digiKam to KF5, KUrl have been replaced by QUrl.

The simple backport as weel of your patch said :

[ 63%] Building CXX object core/utilities/importui/CMakeFiles/importui.dir/main/importui.cpp.o
/home/gilles/Devel/KF5/dk-sc/core/utilities/importui/main/importui.cpp: In member function ‘void Digikam::ImportUI::slotNewSelection(bool)’:
/home/gilles/Devel/KF5/dk-sc/core/utilities/importui/main/importui.cpp:2301:36: error: no match for ‘operator=’ (operand types are ‘QUrl’ and ‘QString’)
         parseSettings.fileUrl      = info.name;
                                    ^
/home/gilles/Devel/KF5/dk-sc/core/utilities/importui/main/importui.cpp:2301:36: note: candidates are:
In file included from /usr/lib64/qt5/include/QtGui/qevent.h:48:0,
                 from /usr/lib64/qt5/include/QtGui/QKeyEvent:1,
                 from /home/gilles/Devel/KF5/dk-sc/core/utilities/importui/main/importui.h:35,
                 from /home/gilles/Devel/KF5/dk-sc/core/utilities/importui/main/importui.cpp:28:
/usr/lib64/qt5/include/QtCore/qurl.h:168:11: note: QUrl& QUrl::operator=(const QUrl&)
     QUrl &operator =(const QUrl &copy);
           ^
/usr/lib64/qt5/include/QtCore/qurl.h:168:11: note:   no known conversion for argument 1 from ‘QString’ to ‘const QUrl&’
/usr/lib64/qt5/include/QtCore/qurl.h:178:18: note: QUrl& QUrl::operator=(QUrl&&)
     inline QUrl &operator=(QUrl &&other)
                  ^
/usr/lib64/qt5/include/QtCore/qurl.h:178:18: note:   no known conversion for argument 1 from ‘QString’ to ‘QUrl&&’
core/utilities/importui/CMakeFiles/importui.dir/build.make:997: recipe for target 'core/utilities/importui/CMakeFiles/importui.dir/main/importui.cpp.o' failed
make[2]: *** [core/utilities/importui/CMakeFiles/importui.dir/main/importui.cpp.o] Error 1
CMakeFiles/Makefile2:2040: recipe for target 'core/utilities/importui/CMakeFiles/importui.dir/all' failed
make[1]: *** [core/utilities/importui/CMakeFiles/importui.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2

... at this line :

    foreach(CamItemInfo info, list)
    {
        ParseSettings parseSettings;

        parseSettings.fileUrl = info.name;   <<<<<<<<<<<<<<<<<< HERE
        parseSettings.creationTime       = info.ctime;
        renameFiles.append(parseSettings);
    }

That i converted like this in commit :

parseSettings.fileUrl.fileName() = info.name;    // TODO : Qt5 port : check if KUrl() == QString() replacement is valid here. 

I don't check if it work. At least it compile.

Gilles