digiKam
|
Classes | |
class | FileMetadataWrite |
class | Private |
Public Types | |
enum | Advice { Success , ContinueWithoutDatabase , AbortImmediately } |
enum | UpdateResult { UpdateSuccess , UpdateError , UpdateErrorMustAbort } |
Public Member Functions | |
void | allowToScanDeferredFiles () |
QList< qlonglong > | getNewIdsList () const |
ItemInfo | scannedInfo (const QString &filePath) |
void | updateUniqueHash () |
Static Public Member Functions | |
static ScanController * | instance () |
Protected Member Functions | |
void | run () override |
Stop Operations | |
class | ScanControllerCreator |
void | shutDown () |
void | abortInitialization () |
void | cancelCompleteScan () |
void | cancelAllAndSuspendCollectionScan () |
void | suspendCollectionScan () |
void | finishFileMetadataWrite (const ItemInfo &info, bool changed) |
void | collectionScanFinished () |
void | newImages (const ItemInfoList &) |
void | partialScanDone (const QString &path) |
void | completeScanDone () |
void | completeScanCanceled () |
void | errorFromInitialization (const QString &) |
Start Operations | |
Advice | databaseInitialization () |
void | completeCollectionScan (bool defer=false) |
void | completeCollectionScanDeferFiles () |
void | completeCollectionScanInBackground (bool defer, bool fastScan=true) |
void | scheduleCollectionScan (const QString &path) |
void | scheduleCollectionScanRelaxed (const QString &path) |
void | scheduleCollectionScanExternal (const QString &path) |
void | beginFileMetadataWrite (const ItemInfo &info) |
void | resumeCollectionScan () |
void | databaseInitialized (bool success) |
void | collectionScanStarted (const QString &message) |
Progress Operations | |
void | hintAtMoveOrCopyOfAlbum (const PAlbum *const album, const PAlbum *const dstAlbum, const QString &newAlbumName=QString()) |
void | hintAtMoveOrCopyOfAlbum (const PAlbum *const album, const QString &dstPath, const QString &newAlbumName=QString()) |
void | hintAtMoveOrCopyOfItems (const QList< qlonglong > &ids, const PAlbum *const dstAlbum, const QStringList &itemNames) |
void | hintAtMoveOrCopyOfItem (qlonglong id, const PAlbum *const dstAlbum, const QString &itemName) |
void | hintAtModificationOfItems (const QList< qlonglong > &ids) |
void | hintAtModificationOfItem (qlonglong id) |
void | totalFilesToScan (int) |
void | filesScanned (int) |
void | scanningProgress (float progress) |
void | triggerShowProgressDialog () |
void | incrementProgressDialog (int) |
void | progressFromInitialization (const QString &, int) |
|
inherited |
void Digikam::ScanController::abortInitialization | ( | ) |
If the controller is currently processing a database update (typically after first run), cancel this hard and as soon as possible. Any progress may be lost.
References Digikam::ScanController::Private::continueInitialization, Digikam::ScanController::Private::mutex, and Digikam::ScanController::Private::needsInitialization.
void Digikam::ScanController::allowToScanDeferredFiles | ( | ) |
void Digikam::ScanController::beginFileMetadataWrite | ( | const ItemInfo & | info | ) |
Implementation of FileMetadataWrite, see there. Calling these methods is equivalent.
References Digikam::ItemMetadataAdjustmentHint::AboutToEditMetadata, Digikam::ItemInfo::filePath(), Digikam::ScanController::Private::hints, Digikam::ItemInfo::id(), and Digikam::CollectionScannerHintContainer::recordHint().
Referenced by Digikam::ScanController::FileMetadataWrite::FileMetadataWrite().
void Digikam::ScanController::cancelAllAndSuspendCollectionScan | ( | ) |
Cancels all running or scheduled operations and suspends scanning. This method returns when all scanning has stopped. This includes a call to suspendCollectionScan(). Restart with resumeCollectionScan.
References Digikam::ScanController::Private::condVar, Digikam::ScanController::Private::continueInitialization, Digikam::ScanController::Private::continuePartialScan, Digikam::ScanController::Private::continueScan, Digikam::ScanController::Private::idle, Digikam::ScanController::Private::mutex, Digikam::ScanController::Private::needsCompleteScan, Digikam::ScanController::Private::needsInitialization, Digikam::ScanController::Private::relaxedTimer, Digikam::ScanController::Private::scanSuspended, and Digikam::ScanController::Private::scanTasks.
Referenced by Digikam::AlbumManager::setDatabase().
void Digikam::ScanController::cancelCompleteScan | ( | ) |
If the controller is currently doing a complete scan (typically at startup), stop this operation. It can be resumed later.
References completeScanCanceled(), Digikam::ScanController::Private::continueScan, Digikam::ScanController::Private::mutex, and Digikam::ScanController::Private::needsCompleteScan.
|
signal |
Referenced by run().
|
signal |
Referenced by run().
void Digikam::ScanController::completeCollectionScan | ( | bool | defer = false | ) |
Carries out a complete collection scan, providing progress feedback. Synchronous, returns when ready. The database will be locked while the scan is running. With the DeferFiles variant, deep files scanning (new files), the part which can take long, will be done during the time after the method returns, shortening the synchronous wait. After completeCollectionScanDeferFiles, you need to call allowToScanDeferredFiles() once to enable scanning the deferred files.
References Digikam::CollectionScanner::databaseInitialScanDone(), and Digikam::ScanController::Private::progressDialog.
Referenced by Digikam::AlbumManager::changeDatabase(), and completeCollectionScanDeferFiles().
void Digikam::ScanController::completeCollectionScanDeferFiles | ( | ) |
References completeCollectionScan().
Referenced by Digikam::DigikamApp::DigikamApp().
void Digikam::ScanController::completeCollectionScanInBackground | ( | bool | defer, |
bool | fastScan = true |
||
) |
Scan Whole collection without to display a progress dialog or to manage splashscreen, as for NewItemsFinder tool.
Referenced by Digikam::SetupMime::applySettings(), and Digikam::SetupCollections::applySettings().
|
signal |
Referenced by cancelCompleteScan().
|
signal |
Referenced by run().
ScanController::Advice Digikam::ScanController::databaseInitialization | ( | ) |
Calls CoreDbAccess::checkReadyForUse(), providing progress feedback if schema updating occurs. Synchronous, returns when ready.
References Digikam::ScanController::Private::advice, Digikam::LoadingCache::cache(), Digikam::ScanController::Private::condVar, Digikam::ScanController::Private::eventLoop, Digikam::ScanController::Private::fileWatchInstalled, Digikam::ScanController::Private::mutex, Digikam::ScanController::Private::needsInitialization, Digikam::ScanController::Private::progressDialog, Digikam::LoadingCache::setFileWatch(), and Success.
Referenced by Digikam::AlbumManager::setDatabase().
|
signal |
Referenced by run().
|
signal |
|
signal |
void Digikam::ScanController::finishFileMetadataWrite | ( | const ItemInfo & | info, |
bool | changed | ||
) |
Implementation of FileMetadataWrite, see there. Calling these methods is equivalent.
References Digikam::ItemInfo::filePath(), Digikam::ScanController::Private::hints, Digikam::ItemInfo::id(), Digikam::ItemMetadataAdjustmentHint::MetadataEditingAborted, Digikam::ItemMetadataAdjustmentHint::MetadataEditingFinished, and Digikam::CollectionScannerHintContainer::recordHint().
Referenced by Digikam::ScanController::FileMetadataWrite::~FileMetadataWrite().
QList< qlonglong > Digikam::ScanController::getNewIdsList | ( | ) | const |
Returns item ids from new detected items
References Digikam::ScanController::Private::newIdsList.
void Digikam::ScanController::hintAtModificationOfItem | ( | qlonglong | id | ) |
void Digikam::ScanController::hintAtModificationOfItems | ( | const QList< qlonglong > & | ids | ) |
Hint at the fact that an item may have changed, although its modification date may not have changed. Note that a scan of the containing directory will need to be triggered nonetheless for the hints to take effect.
References Digikam::ScanController::Private::garbageCollectHints(), Digikam::ScanController::Private::hints, Digikam::ItemChangeHint::ItemModified, and Digikam::CollectionScannerHintContainer::recordHints().
void Digikam::ScanController::hintAtMoveOrCopyOfAlbum | ( | const PAlbum *const | album, |
const PAlbum *const | dstAlbum, | ||
const QString & | newAlbumName = QString() |
||
) |
Hint at the imminent copy, move or rename of an album, so that the collection scanner is informed about this. If the album is renamed, give the new name in newAlbumName. DstAlbum is the new parent album / dstPath is the new parent directory of the album, so do not include the album name to dstPath.
References Digikam::PAlbum::albumPath(), Digikam::PAlbum::albumRootId(), Digikam::ScanController::Private::hints, Digikam::CollectionScannerHintContainer::recordHints(), and Digikam::Album::title().
void Digikam::ScanController::hintAtMoveOrCopyOfAlbum | ( | const PAlbum *const | album, |
const QString & | dstPath, | ||
const QString & | newAlbumName = QString() |
||
) |
void Digikam::ScanController::hintAtMoveOrCopyOfItem | ( | qlonglong | id, |
const PAlbum *const | dstAlbum, | ||
const QString & | itemName | ||
) |
void Digikam::ScanController::hintAtMoveOrCopyOfItems | ( | const QList< qlonglong > & | ids, |
const PAlbum *const | dstAlbum, | ||
const QStringList & | itemNames | ||
) |
Hint at the imminent copy, move or rename of items, so that the collection scanner is informed about this. Give the list of existing items, specify the destination with dstAlbum, and give the names at destination in itemNames (Unless for rename, names wont usually change. Give them nevertheless.)
References Digikam::PAlbum::albumRootId(), Digikam::ScanController::Private::garbageCollectHints(), Digikam::ScanController::Private::hints, Digikam::Album::id(), and Digikam::CollectionScannerHintContainer::recordHints().
|
signal |
|
static |
Referenced by Digikam::SetupMime::applySettings(), Digikam::SetupCollections::applySettings(), Digikam::AlbumManager::changeDatabase(), Digikam::FileActionMngrDatabaseWorker::copyAttributes(), Digikam::DigikamApp::DigikamApp(), Digikam::ScanController::FileMetadataWrite::FileMetadataWrite(), Digikam::NewItemsFinder::NewItemsFinder(), Digikam::AlbumManager::renamePAlbum(), Digikam::AlbumManager::setDatabase(), Digikam::FileActionMngrFileWorker::transform(), Digikam::FileActionMngrFileWorker::writeMetadata(), Digikam::FileActionMngrFileWorker::writeMetadataToFiles(), Digikam::DigikamApp::~DigikamApp(), and Digikam::ScanController::FileMetadataWrite::~FileMetadataWrite().
|
signal |
|
signal |
Referenced by run().
|
signal |
void Digikam::ScanController::resumeCollectionScan | ( | ) |
Resume a suspended collection scanning. All scheduled scanning tasks are queued and will be done when resumeCollectionScan() has been called. Calling these methods is recursive, you must resume as often as you called suspend.
References Digikam::ScanController::Private::condVar, Digikam::ScanController::Private::mutex, and Digikam::ScanController::Private::scanSuspended.
Referenced by Digikam::AlbumManager::renamePAlbum(), Digikam::AlbumManager::setDatabase(), Digikam::FileActionMngrFileWorker::transform(), Digikam::FileActionMngrFileWorker::writeMetadata(), and Digikam::FileActionMngrFileWorker::writeMetadataToFiles().
|
overrideprotected |
References Digikam::ScanController::Private::advice, Digikam::CoreDbAccess::backend(), Digikam::CoreDbAccess::checkReadyForUse(), collectionScanFinished(), collectionScanStarted(), Digikam::CollectionScanner::completeScan(), Digikam::ScanController::Private::completeScanDeferredAlbums, completeScanDone(), Digikam::ScanController::Private::condVar, Digikam::ScanController::Private::continueInitialization, Digikam::ScanController::Private::continuePartialScan, Digikam::ScanController::Private::continueScan, ContinueWithoutDatabase, databaseInitialized(), Digikam::CoreDbAccess::db(), Digikam::ScanController::Private::deferFileScanning, Digikam::CollectionScanner::deferredAlbumPaths(), Digikam::CollectionScanner::finishCompleteScan(), Digikam::ScanController::Private::finishScanAllowed, Digikam::CollectionScanner::getNewIdsList(), Digikam::ScanController::Private::hints, Digikam::ScanController::Private::idle, Digikam::ScanController::Private::mutex, Digikam::ScanController::Private::needsCompleteScan, Digikam::ScanController::Private::needsInitialization, Digikam::ScanController::Private::needsUpdateUniqueHash, Digikam::ScanController::Private::needTotalFiles, Digikam::ScanController::Private::newIdsList, Digikam::CoreDbAccess::parameters(), Digikam::CollectionScanner::partialScan(), partialScanDone(), Digikam::ScanController::Private::performFastScan, Digikam::ScanController::Private::running, Digikam::ScanController::Private::scanSuspended, Digikam::ScanController::Private::scanTasks, Digikam::CoreDbSchemaUpdater::setCoreDbAccess(), Digikam::CollectionScanner::setDeferredFileScanning(), Digikam::CollectionScanner::setHintContainer(), Digikam::CollectionScanner::setNeedFileCount(), Digikam::CollectionScanner::setObserver(), Digikam::CoreDbSchemaUpdater::setObserver(), Digikam::CollectionScanner::setPerformFastScan(), Success, and Digikam::CoreDbSchemaUpdater::updateUniqueHash().
ItemInfo Digikam::ScanController::scannedInfo | ( | const QString & | filePath | ) |
If necessary (modified or newly created, scans the file directly Returns the up-to-date ItemInfo.
References Digikam::ItemInfo::fromLocalFile(), Digikam::ScanController::Private::hints, Digikam::ItemInfo::isNull(), Digikam::CollectionScanner::NormalScan, Digikam::CollectionScanner::scanFile(), and Digikam::CollectionScanner::setHintContainer().
Referenced by Digikam::FileActionMngrDatabaseWorker::copyAttributes().
|
signal |
void Digikam::ScanController::scheduleCollectionScan | ( | const QString & | path | ) |
Schedules a scan of the specified part of the collection. Asynchronous, returns immediately.
References Digikam::ScanController::Private::condVar, Digikam::ScanController::Private::mutex, and Digikam::ScanController::Private::scanTasks.
void Digikam::ScanController::scheduleCollectionScanExternal | ( | const QString & | path | ) |
Schedules a scan of the specified part of the collection. Asynchronous, returns immediately. A very long delay with timer restart may be introduced before the actual scanning starts, so that you can call this often without checking for duplicates. This method is only for the QFileSystemWatcher.
References Digikam::ScanController::Private::externalTimer, Digikam::ScanController::Private::mutex, and Digikam::ScanController::Private::scanTasks.
void Digikam::ScanController::scheduleCollectionScanRelaxed | ( | const QString & | path | ) |
Schedules a scan of the specified part of the collection. Asynchronous, returns immediately. A small delay may be introduced before the actual scanning starts, so that you can call this often without checking for duplicates. This method must only be used from the main thread.
References Digikam::ScanController::Private::mutex, Digikam::ScanController::Private::relaxedTimer, and Digikam::ScanController::Private::scanTasks.
void Digikam::ScanController::shutDown | ( | ) |
Wait for the thread to finish. Returns after all tasks are done.
References Digikam::ScanController::Private::condVar, Digikam::ScanController::Private::continueInitialization, Digikam::ScanController::Private::continuePartialScan, Digikam::ScanController::Private::continueScan, Digikam::ScanController::Private::mutex, and Digikam::ScanController::Private::running.
Referenced by Digikam::DigikamApp::~DigikamApp().
void Digikam::ScanController::suspendCollectionScan | ( | ) |
Temporarily suspend collection scanning. All scheduled scanning tasks are queued and will be done when resumeCollectionScan() has been called. Calling these methods is recursive, you must resume as often as you called suspend.
References Digikam::ScanController::Private::mutex, and Digikam::ScanController::Private::scanSuspended.
Referenced by Digikam::AlbumManager::renamePAlbum(), Digikam::FileActionMngrFileWorker::transform(), Digikam::FileActionMngrFileWorker::writeMetadata(), and Digikam::FileActionMngrFileWorker::writeMetadataToFiles().
|
signal |
|
signal |
void Digikam::ScanController::updateUniqueHash | ( | ) |
Carries out a complete collection scan, at the same time updating the unique hash in the database and thumbnail database. Synchronous, returns when ready. The database will be locked while the scan is running.
References Digikam::ScanController::Private::condVar, Digikam::ScanController::Private::eventLoop, Digikam::ScanController::Private::mutex, Digikam::ScanController::Private::needsUpdateUniqueHash, Digikam::ScanController::Private::needTotalFiles, and Digikam::ScanController::Private::progressDialog.
|
friend |