Summary: | Restore from Trash works incorrectly | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Andrius <aegoreev> |
Component: | Database-Trash | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | caulier.gilles, johannes.hirte, mario.frank, metzpinguin |
Priority: | NOR | ||
Version: | 5.5.0 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/digikam/f528f24b54894b271a4bee44a850b1ac46c10cc9 | Version Fixed In: | 5.5.0 |
Sentry Crash Report: |
Description
Andrius
2017-02-22 18:05:07 UTC
Sometimes it renames the files the other way around. 20170201_183418_460.JPG 20170201_183418_4601.JPG instead of 20170201_183418_460.JPG 20170201_183418_460.DNG Git commit f528f24b54894b271a4bee44a850b1ac46c10cc9 by Maik Qualmann. Committed on 22/02/2017 at 22:10. Pushed by mqualmann into branch 'master'. add random string to the trash filename to prevent another thread use the filename already FIXED-IN: 5.5.0 M +2 -1 NEWS M +10 -0 libs/dtrash/dtrash.cpp https://commits.kde.org/digikam/f528f24b54894b271a4bee44a850b1ac46c10cc9 Git commit 38e1582672ddd32bef4f0dbc3750654fdd128b07 by Maik Qualmann. Committed on 23/02/2017 at 18:50. Pushed by mqualmann into branch 'master'. use QUuid to generate random string for filename M +4 -8 libs/dtrash/dtrash.cpp https://commits.kde.org/digikam/38e1582672ddd32bef4f0dbc3750654fdd128b07 This leads now to the following compile error: /var/tmp/portage/media-gfx/digikam-9999/work/digikam-9999/libs/dtrash/dtrash.cpp: In static member function ‘static QString Digikam::DTrash::getAvialableJsonFilePathInTrash(const QString&, const QString&, int)’: /var/tmp/portage/media-gfx/digikam-9999/work/digikam-9999/libs/dtrash/dtrash.cpp:222:41: error: ‘QChar::QChar(char)’ is private within this context randomString.replace(0, 1, QChar('-')); ^ In file included from /usr/include/qt5/QtCore/qstring.h:48:0, from /usr/include/qt5/QtCore/qobject.h:47, from /usr/include/qt5/QtCore/QObject:1, from /var/tmp/portage/media-gfx/digikam-9999/work/digikam-9999/libs/dtrash/dtrash.h:29, from /var/tmp/portage/media-gfx/digikam-9999/work/digikam-9999/libs/dtrash/dtrash.cpp:24: /usr/include/qt5/QtCore/qchar.h:562:5: note: declared private here QChar(char c) Q_DECL_NOTHROW; ^~~~~ make[2]: *** [libs/dtrash/CMakeFiles/dtrash_src.dir/build.make:63: libs/dtrash/CMakeFiles/dtrash_src.dir/dtrash.cpp.o] Error 1 possible fix diff --git a/libs/dtrash/dtrash.cpp b/libs/dtrash/dtrash.cpp index 7b65f3844d..4eed798c3e 100644 --- a/libs/dtrash/dtrash.cpp +++ b/libs/dtrash/dtrash.cpp @@ -219,7 +219,7 @@ QString DTrash::createJsonRecordForFile(const QString& collectionPath, const QSt QString DTrash::getAvialableJsonFilePathInTrash(const QString& collectionPath, const QString& baseName, int version) { QString randomString = QUuid::createUuid().toString(); - randomString.replace(0, 1, QChar('-')); + randomString.replace(0, 1, QChar(0x2D)); randomString.chop(1); QString pathToCreateJsonFile = collectionPath + QLatin1Char('/') + QChar::fromLatin1() should work too Git commit 2d6880ab9cc7d9d714a767ff4be090fbb8092e7d by Maik Qualmann. Committed on 24/02/2017 at 17:34. Pushed by mqualmann into branch 'master'. fix compile QChar()->QLatin1Char() M +1 -1 libs/dtrash/dtrash.cpp https://commits.kde.org/digikam/2d6880ab9cc7d9d714a767ff4be090fbb8092e7d This fug is fixed |