digiKam
Digikam::AlbumManager Class Reference
+ Inheritance diagram for Digikam::AlbumManager:

Classes

class  Private
 

Public Member Functions

void cleanUp ()
 
bool isShowingOnlyAvailableAlbums () const
 
void prepareItemCounts ()
 
void refresh ()
 
void setShowOnlyAvailableAlbums (bool onlyAvailable)
 
void startScan ()
 

Static Public Member Functions

static AlbumManagerinstance ()
 

Operations on Face Album

class AlbumManagerCreator
 
template<class T >
class AlbumPointer
 
class Album
 
QMap< int, int > getFaceCount () const
 
QMap< int, int > getUnconfirmedFaceCount () const
 
void signalFaceCountsDirty (const QMap< int, int > &faceCount, const QMap< int, int > &uFaceCount, const QList< int > &toUpdatedFaces)
 

Operations with database

static void checkDatabaseDirsAfterFirstRun (const QString &dbPath, const QString &albumPath)
 
bool setDatabase (const DbEngineParameters &params, bool priority, const QString &suggestedAlbumRoot=QString())
 
void changeDatabase (const DbEngineParameters &params)
 
bool databaseEqual (const DbEngineParameters &parameters) const
 
void addFakeConnection ()
 
void removeFakeConnection ()
 

Operations on generic Album

void setCurrentAlbums (const QList< Album * > &albums)
 
AlbumList currentAlbums () const
 
void clearCurrentAlbums ()
 
AlbumfindAlbum (int gid) const
 
AlbumfindAlbum (Album::Type type, int id) const
 
QHash< int, QString > albumTitles () const
 
bool isMovingAlbum (Album *album) const
 
qlonglong getItemFromAlbum (Album *const album, const QString &fileName)
 
void signalAlbumAboutToBeAdded (Album *album, Album *parent, Album *prev)
 
void signalAlbumAdded (Album *album)
 
void signalAlbumAboutToBeDeleted (Album *album)
 
void signalAlbumDeleted (Album *album)
 
void signalAlbumHasBeenDeleted (quintptr)
 
void signalAlbumsCleared ()
 
void signalAlbumCurrentChanged (const QList< Album * > &albums)
 
void signalAllAlbumsLoaded ()
 
void signalAlbumIconChanged (Album *album)
 
void signalAlbumRenamed (Album *album)
 
void signalAlbumNewPath (Album *album)
 
void signalAlbumAboutToBeMoved (Album *album)
 
void signalAlbumMoved (Album *album)
 
void signalAlbumsUpdated (int type)
 
void signalShowOnlyAvailableAlbumsChanged (bool showsOnlyAvailableAlbums)
 

Operations on Date Album

AlbumList allDAlbums () const
 
DAlbumfindDAlbum (int id) const
 
QMap< YearMonth, int > getDAlbumsCount () const
 
void signalDAlbumsDirty (const QMap< YearMonth, int > &)
 
void signalDatesHashDirty (const QHash< QDateTime, int > &)
 
void signalAllDAlbumsLoaded ()
 

Operations on Physical Album

AlbumList allPAlbums () const
 
PAlbumcurrentPAlbum () const
 
PAlbumfindPAlbum (const QUrl &url) const
 
PAlbumfindPAlbum (int id) const
 
QMap< int, int > getPAlbumsCount () const
 
void removeWatchedPAlbums (const PAlbum *const album)
 
PAlbumcreatePAlbum (PAlbum *parent, const QString &name, const QString &caption, const QDate &date, const QString &category, QString &errMsg)
 
PAlbumcreatePAlbum (const QString &albumRootPath, const QString &name, const QString &caption, const QDate &date, const QString &category, QString &errMsg)
 
PAlbumcreatePAlbum (const CollectionLocation &location, const QString &name, const QString &caption, const QDate &date, const QString &category, QString &errMsg)
 
bool renamePAlbum (PAlbum *album, const QString &newName, QString &errMsg)
 
bool updatePAlbumIcon (PAlbum *album, qlonglong iconID, QString &errMsg)
 
void signalPAlbumsDirty (const QMap< int, int > &)
 

Operations on Tag Album

AlbumList allTAlbums () const
 
QList< TAlbum * > currentTAlbums () const
 
TAlbumfindTAlbum (int id) const
 
TAlbumfindTAlbum (const QString &tagPath) const
 
QMap< int, int > getTAlbumsCount () const
 
TAlbumcreateTAlbum (TAlbum *parent, const QString &name, const QString &iconkde, QString &errMsg)
 
AlbumList findOrCreateTAlbums (const QStringList &tagPaths)
 
bool deleteTAlbum (TAlbum *album, QString &errMsg, bool askUser=true)
 
bool renameTAlbum (TAlbum *album, const QString &name, QString &errMsg)
 
bool moveTAlbum (TAlbum *album, TAlbum *newParent, QString &errMsg)
 
bool mergeTAlbum (TAlbum *album, TAlbum *destAlbum, bool dialog, QString &errMsg)
 
bool updateTAlbumIcon (TAlbum *album, const QString &iconKDE, qlonglong iconID, QString &errMsg)
 
AlbumList getRecentlyAssignedTags (bool includeInternal=false) const
 
QStringList tagPaths (const QList< int > &tagIDs, bool leadingSlash=true, bool includeInternal=false) const
 
QStringList tagNames (const QList< int > &tagIDs, bool includeInternal=false) const
 
QHash< int, QString > tagPaths (bool leadingSlash=true, bool includeInternal=false) const
 
QHash< int, QString > tagNames (bool includeInternal=false) const
 
AlbumList findTagsWithProperty (const QString &property)
 
AlbumList findTagsWithProperty (const QString &property, const QString &value)
 
QList< int > subTags (int tagId, bool recursive=false)
 
