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

Public Slots

void slotCreateFuzzySearchFromDropped (const QString &name, const QString &filePath, float threshold, float maxThreshold, const QList< int > &targetAlbums, bool overwriteIfExisting)
 
void slotCreateFuzzySearchFromImage (const QString &name, const ItemInfo &image, float threshold, float maxThreshold, const QList< int > &targetAlbums, bool overwriteIfExisting=false)
 
void slotCreateFuzzySearchFromSketch (const QString &name, SketchWidget *sketchWidget, unsigned int numberOfResults, const QList< int > &targetAlbums, bool overwriteIfExisting=false)
 
SAlbumslotCreateTimeLineSearch (const QString &desiredName, const DateRangeList &dateRanges, bool overwriteIfExisting=false)
 
void slotSearchDelete (SAlbum *searchAlbum)
 
void slotSearchRename (SAlbum *searchAlbum)
 

Public Member Functions

SAlbumcreateFuzzySearchFromDropped (const QString &name, const QString &filePath, float threshold, float maxThreshold, const QList< int > &targetAlbums, bool overwriteIfExisting=false)
 
SAlbumcreateFuzzySearchFromImage (const QString &name, const ItemInfo &image, float threshold, float maxThreshold, const QList< int > &targetAlbums, bool overwriteIfExisting=false)
 
SAlbumcreateFuzzySearchFromSketch (const QString &name, SketchWidget *sketchWidget, unsigned int numberOfResults, const QList< int > &targetAlbums, bool overwriteIfExisting=false)
 
 SearchModificationHelper (QObject *const parent, QWidget *const dialogParent)
 
 ~SearchModificationHelper () override
 

Detailed Description

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

Author
jwienke

Constructor & Destructor Documentation

◆ SearchModificationHelper()

Digikam::SearchModificationHelper::SearchModificationHelper ( QObject *const  parent,
QWidget *const  dialogParent 
)

Constructor.

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

◆ ~SearchModificationHelper()

Digikam::SearchModificationHelper::~SearchModificationHelper ( )
override

Destructor.

Member Function Documentation

◆ createFuzzySearchFromDropped()

◆ createFuzzySearchFromImage()

◆ createFuzzySearchFromSketch()

◆ slotCreateFuzzySearchFromDropped

void Digikam::SearchModificationHelper::slotCreateFuzzySearchFromDropped ( const QString &  name,
const QString &  filePath,
float  threshold,
float  maxThreshold,
const QList< int > &  targetAlbums,
bool  overwriteIfExisting 
)
slot

Creates a new fuzzy search for finding similar photos based on the file path of a photo and selects it in the album manager after creation.

Parameters
nameof the new search
filePathpath of the image to base this search on
thresholdminimum threshold for image search
maxThresholdmaximum threshold for image search
targetAlbumsThe image must be in one of these albums
overwriteIfExistingif true, an existing search with the desired name will be overwritten without prompting the user for a new name

References createFuzzySearchFromDropped().

◆ slotCreateFuzzySearchFromImage

void Digikam::SearchModificationHelper::slotCreateFuzzySearchFromImage ( const QString &  name,
const ItemInfo image,
float  threshold,
float  maxThreshold,
const QList< int > &  targetAlbums,
bool  overwriteIfExisting = false 
)
slot

Creates a new fuzzy search for finding similar photos based on one photo and selects it in the album manager after creation.

Parameters
nameof the new search
imagethe image to base this search on
thresholdthe threshold for image search, 0 <= threshold <= 1
maxThresholdthe maximum threshold of similarity.
targetAlbumsThe image must be in one of these albums
overwriteIfExistingif true, an existing search with the desired name will be overwritten without prompting the user for a new name

References createFuzzySearchFromImage().

◆ slotCreateFuzzySearchFromSketch

void Digikam::SearchModificationHelper::slotCreateFuzzySearchFromSketch ( const QString &  name,
SketchWidget sketchWidget,
unsigned int  numberOfResults,
const QList< int > &  targetAlbums,
bool  overwriteIfExisting = false 
)
slot

Creates a new fuzzy search based on a sketch created by the user and selects it in the AlbumManager after creation.

Parameters
namethe name of the new sketch search
sketchWidgetthe widget containing the sketch of the user
numberOfResultsmax number of results to display
targetAlbumsThe image must be in one of these albums
overwriteIfExistingif true, an existing search with the desired name will be overwritten without prompting the user for a new name

References createFuzzySearchFromSketch().

◆ slotCreateTimeLineSearch

SAlbum * Digikam::SearchModificationHelper::slotCreateTimeLineSearch ( const QString &  desiredName,
const DateRangeList dateRanges,
bool  overwriteIfExisting = false 
)
slot

Creates a new timeline search.

Parameters
desiredNamedesired name for the search. If this name already exists and overwriteIfExisting is false, then the user will be prompted for a new name
dateRangesdate ranges to contain in this timeline search. If this is empty, no search will be created.
overwriteIfExistingif true, an existing search with the desired name will be overwritten without prompting the user for a new name

References Digikam::AlbumManager::clearCurrentAlbums(), Digikam::AlbumManager::createSAlbum(), Digikam::SearchXmlWriter::finish(), Digikam::SearchXmlWriter::finishField(), Digikam::SearchXmlWriter::finishGroup(), Digikam::SearchXml::GreaterThanOrEqual, Digikam::AlbumManager::instance(), Digikam::SearchXml::LessThan, Digikam::AlbumManager::setCurrentAlbums(), Digikam::DatabaseSearch::TimeLineSearch, Digikam::SearchXmlWriter::writeField(), Digikam::SearchXmlWriter::writeGroup(), Digikam::SearchXmlWriter::writeValue(), and Digikam::SearchXmlWriter::xml().

◆ slotSearchDelete

void Digikam::SearchModificationHelper::slotSearchDelete ( SAlbum searchAlbum)
slot

Deletes the given search after prompting the user.

Parameters
searchAlbumsearch to delete

References Digikam::AlbumManager::deleteSAlbum(), Digikam::SAlbum::displayTitle(), and Digikam::AlbumManager::instance().

◆ slotSearchRename

void Digikam::SearchModificationHelper::slotSearchRename ( SAlbum searchAlbum)
slot

Renames the given search via a dialog.

Parameters
searchAlbumsearch to rename

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


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