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

Public Slots

void slotAlbumDelete ()
 
void slotAlbumDelete (PAlbum *album)
 
void slotAlbumEdit ()
 
void slotAlbumEdit (PAlbum *album)
 
PAlbumslotAlbumNew ()
 
PAlbumslotAlbumNew (PAlbum *parentAlbum)
 
void slotAlbumRename ()
 
void slotAlbumRename (PAlbum *album)
 
void slotAlbumResetIcon ()
 
void slotAlbumResetIcon (PAlbum *album)
 

Public Member Functions

 AlbumModificationHelper (QObject *const parent, QWidget *const dialogParent)
 
void bindAlbum (QAction *const action, PAlbum *const parent) const
 
PAlbumboundAlbum (QObject *const action) const
 
 ~AlbumModificationHelper () override
 

Detailed Description

Utility class providing methods to modify physical albums (PAlbum) in a way useful to implement views.

Author
jwienke

Constructor & Destructor Documentation

◆ AlbumModificationHelper()

Digikam::AlbumModificationHelper::AlbumModificationHelper ( QObject *const  parent,
QWidget *const  dialogParent 
)
explicit

Constructor.

Parameters
parentthe parent for qt parent child mechanism
dialogParentparent widget for dialogs displayed by this object

◆ ~AlbumModificationHelper()

Digikam::AlbumModificationHelper::~AlbumModificationHelper ( )
override

Destructor.

Member Function Documentation

◆ bindAlbum()

void Digikam::AlbumModificationHelper::bindAlbum ( QAction *const  action,
PAlbum *const  parent 
) const

Sets the album that the given action operates on. You must call bindTag and then connect the action's triggered to the desired slot, slotTagNew(), slotTagEdit() or slotTagDelete(). Note: Changes the Action's user data.

Referenced by Digikam::ContextMenuHelper::addActionDeleteAlbum(), Digikam::ContextMenuHelper::addActionEditAlbum(), Digikam::ContextMenuHelper::addActionNewAlbum(), Digikam::ContextMenuHelper::addActionRenameAlbum(), and Digikam::ContextMenuHelper::addActionResetAlbumIcon().

◆ boundAlbum()

PAlbum * Digikam::AlbumModificationHelper::boundAlbum ( QObject *const  action) const

Returns the album bound with bindAlbum. The given QObject shall be a QAction, but for convenience the given object will be checked with qobject_cast first, so you can pass QObject::sender().

Referenced by slotAlbumDelete(), slotAlbumEdit(), slotAlbumNew(), slotAlbumRename(), and slotAlbumResetIcon().

◆ slotAlbumDelete [1/2]

void Digikam::AlbumModificationHelper::slotAlbumDelete ( )
slot

References boundAlbum().

◆ slotAlbumDelete [2/2]

◆ slotAlbumEdit [1/2]

void Digikam::AlbumModificationHelper::slotAlbumEdit ( )
slot

References boundAlbum().

◆ slotAlbumEdit [2/2]

◆ slotAlbumNew [1/2]

PAlbum * Digikam::AlbumModificationHelper::slotAlbumNew ( )
slot

References boundAlbum().

◆ slotAlbumNew [2/2]

PAlbum * Digikam::AlbumModificationHelper::slotAlbumNew ( PAlbum parentAlbum)
slot

Creates a new album under the given parent. The user will be prompted for the settings of the new album.

Parameters
parentAlbumparent album for the new one
Returns
the new album or 0 if no album was created

References Digikam::PAlbum::albumRootId(), Digikam::CollectionManager::albumRootPath(), Digikam::AlbumPropsEdit::createNew(), Digikam::AlbumManager::createPAlbum(), Digikam::AlbumManager::instance(), Digikam::CollectionManager::instance(), Digikam::ApplicationSettings::instance(), Digikam::Album::isRoot(), and Digikam::ApplicationSettings::setAlbumCategoryNames().

Referenced by Digikam::ItemIconView::slotNewAlbum().

◆ slotAlbumRename [1/2]

void Digikam::AlbumModificationHelper::slotAlbumRename ( )
slot

References boundAlbum().

◆ slotAlbumRename [2/2]

void Digikam::AlbumModificationHelper::slotAlbumRename ( PAlbum album)
slot

Renames the given album. The user will be prompted for a new name.

Parameters
albumthe album to rename

References Digikam::AlbumManager::instance(), and Digikam::Album::title().

Referenced by Digikam::ItemIconView::slotRenameAlbum().

◆ slotAlbumResetIcon [1/2]

void Digikam::AlbumModificationHelper::slotAlbumResetIcon ( )
slot

References boundAlbum().

◆ slotAlbumResetIcon [2/2]

void Digikam::AlbumModificationHelper::slotAlbumResetIcon ( PAlbum album)
slot

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