void signalTAlbumsDirty (const QMap< int, int > &)
 
void signalTagPropertiesChanged (TAlbum *album)
 

Operations on Search Album

AlbumList allSAlbums () const
 
SAlbumfindSAlbum (int id) const
 
SAlbumfindSAlbum (const QString &name) const
 
QList< SAlbum * > findSAlbumsBySearchType (int searchType) const
 
SAlbumcreateSAlbum (const QString &name, DatabaseSearch::Type type, const QString &query)
 
bool updateSAlbum (SAlbum *album, const QString &changedQuery, const QString &changedName=QString(), DatabaseSearch::Type type=DatabaseSearch::UndefinedType)
 
bool deleteSAlbum (SAlbum *album)
 
void signalUpdateDuplicatesAlbums (const QList< SAlbum * > &modifiedAlbums, const QList< qlonglong > &deletedImages)
 
void signalSearchUpdated (SAlbum *album)
 

Detailed Description

AlbumManager manages albums: does listing of albums and controls the lifetime of it. For PAlbums and TAlbums, the listing is done by reading the db directly and building the hierarchy of the albums. For DAlbums, since the listing takes time, the work is delegated to a dbjob. Interested frontend entities can connect to the albummanager to receive notifications of new Albums, when Albums are deleted and when the current album is changed.

Additional operations are provided for: creating/deleting/rename Albums, updating icons and moving Albums.

Member Function Documentation

◆ addFakeConnection()

void Digikam::AlbumManager::addFakeConnection ( )

◆ albumTitles()

QHash< int, QString > Digikam::AlbumManager::albumTitles ( ) const

◆ allDAlbums()

AlbumList Digikam::AlbumManager::allDAlbums ( ) const

◆ allPAlbums()

◆ allSAlbums()

AlbumList Digikam::AlbumManager::allSAlbums ( ) const

◆ allTAlbums()

AlbumList Digikam::AlbumManager::allTAlbums ( ) const

◆ changeDatabase()

◆ checkDatabaseDirsAfterFirstRun()

void Digikam::AlbumManager::checkDatabaseDirsAfterFirstRun ( const QString &  dbPath,
const QString &  albumPath 
)
static

Some checks for settings done in first run wizard in case of QSlite Database.

References Digikam::DbEngineParameters::parametersForSQLiteDefaultFile(), and Digikam::DbEngineParameters::SQLiteDatabaseFile().

◆ cleanUp()

◆ clearCurrentAlbums()

◆ createPAlbum() [1/3]

PAlbum * Digikam::AlbumManager::createPAlbum ( const CollectionLocation location,
const QString &  name,
const QString &  caption,
const QDate &  date,
const QString &  category,
QString &  errMsg 
)

Overloaded method. Here you can supply a collection location (which must be available).

Parameters
locationthe collection for the new album

References Digikam::AlbumManager::Private::albumRootAlbumHash, createPAlbum(), and Digikam::RedEye::location().

◆ createPAlbum() [2/3]

PAlbum * Digikam::AlbumManager::createPAlbum ( const QString &  albumRootPath,
const QString &  name,
const QString &  caption,
const QDate &  date,
const QString &  category,
QString &  errMsg 
)

Overloaded method. Here you can supply an albumRootPath which must correspond to an available collection location.

References createPAlbum(), Digikam::CollectionManager::instance(), Digikam::RedEye::location(), and Digikam::CollectionManager::locationForAlbumRootPath().

◆ createPAlbum() [3/3]

PAlbum * Digikam::AlbumManager::createPAlbum ( PAlbum parent,
const QString &  name,
const QString &  caption,
const QDate &  date,
const QString &  category,
QString &  errMsg 
)

Create a new PAlbum with supplied properties as a child of the parent This is equivalent to creating a new folder on the disk with supplied name in the parent's folder path. Also the supplied attributes are written out to the database

Note
the signalAlbumAdded will be fired before this function returns. Its recommended to connect to that signal to get notification of new album added
Returns
the newly created PAlbum or 0 if it fails
Parameters
parentThe parent album under which to create the new Album. Parent must not be root. Otherwise, use the other variants of this method. If parent is root, the albumRootPath must be supplied.
namethe name of the new album
captionthe caption for the new album
datethe date for the new album
errMsgthis will contain the error message describing why the operation failed

References Digikam::CoreDB::addAlbum(), Digikam::PAlbum::albumPath(), Digikam::PAlbum::albumRootId(), Digikam::PAlbum::databaseUrl(), Digikam::CoreDbAccess::db(), Digikam::CoreDbUrl::fileUrl(), Digikam::Album::firstChild(), Digikam::PAlbum::isAlbumRoot(), Digikam::Album::isRoot(), Digikam::Album::next(), Digikam::Album::PHYSICAL, and signalAlbumsUpdated().

Referenced by createPAlbum(), and Digikam::AlbumModificationHelper::slotAlbumNew().

◆ createSAlbum()

SAlbum * Digikam::AlbumManager::createSAlbum ( const QString &  name,
DatabaseSearch::Type  type,
const QString &  query 
)

Create a new SAlbum with supplied url. If an existing SAlbum with same name exists this function will return a pointer to that album, instead of creating a new one. A newly created search album is added to the database. For an existing SAlbum, the url is updated and written out to the database

Note
the signalAlbumAdded will be fired before this function returns. Its recommended to connect to that signal to get notification of new album added
Returns
the newly created SAlbum or an existing SAlbum with same name
Parameters
namename for the new search
typethe type of the search
querysearch query to use

