digiKam
Digikam::CollectionImageChangeset Class Reference

Public Types

enum  Operation {
  Unknown , Added , Removed , RemovedAll ,
  Deleted , RemovedDeleted , Moved , Copied
}
 

Public Member Functions

QList< int > albums () const
 
 CollectionImageChangeset ()
 
 CollectionImageChangeset (const QList< qlonglong > &ids, const QList< int > &albums, Operation operation)
 
 CollectionImageChangeset (const QList< qlonglong > &ids, int album, Operation operation)
 
 CollectionImageChangeset (qlonglong id, int album, Operation operation)
 
bool containsAlbum (int id) const
 
bool containsImage (qlonglong id) const
 
QList< qlonglong > ids () const
 
Operation operation () const
 
CollectionImageChangesetoperator<< (const CollectionImageChangeset &other)
 

Member Enumeration Documentation

◆ Operation

Enumerator
Unknown 
Added 

"Added" indicates that images have been added to albums.

Removed 

"Removed" indicates that an image has been removed from the given album, and has possibly set a status of Removed and a null Album (though this can already have changed to valid values), but the image-specific tables have not been removed.

RemovedAll 

"RemovedAll" indicates that for all entries in the specified album, the "Removed" operation has been carried out. This is equivalent to a "Removed" changesets with all image ids in the list, but for RemovedAll, the list may not be explicitly given (may be empty).

Deleted 

"Deleted" indicates that the image-specific tables have been removed from the database. While "Removed" means all data is still there, though possibly not accessible from an album, this means all data has been irreversibly deleted.

RemovedDeleted 

Special combination: Images which has the "Removed" status have now been "Delete"d. A changeset with Removed or RemovedAll is guaranteed to have been sent anytime before. Image ids nor albums ids may or may be not available in any combination.

Moved 

Images have been moved. This is extra information; a Removed and then an Added changeset are guaranteed to be sent subsequently. Album is the source album.

Copied 

Images have been copied. This is extra information; an Added changeset is guaranteed to be sent subsequently. Album is the source album.

Constructor & Destructor Documentation

◆ CollectionImageChangeset() [1/4]

Digikam::CollectionImageChangeset::CollectionImageChangeset ( )

An CollectionImageChangeset covers adding and removing an image to/from the collection. It is described by a list of affected image ids, a list of affected albums, and an operation. Special Case "RemovedAll": If all images have been removed from an album, operation is RemovedAll, the album list contains the (now empty) albums, ids() is empty, but containsImage() always returns true. Special Case "RemovedDeleted": Images with the "Removed" status are now irreversibly deleted. ids() and/or albums() may be empty (this means information is not available).

References Digikam::Unknown.

◆ CollectionImageChangeset() [2/4]

Digikam::CollectionImageChangeset::CollectionImageChangeset ( const QList< qlonglong > &  ids,
const QList< int > &  albums,
Operation  operation 
)

◆ CollectionImageChangeset() [3/4]

Digikam::CollectionImageChangeset::CollectionImageChangeset ( const QList< qlonglong > &  ids,
int  album,
Operation  operation 
)

◆ CollectionImageChangeset() [4/4]

Digikam::CollectionImageChangeset::CollectionImageChangeset ( qlonglong  id,
int  album,
Operation  operation 
)

Member Function Documentation

◆ albums()

QList< int > Digikam::CollectionImageChangeset::albums ( ) const

◆ containsAlbum()

bool Digikam::CollectionImageChangeset::containsAlbum ( int  id) const

◆ containsImage()

bool Digikam::CollectionImageChangeset::containsImage ( qlonglong  id) const

References RemovedAll.

◆ ids()

QList< qlonglong > Digikam::CollectionImageChangeset::ids ( ) const

Specification of this changeset. All special cases where the returned list may be empty are noted above. The lists are valid unless such a case is explicitly mentioned.

Referenced by Digikam::ItemListModel::slotCollectionImageChange(), and Digikam::ItemAlbumModel::slotCollectionImageChange().

◆ operation()

◆ operator<<()

CollectionImageChangeset & Digikam::CollectionImageChangeset::operator<< ( const CollectionImageChangeset other)

Combines two CollectionImageChangesets. The operations shall not differ between the two sets; the operation is set to Unknown if it differs. This is especially not suitable for RemovedAll changesets.

References Unknown.


The documentation for this class was generated from the following files: