1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date        : 2007-03-21
7  * Description : Collection scanning to database.
8  *
9  * Copyright (C) 2005      by Renchi Raju <renchi dot raju at gmail dot com>
10  * Copyright (C) 2005-2006 by Tom Albers <tomalbers at kde dot nl>
11  * Copyright (C) 2007-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
12  * Copyright (C) 2009-2021 by Gilles Caulier <caulier dot gilles at gmail dot com>
13  *
14  * This program is free software; you can redistribute it
15  * and/or modify it under the terms of the GNU General
16  * Public License as published by the Free Software Foundation;
17  * either version 2, or (at your option)
18  * any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23  * GNU General Public License for more details.
24  *
25  * ============================================================ */
26 
27 #include "collectionscanner_p.h"
28 
29 namespace Digikam
30 {
31 
CollectionScanner()32 CollectionScanner::CollectionScanner()
33     : d(new Private)
34 {
35 }
36 
~CollectionScanner()37 CollectionScanner::~CollectionScanner()
38 {
39     delete d;
40 }
41 
setSignalsEnabled(bool on)42 void CollectionScanner::setSignalsEnabled(bool on)
43 {
44     d->wantSignals = on;
45 }
46 
setNeedFileCount(bool on)47 void CollectionScanner::setNeedFileCount(bool on)
48 {
49     d->needTotalFiles = on;
50 }
51 
setPerformFastScan(bool on)52 void CollectionScanner::setPerformFastScan(bool on)
53 {
54     d->performFastScan = on;
55 }
56 
createHintContainer()57 CollectionScannerHintContainer* CollectionScanner::createHintContainer()
58 {
59     return new CollectionScannerHintContainerImplementation;
60 }
61 
setHintContainer(CollectionScannerHintContainer * const container)62 void CollectionScanner::setHintContainer(CollectionScannerHintContainer* const container)
63 {
64     // the API specs require the object given here to be created by createContainer, so we can cast.
65 
66     d->hints = static_cast<CollectionScannerHintContainerImplementation*>(container);
67 }
68 
setUpdateHashHint(bool hint)69 void CollectionScanner::setUpdateHashHint(bool hint)
70 {
71     d->updatingHashHint = hint;
72 }
73 
setObserver(CollectionScannerObserver * const observer)74 void CollectionScanner::setObserver(CollectionScannerObserver* const observer)
75 {
76     d->observer = observer;
77 }
78 
setDeferredFileScanning(bool defer)79 void CollectionScanner::setDeferredFileScanning(bool defer)
80 {
81     d->deferredFileScanning = defer;
82 }
83 
deferredAlbumPaths() const84 QStringList CollectionScanner::deferredAlbumPaths() const
85 {
86     return d->deferredAlbumPaths.values();
87 }
88 
89 } // namespace Digikam
90