digikam
itemscanner_history.cpp
Go to the documentation of this file.
44 // Resolution depends on the presence of other images, possibly only when the scanning process has finished
100 CoreDbAccess().db()->addImageRelations(cloud.first, cloud.second, DatabaseRelation::DerivedFrom);
102 int needResolvingTag = TagsCache::instance()->getOrCreateInternalTag(InternalTagName::needResolvingHistory());
103 int needTaggingTag = TagsCache::instance()->getOrCreateInternalTag(InternalTagName::needTaggingHistoryGraph());
106 CoreDbAccess().db()->removeTagsFromItems(graph.allImageIds(), QList<int>() << needResolvingTag);
136 // Load relation cloud, history of info and of all leaves of the tree into the graph, fully resolved
137 ItemHistoryGraph graph = ItemHistoryGraph::fromInfo(info, ItemHistoryGraph::LoadAll, ItemHistoryGraph::NoProcessing);
140 int originalVersionTag = TagsCache::instance()->getOrCreateInternalTag(InternalTagName::originalVersion());
141 int currentVersionTag = TagsCache::instance()->getOrCreateInternalTag(InternalTagName::currentVersion());
142 int intermediateVersionTag = TagsCache::instance()->getOrCreateInternalTag(InternalTagName::intermediateVersion());
144 int needTaggingTag = TagsCache::instance()->getOrCreateInternalTag(InternalTagName::needTaggingHistoryGraph());
147 CoreDbAccess().db()->removeTagsFromItems(graph.allImageIds(), QList<int>() << originalVersionTag
197 DImageHistory ItemScanner::resolvedImageHistory(const DImageHistory& history, bool mustBeAvailable)
224 CollectionLocation location = CollectionManager::instance()->locationForAlbumRootId(info.albumRootId());
348 // Second: uniqueHash + fileSize. Sufficient to assume that a file is identical, but subject to frequent change.
351 QList<ItemScanInfo> infos = CoreDbAccess().db()->getIdenticalFiles(historyId.m_uniqueHash, historyId.m_fileSize);
359 if (info.status != DatabaseItem::Status::Trashed && info.status != DatabaseItem::Status::Obsolete)
373 QList<qlonglong> ids = CoreDbAccess().db()->findByNameAndCreationDate(historyId.m_fileName, historyId.m_creationDate);
381 // Another possibility: If the original UUID is given, we can find all relations for the image with this UUID,
Definition: coredbalbuminfo.h:275
QByteArray getUniqueHash() const
This methods return a 128-bit MD5 hex digest which is meant to uniquely identify the file...
Definition: dimg_metadata.cpp:31
static CollectionManager * instance()
Definition: collectionmanager.cpp:34
static DImageHistory resolvedImageHistory(const DImageHistory &history, bool mustBeAvailable=false)
All referred images of the given history will be resolved.
Definition: itemscanner_history.cpp:197
bool hasUnresolvedEntries() const
Returns true if for any entry no ItemInfo could be located.
Definition: itemhistorygraph.cpp:677
QPair< QList< qlonglong >, QList< qlonglong > > relationCloudParallel() const
Definition: itemhistorygraph.cpp:742
void setType(HistoryImageId::Type type)
Definition: historyimageid.cpp:48
The subject is a derivative of the object.
Definition: coredbconstants.h:115
Definition: historyimageid.h:41
QList< HistoryImageId > referredImages
Definition: dimagehistory.h:69
QByteArray getUniqueHashV2() const
This methods return a 128-bit MD5 hex digest which is meant to uniquely identify the file...
Definition: dimg_metadata.cpp:70
static bool resolveImageHistory(qlonglong id, QList< qlonglong > *needTaggingIds=nullptr)
Resolves the image history of the image id by filling the ImageRelations table for all contained refe...
Definition: itemscanner_history.cpp:68
static QList< qlonglong > mergedIdLists(const HistoryImageId &referenceId, const QList< qlonglong > &uuidList, const QList< qlonglong > &candidates)
Definition: itemscanner_history.cpp:303
static void tagItemHistoryGraph(qlonglong id)
Takes the history graph reachable from the given image, and assigns versioning tags to all entries ba...
Definition: itemscanner_history.cpp:124
QList< ItemInfo > rootImages() const
Returns image infos / ids from all root vertices in this graph, i.e.
Definition: itemhistorygraph.cpp:783
bool isNull() const
static bool uuidDoesNotDiffer(const HistoryImageId &referenceId, qlonglong id)
Definition: itemscanner_history.cpp:288
CollectionLocation locationForAlbumRootId(int id)
Returns the location for the given album root id.
Definition: collectionmanager_location.cpp:644
static QLatin1String needResolvingHistory()
Definition: coredbconstants.cpp:37
bool hasHistoryToResolve() const
Returns true if this file has been marked as needing history resolution at a later stage...
QString fromUtf8(const char *str, int size)
Definition: dimagehistory.h:52
const_iterator constEnd() const
static QLatin1String currentVersion()
Definition: coredbconstants.cpp:52
bool isEmpty() const
void commitImageHistory()
Definition: itemscanner_history.cpp:38
The original file (typically created by a camera)
Definition: historyimageid.h:51
QString album(const QUrl &fileUrl)
Returns the album part of the given file path, i.e.
Definition: collectionmanager_album.cpp:125
Definition: coredbalbuminfo.h:248
bool isEmpty() const
T & first()
QString m_filePath
The path of the referred file (NOTE: without file name!, including trailing slash) ...
Definition: historyimageid.h:164
std::vector< T > location(const std::vector< T > &shape, unsigned long idx)
requires
Definition: shapepredictor.h:109
Definition: coredbalbuminfo.h:360
The ItemInfo class contains provides access to the database for a single image.
Definition: iteminfo.h:72
bool contains(const T &value) const
QList< qlonglong > allImageIds() const
Definition: itemhistorygraph.cpp:768
QHash< ItemInfo, HistoryImageId::Types > categorize() const
Attempts at a categorization of all images in the graph into the types defined by HistoryImageId...
Definition: itemhistorygraph.cpp:793
Definition: coredbconstants.h:98
bool isValid() const
A valid id needs at least a valid type and a UUID or a filename.
Definition: historyimageid.cpp:90
const_iterator constBegin() const
static QLatin1String intermediateVersion()
Definition: coredbconstants.cpp:57
static QLatin1String needTaggingHistoryGraph()
Definition: coredbconstants.cpp:42
bool hasCreationDate() const
Definition: historyimageid.cpp:136
CollectionLocation locationForPath(const QString &filePath)
Definition: collectionmanager_location.cpp:695
static bool sameReferredImage(const HistoryImageId &id1, const HistoryImageId &id2)
Determines if the two ids refer to the same image.
Definition: itemscanner_history.cpp:245
void scanImageHistoryIfModified()
Definition: itemscanner_history.cpp:56
The CoreDbAccess provides access to the database: Create an instance of this class on the stack to re...
Definition: coredbaccess.h:54
static ItemHistoryGraph fromInfo(const ItemInfo &info, HistoryLoadingMode loadingMode=LoadAll, ProcessingMode processingMode=PrepareForDisplay)
Convenience: Reads all available history for the given info from the database and returns the created...
Definition: itemhistorygraph.cpp:511
static QLatin1String originalVersion()
Definition: coredbconstants.cpp:47
bool isAvailable() const
Definition: collectionlocation.h:118
static QList< qlonglong > resolveHistoryImageId(const HistoryImageId &historyId)
Returns all image ids fulfilling the given image id.
Definition: itemscanner_history.cpp:329
QString filePath() const
If a file on disk is referenced: Returns the full file path (folder + filename)
Definition: historyimageid.cpp:106
HistoryImageId historyImageId() const
Constructs a HistoryImageId with all available information for this image.
Definition: iteminfo.cpp:1341
bool hasUniqueHashIdentifier() const
Definition: historyimageid.cpp:146
void addScannedHistory(const DImageHistory &history, qlonglong historySubjectId)
This is very similar to addHistory.
Definition: itemhistorygraph.cpp:565
Definition: itemhistorygraph.h:45
QString path() const
If a file on disk is referenced: Returns the path, without filename, with a trailing slash...
Definition: historyimageid.cpp:101
A file created during the editing the history, between the original file and the current file...
Definition: historyimageid.h:57
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Thu Dec 12 2019 03:10:06 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2019 The KDE developers.
Generated on Thu Dec 12 2019 03:10:06 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.