References Digikam::CoreDB::addSearch(), Digikam::AlbumManager::Private::allAlbumsIdHash, Digikam::CoreDbAccess::db(), findSAlbum(), Digikam::Album::globalID(), Digikam::Album::lastChild(), Digikam::AlbumManager::Private::rootSAlbum, Digikam::Album::setParent(), signalAlbumAboutToBeAdded(), signalAlbumAdded(), and updateSAlbum().

Referenced by Digikam::SearchModificationHelper::createFuzzySearchFromDropped(), Digikam::SearchModificationHelper::createFuzzySearchFromImage(), Digikam::SearchModificationHelper::createFuzzySearchFromSketch(), and Digikam::SearchModificationHelper::slotCreateTimeLineSearch().

◆ createTAlbum()

TAlbum * Digikam::AlbumManager::createTAlbum ( TAlbum parent,
const QString &  name,
const QString &  iconkde,
QString &  errMsg 
)

Create a new TAlbum with supplied properties as a child of the parent The tag is added to the database

Note
the signalAlbumAdded will be fired before this function returns. Its recommended to connect to that signal to get notification of new album added
Returns
the newly created TAlbum or 0 if it fails
Parameters
parentthe parent album under which to create the new Album
namethe name of the new album
iconkdethe iconkde for the new album (this is a filename which kde iconloader can load up
errMsgthis will contain the error message describing why the operation failed

References Digikam::CoreDB::addTag(), Digikam::CoreDbAccess::db(), Digikam::FaceTags::ensureIsPerson(), findTAlbum(), Digikam::Album::id(), Digikam::Album::isAncestorOf(), Digikam::FaceTags::personParentTag(), signalAlbumsUpdated(), and Digikam::Album::TAG.

Referenced by Digikam::TagEditDlg::createTAlbum().

◆ currentAlbums()

◆ currentPAlbum()

PAlbum * Digikam::AlbumManager::currentPAlbum ( ) const
Returns
the current PAlbum or null if no one is selected

Temporary fix, to return multiple items, iterate and cast each element

References Digikam::AlbumManager::Private::currentAlbums.

Referenced by Digikam::AlbumSelectWidget::AlbumSelectWidget(), and Digikam::ItemIconView::slotAlbumPropsEdit().

◆ currentTAlbums()

QList< TAlbum * > Digikam::AlbumManager::currentTAlbums ( ) const
Returns
the current TAlbum or null if no one is selected

This method is not yet used

References Digikam::AlbumManager::Private::currentAlbums.

Referenced by Digikam::ItemIconView::slotDeleteTag(), Digikam::ItemIconView::slotEditTag(), and Digikam::ItemIconView::slotNewTag().

◆ databaseEqual()

bool Digikam::AlbumManager::databaseEqual ( const DbEngineParameters parameters) const

Checks if the given database path is equal to the current one

References Digikam::CoreDbAccess::parameters().

◆ deleteSAlbum()

bool Digikam::AlbumManager::deleteSAlbum ( SAlbum album)

Delete a SAlbum from the database

Note
the signalAlbumDeleted will be fired before this function returns. Its recommended to connect to that signal to get notification of album deletes
Returns
true if the operation succeeds, false otherwise
Parameters
albumthe album to delete

References Digikam::AlbumManager::Private::allAlbumsIdHash, Digikam::CoreDbAccess::db(), Digikam::CoreDB::deleteSearch(), Digikam::Album::globalID(), Digikam::Album::id(), signalAlbumAboutToBeDeleted(), signalAlbumDeleted(), and signalAlbumHasBeenDeleted().

Referenced by Digikam::SearchModificationHelper::slotSearchDelete().

◆ deleteTAlbum()

bool Digikam::AlbumManager::deleteTAlbum ( TAlbum album,
QString &  errMsg,
bool  askUser = true 
)

Delete a TAlbum. The tag is removed from the database

Note
the signalAlbumDeleted will be fired before this function returns. Its recommended to connect to that signal to get notification of album deletes
Returns
true if the operation succeeds or false otherwise
Parameters
albumthe TAlbum to delete
errMsgthis will contain the error message describing why the
askUserask user to write metadata to images operation failed

References Digikam::FaceTagsEditor::addManually(), Digikam::AlbumIterator::current(), Digikam::FaceTagsEditor::databaseFaces(), Digikam::CoreDbAccess::db(), Digikam::CoreDB::deleteTag(), Digikam::CoreDB::getItemIDsInTag(), Digikam::Album::id(), Digikam::FaceTags::isPerson(), Digikam::FaceTags::isSystemPersonTagId(), Digikam::FaceTagsIface::region(), Digikam::FaceTagsEditor::removeFace(), Digikam::AlbumManager::Private::rootTAlbum, signalAlbumsUpdated(), Digikam::Album::TAG, Digikam::FaceTagsIface::tagId(), Digikam::FaceTagsIface::UnknownName, and Digikam::FaceTags::unknownPersonTagId().

Referenced by mergeTAlbum().

◆ findAlbum() [1/2]

Album * Digikam::AlbumManager::findAlbum ( Album::Type  type,
int  id 
) const
Returns
a Album with the given type and id
Parameters
idthe id for the album (not the global id)

References findAlbum(), and Digikam::Album::globalID().

◆ findAlbum() [2/2]

Album * Digikam::AlbumManager::findAlbum ( int  gid) const

◆ findDAlbum()

DAlbum * Digikam::AlbumManager::findDAlbum ( int  id) const

◆ findOrCreateTAlbums()

AlbumList Digikam::AlbumManager::findOrCreateTAlbums ( const QStringList &  tagPaths)

A list of tag paths is supplied. If no corresponding TAlbum exists, a new one will be created.

Parameters
tagPathsA list of tag paths
Returns
A list of all TAlbums for the list (already existing or newly created)

References findTAlbum(), Digikam::TagsCache::getOrCreateTags(), Digikam::TagsCache::instance(), and tagPaths().

◆ findPAlbum() [1/2]

◆ findPAlbum() [2/2]

PAlbum * Digikam::AlbumManager::findPAlbum ( int  id) const

◆ findSAlbum() [1/2]

SAlbum * Digikam::AlbumManager::findSAlbum ( const QString &  name) const
Returns
a SAlbum with given name, or 0 if not found
Parameters
namethe name of the search

References Digikam::Album::firstChild(), Digikam::Album::next(), and Digikam::AlbumManager::Private::rootSAlbum.

◆ findSAlbum() [2/2]

◆ findSAlbumsBySearchType()

QList< SAlbum * > Digikam::AlbumManager::findSAlbumsBySearchType ( int  searchType) const
Returns
SAlbums with given type, empty list if not found
Parameters
searchTypethe type of the search

References Digikam::Album::firstChild(), Digikam::Album::next(), Digikam::AlbumManager::Private::rootSAlbum, and Digikam::SAlbum::searchType().

◆ findTagsWithProperty() [1/2]

AlbumList Digikam::AlbumManager::findTagsWithProperty ( const QString &  property)

Returns a list of TAlbums which have the given property, or the given property/value combination.

References findTAlbum(), Digikam::TagsCache::instance(), and Digikam::TagsCache::tagsWithProperty().

◆ findTagsWithProperty() [2/2]

AlbumList Digikam::AlbumManager::findTagsWithProperty ( const QString &  property,
const QString &  value 
)

◆ findTAlbum() [1/2]

TAlbum * Digikam::AlbumManager::findTAlbum ( const QString &  tagPath) const
Returns
a TAlbum with given tag path, or 0 if not found
Parameters
tagPaththe tag path ("People/Friend/John")

References Digikam::AlbumIterator::current(), Digikam::AlbumManager::Private::rootTAlbum, and Digikam::TAlbum::tagPath().

◆ findTAlbum() [2/2]

◆ getDAlbumsCount()

QMap< YearMonth, int > Digikam::AlbumManager::getDAlbumsCount ( ) const

Returns the latest count for DAlbums as also emitted via signalDAlbumsDirty.

Returns
count map for DAlbums

References Digikam::AlbumManager::Private::dAlbumsCount.

◆ getFaceCount()

QMap< int, int > Digikam::AlbumManager::getFaceCount ( ) const

Returns the latest count for faces as also emitted via signalFaceCountsDirty.

Returns
count map for faces (confirmed and unconfirmed combined)

References Digikam::AlbumManager::Private::fAlbumsCount.

◆ getItemFromAlbum()

qlonglong Digikam::AlbumManager::getItemFromAlbum ( Album *const  album,
const QString &  fileName 
)

Returns the id of the item with the given filename in the given Album.

Parameters
albumThe album in which we search the item.
fileNameThe name of the item file.
Returns
The item id or -1 if not existent.

References Digikam::CoreDbAccess::db(), Digikam::CoreDB::getItemFromAlbum(), and Digikam::Album::id().

Referenced by Digikam::DTrash::deleteImage().

◆ getPAlbumsCount()

QMap< int, int > Digikam::AlbumManager::getPAlbumsCount ( ) const

Returns the latest count for PAlbums as also emitted via signalPAlbumsDirty.

Returns
count map for PAlbums

References Digikam::AlbumManager::Private::pAlbumsCount.

◆ getRecentlyAssignedTags()

AlbumList Digikam::AlbumManager::getRecentlyAssignedTags ( bool  includeInternal = false) const

Get a list of recently assigned tags (only last 6 tags are listed)

Returns
the list of recently assigned TAlbums
Parameters
includeInternalinclude internal tags in the returned list, or skip them

References Digikam::CoreDbAccess::db(), findTAlbum(), Digikam::CoreDB::getRecentlyAssignedTags(), and Digikam::TAlbum::isInternalTag().

◆ getTAlbumsCount()

QMap< int, int > Digikam::AlbumManager::getTAlbumsCount ( ) const

Returns the latest count for TAlbums as also emitted via signalTAlbumsDirty.

Returns
count map for TAlbums

References Digikam::AlbumManager::Private::tAlbumsCount.

◆ getUnconfirmedFaceCount()

QMap< int, int > Digikam::AlbumManager::getUnconfirmedFaceCount ( ) const

Returns the latest count for unconfirmed faces only as also emitted via signalFaceCountsDirty.

Returns
count map for unconfirmed faces only

References Digikam::AlbumManager::Private::uAlbumsCount.

Referenced by Digikam::AlbumFilterModel::lessThan().

◆ instance()

AlbumManager * Digikam::AlbumManager::instance ( )
static

A convenience function to get the instance of the AlbumManager

Referenced by Digikam::AbstractAlbumModel::AbstractAlbumModel(), Digikam::AlbumDragDropHandler::accepts(), Digikam::TagDragDropHandler::accepts(), Digikam::TagModel::activateFaceTagModel(), Digikam::ContextMenuHelper::addGotoMenu(), Digikam::FaceUtils::addNormalTag(), Digikam::ItemCategorizedView::albumAt(), Digikam::AbstractCountingAlbumModel::albumCleared(), Digikam::AbstractCheckableAlbumModel::albumCleared(), Digikam::AlbumModel::albumData(), Digikam::AlbumFilterModel::AlbumFilterModel(), Digikam::AlbumModel::albumForId(), Digikam::TagModel::albumForId(), Digikam::SearchModel::albumForId(), Digikam::DateAlbumModel::albumForId(), Digikam::AlbumModel::AlbumModel(), Digikam::AlbumPointer< T >::AlbumPointer(), Digikam::AlbumSelectWidget::AlbumSelectWidget(), Digikam::SetupDatabase::applySettings(), Digikam::ItemAlbumFilterModel::compareInfosCategories(), Digikam::FaceGroup::Private::createAssignNameWidget(), Digikam::SearchModificationHelper::createFuzzySearchFromDropped(), Digikam::SearchModificationHelper::createFuzzySearchFromImage(), Digikam::SearchModificationHelper::createFuzzySearchFromSketch(), Digikam::TagEditDlg::createTAlbum(), Digikam::AbstractAlbumTreeView::currentAlbums(), Digikam::ListItem::data(), Digikam::TableViewColumns::ColumnDigikamProperties::data(), Digikam::DateAlbumModel::DateAlbumModel(), Digikam::DateFolderView::DateFolderView(), Digikam::DBInfoIface::defaultUploadUrl(), Digikam::DIO::del(), Digikam::DTrash::deleteImage(), Digikam::DigikamApp::DigikamApp(), Digikam::GPSSearchView::doLoadState(), Digikam::AlbumDragDropHandler::dropEvent(), Digikam::TagDragDropHandler::dropEvent(), Digikam::FuzzySearchView::dropEvent(), Digikam::ImageWindow::dropEvent(), Digikam::FaceGroup::FaceGroup(), Digikam::FacesDetector::FacesDetector(), Digikam::FindDuplicatesAlbumItem::FindDuplicatesAlbumItem(), Digikam::FindDuplicatesView::FindDuplicatesView(), Digikam::FocusPointGroup::FocusPointGroup(), Digikam::ColorLabelFilter::getCheckedColorLabelTags(), Digikam::PickLabelFilter::getCheckedPickLabelTags(), Digikam::CommonKeys::getDbValue(), Digikam::TagFolderView::handleCustomContextMenuAction(), Digikam::ToolTipFiller::imageInfoTipContents(), Digikam::ItemAlbumFilterModel::ItemAlbumFilterModel(), Digikam::ItemAlbumModel::ItemAlbumModel(), Digikam::ItemIconView::ItemIconView(), Digikam::DBInfoIface::itemInfo(), Digikam::ItemViewUtilities::ItemViewUtilities(), Digikam::AlbumFilterModel::lessThan(), Digikam::TagsManagerFilterModel::matches(), Digikam::MetadataSynchronizer::MetadataSynchronizer(), Digikam::DIO::move(), Digikam::AlbumPointer< T >::operator=(), Digikam::ItemDelegate::paint(), Digikam::ImportDelegate::paint(), Digikam::FindDuplicatesView::populateTreeView(), Digikam::SearchFieldAlbum::read(), Digikam::SearchFieldLabels::read(), Digikam::FaceUtils::removeNormalTag(), Digikam::TagList::restoreSettings(), Digikam::AlbumSelectors::selectedAlbums(), Digikam::AlbumSelectors::selectedTags(), Digikam::AlbumFolderViewSideBarWidget::setActive(), Digikam::FuzzySearchSideBarWidget::setActive(), Digikam::SearchSideBarWidget::setActive(), Digikam::TagViewSideBarWidget::setActive(), Digikam::TimelineSideBarWidget::setActive(), Digikam::GPSSearchView::setActive(), Digikam::DateFolderView::setActive(), Digikam::ItemViewUtilities::setAsAlbumThumbnail(), Digikam::AlbumTreeView::setCurrentAlbum(), Digikam::DateTreeView::setCurrentAlbum(), Digikam::SearchTreeView::setCurrentAlbum(), Digikam::TagTreeView::setCurrentAlbum(), Digikam::AbstractAlbumTreeView::setCurrentAlbums(), Digikam::AlbumSelectWidget::setCurrentAlbumUrl(), Digikam::AssignNameWidget::setCurrentFace(), Digikam::AssignNameWidget::setCurrentTag(), Digikam::AbstractCountingAlbumModel::setup(), Digikam::AlbumHistory::slotAlbumCurrentChanged(), Digikam::AlbumModificationHelper::slotAlbumEdit(), Digikam::AlbumModificationHelper::slotAlbumNew(), Digikam::AlbumModificationHelper::slotAlbumRename(), Digikam::AlbumModificationHelper::slotAlbumResetIcon(), Digikam::AlbumHistory::slotAlbumSelected(), Digikam::AlbumHistory::slotClearSelectPAlbum(), Digikam::AlbumHistory::slotClearSelectTAlbum(), Digikam::ItemAlbumModel::slotCollectionImageChange(), Digikam::SearchModificationHelper::slotCreateTimeLineSearch(), Digikam::AlbumHistory::slotCurrentChange(), Digikam::ItemIconView::slotDeleteTag(), Digikam::AlbumThumbnailLoader::slotDispatchThumbnailInternal(), Digikam::ImportUI::slotDownload(), Digikam::ItemIconView::slotEditTag(), Digikam::ItemIconView::slotGotoAlbumAndItem(), Digikam::ItemIconView::slotGotoTagAndItem(), Digikam::AlbumThumbnailLoader::slotGotThumbnailFromIcon(), Digikam::AlbumHistory::slotImageSelected(), Digikam::ItemAlbumModel::slotImageTagChange(), Digikam::TagModificationHelper::slotMultipleFaceTagDel(), Digikam::TagModificationHelper::slotMultipleTagDel(), Digikam::ItemIconView::slotNewTag(), Digikam::ItemIconView::slotRemoveTag(), Digikam::ItemAlbumModel::slotSearchChange(), Digikam::SearchModificationHelper::slotSearchDelete(), Digikam::SearchModificationHelper::slotSearchRename(), Digikam::AbstractAlbumTreeView::slotSelectionChanged(), Digikam::TagModificationHelper::slotTagDelete(), Digikam::TagModificationHelper::slotTagEdit(), Digikam::TagModificationHelper::slotTagNew(), Digikam::TagModificationHelper::slotTagToFaceTag(), Digikam::TagEditDlg::TagEditDlg(), Digikam::TagFolderView::TagFolderView(), Digikam::TagList::TagList(), Digikam::TagModel::TagModel(), Digikam::TagPropertiesFilterModel::TagPropertiesFilterModel(), Digikam::TagsActionMngr::TagsActionMngr(), Digikam::ThumbsGenerator::ThumbsGenerator(), Digikam::TimelineSideBarWidget::TimelineSideBarWidget(), Digikam::AlbumPointer< T >::~AlbumPointer(), and Digikam::DigikamApp::~DigikamApp().

◆ isMovingAlbum()

bool Digikam::AlbumManager::isMovingAlbum ( Album album) const

Returns if the given album is currently being moved, that is, if this album is in between signalAlbumAboutToBeMoved and signalAlbumMoved. In this case, you can preserve state of such an album because the object is guaranteed not to be deleted, even if signalAlbumAboutToBeDeleted is emitted.

References Digikam::AlbumManager::Private::currentlyMovingAlbum.

◆ isShowingOnlyAvailableAlbums()

bool Digikam::AlbumManager::isShowingOnlyAvailableAlbums ( ) const

◆ mergeTAlbum()

bool Digikam::AlbumManager::mergeTAlbum ( TAlbum album,
TAlbum destAlbum,
bool  dialog,
QString &  errMsg 
)

◆ moveTAlbum()

◆ prepareItemCounts()

void Digikam::AlbumManager::prepareItemCounts ( )

Ensures that valid item counts for physical and tag albums are available

◆ refresh()

void Digikam::AlbumManager::refresh ( )

This is similar to startScan, except that it assumes you have run startScan at least once. It checks the database to see if any new albums have been added and updates them accordingly. Use this when a change in the filesystem is detected (but the album library path hasn't changed)

See also
startScan

Referenced by startScan().

◆ removeFakeConnection()

void Digikam::AlbumManager::removeFakeConnection ( )

◆ removeWatchedPAlbums()

void Digikam::AlbumManager::removeWatchedPAlbums ( const PAlbum *const  album)

◆ renamePAlbum()

bool Digikam::AlbumManager::renamePAlbum ( PAlbum album,
const QString &  newName,
QString &  errMsg 
)

◆ renameTAlbum()

bool Digikam::AlbumManager::renameTAlbum ( TAlbum album,
const QString &  name,
QString &  errMsg 
)

Renames a TAlbum. This updates the tag name in the database

Returns
true if the operation succeeds, false otherwise
Parameters
albumthe Album which should be renamed
namethe new name for the album
errMsgthis will contain the error message describing why the operation failed

References Digikam::CoreDbAccess::db(), Digikam::Album::id(), Digikam::AlbumManager::Private::rootTAlbum, Digikam::CoreDB::setTagName(), Digikam::Album::setTitle(), and signalAlbumRenamed().

◆ setCurrentAlbums()

◆ setDatabase()

bool Digikam::AlbumManager::setDatabase ( const DbEngineParameters params,
bool  priority,
const QString &  suggestedAlbumRoot = QString() 
)

Initialize. Informs the user about failures. Returns true on success, false on failure. A return value of false during startup indicates termination of the program (user is informed)

References Digikam::ScanController::AbortImmediately, addFakeConnection(), Digikam::CollectionManager::addLocation(), Digikam::AlbumManager::Private::albumPathHash, Digikam::AlbumManager::Private::albumRootAlbumHash, Digikam::AlbumManager::Private::albumWatch, Digikam::AlbumManager::Private::allAlbumsIdHash, Digikam::ScanController::cancelAllAndSuspendCollectionScan(), Digikam::AlbumManager::Private::changed, Digikam::CollectionManager::changeType(), Digikam::DbEngineGuiErrorHandler::checkDatabaseConnection(), Digikam::CollectionManager::checkHardWiredLocations(), Digikam::SimilarityDbAccess::checkReadyForUse(), cleanUp(), Digikam::AlbumWatch::clear(), Digikam::Setup::CollectionsPage, Digikam::ScanController::ContinueWithoutDatabase, Digikam::AlbumManager::Private::currentAlbums, Digikam::ScanController::databaseInitialization(), Digikam::DbEngineParameters::databaseNameCore, Digikam::CoreDbAccess::DatabaseSlave, Digikam::CoreDbAccess::databaseWatch(), Digikam::CoreDbAccess::db(), Digikam::Setup::execSinglePage(), Digikam::ApplicationSettings::getDatabaseDirSetAtCmd(), Digikam::DatabaseServerError::getErrorText(), Digikam::DatabaseServerError::getErrorType(), Digikam::CoreDB::getSetting(), Digikam::AlbumManager::Private::hasPriorizedDbPath, Digikam::CoreDbAccess::initDbEngineErrorHandler(), Digikam::SimilarityDbAccess::initDbEngineErrorHandler(), Digikam::ThumbsDbAccess::initDbEngineErrorHandler(), Digikam::ThumbnailLoadThread::initializeThumbnailDatabase(), Digikam::CollectionManager::instance(), Digikam::DatabaseServerStarter::instance(), Digikam::ScanController::instance(), Digikam::ApplicationSettings::instance(), Digikam::DbEngineParameters::internalServer, Digikam::DbEngineParameters::internalServerMysqlAdminCmd, Digikam::DbEngineParameters::internalServerMysqlServCmd, Digikam::DbEngineParameters::internalServerPath(), Digikam::DbEngineParameters::isMySQL(), Digikam::DbEngineParameters::isSQLite(), Digikam::CollectionLocation::label(), Digikam::CoreDbAccess::lastError(), Digikam::CoreDbAccess::MainApplication, Digikam::CollectionManager::migrateToVolume(), Digikam::CollectionManager::migrationCandidates(), Digikam::DatabaseServerError::NoErrors, Digikam::CoreDbAccess::parameters(), Digikam::SimilarityDbAccess::parameters(), Digikam::ThumbsDbAccess::parameters(), Digikam::ScanController::resumeCollectionScan(), Digikam::AlbumManager::Private::rootDAlbum, Digikam::AlbumManager::Private::rootPAlbum, Digikam::AlbumManager::Private::rootSAlbum, Digikam::AlbumManager::Private::rootTAlbum, Digikam::AlbumWatch::setDbEngineParameters(), Digikam::CoreDbAccess::setParameters(), Digikam::SimilarityDbAccess::setParameters(), Digikam::CoreDB::setSetting(), Digikam::CollectionManager::setWatchDisabled(), signalAlbumCurrentChanged(), signalAlbumsCleared(), Digikam::DbEngineParameters::similarityParameters(), Digikam::DatabaseServerStarter::startServerManagerProcess(), Digikam::DatabaseServerStarter::stopServerManagerProcess(), Digikam::ScanController::Success, and Digikam::CollectionLocation::TypeVolumeRemovable.

Referenced by changeDatabase().

◆ setShowOnlyAvailableAlbums()

◆ signalAlbumAboutToBeAdded

void Digikam::AlbumManager::signalAlbumAboutToBeAdded ( Album album,
Album parent,
Album prev 
)
signal

Emitted when an album is about to be added to the given parent (0 if album is root) after the item given by prev (prev is 0 if parent has no children yet).

Referenced by Digikam::AbstractAlbumModel::AbstractAlbumModel(), createSAlbum(), moveTAlbum(), and startScan().

◆ signalAlbumAboutToBeDeleted

void Digikam::AlbumManager::signalAlbumAboutToBeDeleted ( Album album)
signal

Emitted when the album is about to be deleted, but is still fully valid.

Referenced by Digikam::AbstractAlbumModel::AbstractAlbumModel(), deleteSAlbum(), and moveTAlbum().

◆ signalAlbumAboutToBeMoved

void Digikam::AlbumManager::signalAlbumAboutToBeMoved ( Album album)
signal

Emittedd when an album is about to be moved. Signals for deleting and adding will be sent afterwards, but the album object is guaranteed not to be deleted until after signalAlbumMoved.

Referenced by moveTAlbum().

◆ signalAlbumAdded

void Digikam::AlbumManager::signalAlbumAdded ( Album album)
signal

Emitted when the album has been added.

Referenced by Digikam::AbstractAlbumModel::AbstractAlbumModel(), createSAlbum(), moveTAlbum(), and startScan().

◆ signalAlbumCurrentChanged

void Digikam::AlbumManager::signalAlbumCurrentChanged ( const QList< Album * > &  albums)
signal

◆ signalAlbumDeleted

void Digikam::AlbumManager::signalAlbumDeleted ( Album album)
signal

Emitted when the album is deleted, but the object can still be accessed.

Referenced by deleteSAlbum(), and moveTAlbum().

◆ signalAlbumHasBeenDeleted

void Digikam::AlbumManager::signalAlbumHasBeenDeleted ( quintptr  )
signal

Emitted when the album is deleted, the object can no longer be accessed. For identification purposes, the former album pointer is passed.

Referenced by Digikam::AbstractAlbumModel::AbstractAlbumModel(), deleteSAlbum(), and moveTAlbum().

◆ signalAlbumIconChanged

void Digikam::AlbumManager::signalAlbumIconChanged ( Album album)
signal

◆ signalAlbumMoved

void Digikam::AlbumManager::signalAlbumMoved ( Album album)
signal

Emitted when the album is moved to its new parent. After signalAlbumAboutToBeMoved, all four signals for first deleting and then adding will have been sent.

Referenced by moveTAlbum().

◆ signalAlbumNewPath

void Digikam::AlbumManager::signalAlbumNewPath ( Album album)
signal

Referenced by renamePAlbum().

◆ signalAlbumRenamed

void Digikam::AlbumManager::signalAlbumRenamed ( Album album)
signal

◆ signalAlbumsCleared

void Digikam::AlbumManager::signalAlbumsCleared ( )
signal

◆ signalAlbumsUpdated

void Digikam::AlbumManager::signalAlbumsUpdated ( int  type)
signal

◆ signalAllAlbumsLoaded

void Digikam::AlbumManager::signalAllAlbumsLoaded ( )
signal

Referenced by startScan().

◆ signalAllDAlbumsLoaded

void Digikam::AlbumManager::signalAllDAlbumsLoaded ( )
signal

◆ signalDAlbumsDirty

void Digikam::AlbumManager::signalDAlbumsDirty ( const QMap< YearMonth, int > &  )
signal

◆ signalDatesHashDirty

void Digikam::AlbumManager::signalDatesHashDirty ( const QHash< QDateTime, int > &  )
signal

◆ signalFaceCountsDirty

void Digikam::AlbumManager::signalFaceCountsDirty ( const QMap< int, int > &  faceCount,
const QMap< int, int > &  uFaceCount,
const QList< int > &  toUpdatedFaces 
)
signal

◆ signalPAlbumsDirty

void Digikam::AlbumManager::signalPAlbumsDirty ( const QMap< int, int > &  )
signal

◆ signalSearchUpdated

void Digikam::AlbumManager::signalSearchUpdated ( SAlbum album)
signal

◆ signalShowOnlyAvailableAlbumsChanged

void Digikam::AlbumManager::signalShowOnlyAvailableAlbumsChanged ( bool  showsOnlyAvailableAlbums)
signal

Emitted when a change is done on available Albums. Please note that affected albums may appear or disappear after this signal has been emitted.

Referenced by setShowOnlyAvailableAlbums().

◆ signalTagPropertiesChanged

void Digikam::AlbumManager::signalTagPropertiesChanged ( TAlbum album)
signal

◆ signalTAlbumsDirty

void Digikam::AlbumManager::signalTAlbumsDirty ( const QMap< int, int > &  )
signal

◆ signalUpdateDuplicatesAlbums

void Digikam::AlbumManager::signalUpdateDuplicatesAlbums ( const QList< SAlbum * > &  modifiedAlbums,
const QList< qlonglong > &  deletedImages 
)
signal

◆ startScan()

◆ subTags()

QList< int > Digikam::AlbumManager::subTags ( int  tagId,
bool  recursive = false 
)

◆ tagNames() [1/2]

QHash< int, QString > Digikam::AlbumManager::tagNames ( bool  includeInternal = false) const

◆ tagNames() [2/2]

QStringList Digikam::AlbumManager::tagNames ( const QList< int > &  tagIDs,
bool  includeInternal = false 
) const
Returns
A list with the tag names for a list of tag IDs.
Parameters
tagIDslist of tag album IDs

References findTAlbum(), Digikam::TAlbum::isInternalTag(), and Digikam::Album::title().

Referenced by Digikam::CommonKeys::getDbValue(), Digikam::DBInfoIface::itemInfo(), Digikam::ItemDelegate::paint(), and Digikam::ImportDelegate::paint().

◆ tagPaths() [1/2]

QHash< int, QString > Digikam::AlbumManager::tagPaths ( bool  leadingSlash = true,
bool  includeInternal = false 
) const

◆ tagPaths() [2/2]

QStringList Digikam::AlbumManager::tagPaths ( const QList< int > &  tagIDs,
bool  leadingSlash = true,
bool  includeInternal = false 
) const
Returns
A list with the tag paths for a list of tag IDs.
Parameters
tagIDslist of tag album IDs
leadingSlashif true return tags with a leading slash
includeInternalinclude internal tags in the returned list, or skip them

References findTAlbum(), Digikam::TAlbum::isInternalTag(), and Digikam::TAlbum::tagPath().

Referenced by Digikam::TableViewColumns::ColumnDigikamProperties::data(), findOrCreateTAlbums(), Digikam::CommonKeys::getDbValue(), Digikam::ToolTipFiller::imageInfoTipContents(), and Digikam::DBInfoIface::itemInfo().

◆ updatePAlbumIcon()

bool Digikam::AlbumManager::updatePAlbumIcon ( PAlbum album,
qlonglong  iconID,
QString &  errMsg 
)

Update the icon for an album. The icon is the name (and not full path) of the file in the album

Returns
true if the operation succeeds, false otherwise
Parameters
albumthe album for which icon should be changed
iconIDthe filename of the new icon
errMsgif the operation fails, this will contain the error message describing why the operation failed

References Digikam::CoreDbAccess::db(), Digikam::Album::id(), Digikam::AlbumManager::Private::rootPAlbum, Digikam::CoreDB::setAlbumIcon(), and signalAlbumIconChanged().

Referenced by Digikam::AlbumDragDropHandler::dropEvent(), Digikam::ItemViewUtilities::setAsAlbumThumbnail(), and Digikam::AlbumModificationHelper::slotAlbumResetIcon().

◆ updateSAlbum()

bool Digikam::AlbumManager::updateSAlbum ( SAlbum album,
const QString &  changedQuery,
const QString &  changedName = QString(),
DatabaseSearch::Type  type = DatabaseSearch::UndefinedType 
)

Update the url for a SAlbum

Returns
true if the operation succeeds, false otherwise
Parameters
albumthe album to update
changedQuerythe new query data of the album
changedNamea new name, or null to keep the current name
typea new type, or UndefinedType to keep the current type

References Digikam::AlbumManager::Private::currentAlbums, Digikam::CoreDbAccess::db(), Digikam::Album::id(), Digikam::SAlbum::searchType(), Digikam::Album::setTitle(), signalAlbumCurrentChanged(), signalAlbumRenamed(), Digikam::Album::title(), Digikam::DatabaseSearch::UndefinedType, and Digikam::CoreDB::updateSearch().

Referenced by createSAlbum(), and Digikam::SearchModificationHelper::slotSearchRename().

◆ updateTAlbumIcon()

bool Digikam::AlbumManager::updateTAlbumIcon ( TAlbum album,
const QString &  iconKDE,
qlonglong  iconID,
QString &  errMsg 
)

Update the icon for a TAlbum.

Returns
true if the operation succeeds, false otherwise
Parameters
albumthe album for which icon should be changed
iconKDEa simple filename which can be loaded by KIconLoader
iconIDid of the icon image file
errMsgthis will contain the error message describing why the operation failed
Note
if iconKDE is not empty then iconID is used. So if you want to set the icon to a file which can be loaded by QIcon, pass it in as iconKDE. otherwise pass a null QString to iconKDE and set iconID

References Digikam::CoreDbAccess::db(), Digikam::Album::id(), Digikam::AlbumManager::Private::rootTAlbum, Digikam::CoreDB::setTagIcon(), and signalAlbumIconChanged().

Referenced by Digikam::TagDragDropHandler::dropEvent(), Digikam::TagFolderView::handleCustomContextMenuAction(), Digikam::ItemViewUtilities::setAsAlbumThumbnail(), Digikam::TagModificationHelper::slotMultipleFaceTagDel(), and Digikam::TagModificationHelper::slotTagToFaceTag().

Friends And Related Function Documentation

◆ Album

friend class Album
friend

◆ AlbumManagerCreator

friend class AlbumManagerCreator
friend

◆ AlbumPointer

template<class T >
friend class AlbumPointer
friend

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