[digikam] [Bug 384820] Allow matching library paths across different operating systems?
https://bugs.kde.org/show_bug.cgi?id=384820 Maik Qualmann changed: What|Removed |Added Version Fixed In||8.0.0 Status|REPORTED|RESOLVED Latest Commit||https://invent.kde.org/grap ||hics/digikam/commit/6a630ae ||ab30849225015826aa185cc8a85 ||16cc74 Resolution|--- |FIXED --- Comment #8 from Maik Qualmann --- Git commit 6a630aeab30849225015826aa185cc8a8516cc74 by Maik Qualmann. Committed on 16/07/2022 at 15:14. Pushed by mqualmann into branch 'master'. add support for alternate network paths in the collection view Related: bug 456749 FIXED-IN: 8.0.0 M +3-1NEWS M +4-0core/libs/database/collection/collectionlocation.h M +6-3core/libs/database/collection/collectionmanager.h M +5-3core/libs/database/collection/collectionmanager_location.cpp M +7-2core/libs/database/collection/collectionmanager_p.cpp M +2-3core/libs/database/collection/collectionmanager_p.h M +206 -17 core/utilities/setup/collections/setupcollectionview.cpp M +21 -8core/utilities/setup/collections/setupcollectionview.h https://invent.kde.org/graphics/digikam/commit/6a630aeab30849225015826aa185cc8a8516cc74 -- You are receiving this mail because: You are watching all bug changes.
[digikam] [Bug 384820] Allow matching library paths across different operating systems?
https://bugs.kde.org/show_bug.cgi?id=384820 Maik Qualmann changed: What|Removed |Added Summary|Allow matching library |Allow matching library |paths across different |paths across different |operating systems? [patch] |operating systems? -- You are receiving this mail because: You are watching all bug changes.
[digikam] [Bug 384820] Allow matching library paths across different operating systems? [patch]
https://bugs.kde.org/show_bug.cgi?id=384820 Maik Qualmann changed: What|Removed |Added Attachment #117218|0 |1 is obsolete|| --- Comment #7 from Maik Qualmann --- Comment on attachment 117218 --> https://bugs.kde.org/attachment.cgi?id=117218 multiOSAlbumRoots.patch >diff --git a/core/libs/database/coredb/coredb.cpp >b/core/libs/database/coredb/coredb.cpp >index 227a1ce63c..153c4125ec 100644 >--- a/core/libs/database/coredb/coredb.cpp >+++ b/core/libs/database/coredb/coredb.cpp >@@ -53,6 +53,7 @@ extern "C" > > // Local includes > >+#include "digikam_config.h" > #include "digikam_debug.h" > #include "coredbbackend.h" > #include "collectionmanager.h" >@@ -61,6 +62,14 @@ extern "C" > #include "tagscache.h" > #include "album.h" > >+#ifdef Q_OS_WIN >+static const char* DK_CURRENT_OS = "WIN:"; >+#elif defined Q_OS_OSX >+static const char* DK_CURRENT_OS = "OSX:"; >+#else >+static const char* DK_CURRENT_OS = "LNX:"; >+#endif >+ > namespace Digikam > { > >@@ -191,9 +200,9 @@ QList CoreDB::getAlbumRoots() > ++it; > info.type = (AlbumRoot::Type)(*it).toInt(); > ++it; >-info.identifier = (*it).toString(); >+info.identifier = decodeOSString((*it).toString()); > ++it; >-info.specificPath = (*it).toString(); >+info.specificPath = decodeOSString((*it).toString()); > ++it; > > list << info; >@@ -205,9 +214,14 @@ QList CoreDB::getAlbumRoots() > int CoreDB::addAlbumRoot(AlbumRoot::Type type, const QString& identifier, > const QString& specificPath, const QString& label) > { > QVariant id; >+QString osIdentifier = identifier; >+QString osSpecificPath = specificPath; >+osIdentifier.prepend(QLatin1String(DK_CURRENT_OS)); >+osSpecificPath.prepend(QLatin1String(DK_CURRENT_OS)); >+ > d->db->execSql(QString::fromUtf8("REPLACE INTO AlbumRoots (type, label, > status, identifier, specificPath) " > "VALUES(?, ?, 0, ?, ?);"), >- (int)type, label, identifier, specificPath, 0, ); >+ (int)type, label, osIdentifier, osSpecificPath, 0, ); > > d->db->recordChangeset(AlbumRootChangeset(id.toInt(), > AlbumRootChangeset::Added)); > return id.toInt(); >@@ -230,8 +244,14 @@ void CoreDB::deleteAlbumRoot(int rootId) > > void CoreDB::migrateAlbumRoot(int rootId, const QString& identifier) > { >+QList values; >+ >+d->db->execSql(QString::fromUtf8("SELECT identifier FROM AlbumRoots " >+ "WHERE id=?;"), >+ rootId, ); >+ > d->db->execSql(QString::fromUtf8("UPDATE AlbumRoots SET identifier=? > WHERE id=?;"), >- identifier, rootId); >+ encodeOSString(values, identifier), rootId); > d->db->recordChangeset(AlbumRootChangeset(rootId, > AlbumRootChangeset::PropertiesChanged)); > } > >@@ -251,8 +271,14 @@ void CoreDB::changeAlbumRootType(int rootId, >AlbumRoot::Type newType) > > void CoreDB::setAlbumRootPath(int rootId, const QString& newPath) > { >+QList values; >+ >+d->db->execSql(QString::fromUtf8("SELECT specificPath FROM AlbumRoots " >+ "WHERE id=?;"), >+ rootId, ); >+ > d->db->execSql(QString::fromUtf8("UPDATE AlbumRoots SET specificPath=? > WHERE id=?;"), >- newPath, rootId); >+ encodeOSString(values, newPath), rootId); > d->db->recordChangeset(AlbumRootChangeset(rootId, > AlbumRootChangeset::PropertiesChanged)); > } > >@@ -5029,4 +5055,49 @@ void CoreDB::writeSettings() > group.writeEntry(d->configRecentlyUsedTags, d->recentlyAssignedTags); > } > >+QString CoreDB::decodeOSString(const QString& str) >+{ >+QStringList list = str.split(QLatin1Char(';')); >+QString osString = str; >+ >+foreach (const QString& s, list) >+{ >+if (s.startsWith(QLatin1String(DK_CURRENT_OS))) >+{ >+osString = s.mid(4); >+break; >+} >+} >+ >+return osString; >+} >+ >+QString CoreDB::encodeOSString(const QList& values, const QString& >str) >+{ >+QString osString; >+ >+if (values.size() == 1) >+{ >+QStringList list = values.first().toString().split(QLatin1Char(';')); >+ >+foreach (const QString& s, list) >+{ >+if (s.startsWith(QLatin1String(DK_CURRENT_OS)) || s == str) >+{ >+continue; >+} >+ >+osString.append(s).append(QLatin1Char(';')); >+} >+ >+osString.append(QLatin1String(DK_CURRENT_OS)).append(str); >+} >+else >+{ >+osString = str; >+} >+ >+return osString; >+} >+ > } // namespace Digikam >diff --git a/core/libs/database/coredb/coredb.h
[digikam] [Bug 384820] Allow matching library paths across different operating systems? [patch]
https://bugs.kde.org/show_bug.cgi?id=384820 Maik Qualmann changed: What|Removed |Added CC||spam-recei...@web.de --- Comment #6 from Maik Qualmann --- *** Bug 456749 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
[digikam] [Bug 384820] Allow matching library paths across different operating systems? [patch]
https://bugs.kde.org/show_bug.cgi?id=384820 --- Comment #5 from caulier.gil...@gmail.com --- Hi Maik, what's the plan for this patch ? Gilles -- You are receiving this mail because: You are watching all bug changes.
[digikam] [Bug 384820] Allow matching library paths across different operating systems? [patch]
https://bugs.kde.org/show_bug.cgi?id=384820 --- Comment #4 from Maik Qualmann --- Yes, the function has no problems with existing "old" entries. But I will update the patch again. Maik -- You are receiving this mail because: You are watching all bug changes.
[digikam] [Bug 384820] Allow matching library paths across different operating systems? [patch]
https://bugs.kde.org/show_bug.cgi?id=384820 --- Comment #3 from caulier.gil...@gmail.com --- Maik, How you patch preserve the compatibility with previous collections recorded in database. A migration is done after to apply the patch and run digiKam ? Gilles -- You are receiving this mail because: You are watching all bug changes.
[digikam] [Bug 384820] Allow matching library paths across different operating systems? [patch]
https://bugs.kde.org/show_bug.cgi?id=384820 Maik Qualmann changed: What|Removed |Added Summary|Allow matching library |Allow matching library |paths across different |paths across different |operating systems? |operating systems? [patch] -- You are receiving this mail because: You are watching all bug changes.
[digikam] [Bug 384820] Allow matching library paths across different operating systems?
https://bugs.kde.org/show_bug.cgi?id=384820 Maik Qualmann changed: What|Removed |Added CC||metzping...@gmail.com --- Comment #2 from Maik Qualmann --- Created attachment 117218 --> https://bugs.kde.org/attachment.cgi?id=117218=edit multiOSAlbumRoots.patch This patch solves the problem. The database columns "identifier" and "specificPath" become a string list. A new path can be defined under the respective operating system with the new collection update function. It would be nice if someone could test the patch. Maik -- You are receiving this mail because: You are watching all bug changes.
[digikam] [Bug 384820] Allow matching library paths across different operating systems?
https://bugs.kde.org/show_bug.cgi?id=384820 Nurullin Rustem changed: What|Removed |Added CC||nrv9...@yandex.ru --- Comment #1 from Nurullin Rustem --- I also get this bug.. unrealised functionality. If you add collection from one machine, and add that collection (with such name) from another, digikam understand this as 2 different collection and scan twice (also metadata will not synchronize if it not stored in EXIF). Looking at db structure, I see that collections identifier is full path, that different on Windows and Linux, it can be different on two Windows machines. But presents column "specificPath". I do next thing: MariaDB [digikam]> select * from AlbumRoots; ++---++--++---+ | id | label | status | type | identifier | specificPath | ++---++--++---+ | 8 | disc | 0 |3 | networkshareid:?mountpath=Pictures | //bananapi/disc/ | | 9 | disc | 0 |3 | networkshareid:?mountpath=Pictures | /run/user/1000/gvfs/smb-share:server=bananapi,share=disc/ | ++---++--++--- So identifiers are same. I hoped, that digikam will concat it (specificPath + mountpath). It didn't. It not see my collection. -- You are receiving this mail because: You are watching all bug changes.
[digikam] [Bug 384820] Allow matching library paths across different operating systems?
https://bugs.kde.org/show_bug.cgi?id=384820 caulier.gil...@gmail.com changed: What|Removed |Added Version|unspecified |5.7.0 CC||caulier.gil...@gmail.com -- You are receiving this mail because: You are watching all bug changes.