Debian Codegraph @

core/libs/album/manager/albummanager_p.cpp

raw
1 /* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date : 2004-06-15
7 * Description : Albums manager interface - private containers.
8 *
9 * SPDX-FileCopyrightText: 2006-2026 by Gilles Caulier <caulier dot gilles at gmail dot com>
10 * SPDX-FileCopyrightText: 2006-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
11 * SPDX-FileCopyrightText: 2015 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
12 *
13 * SPDX-License-Identifier: GPL-2.0-or-later
14 *
15 * ============================================================ */
16
17 #include "albummanager_p.h"
18
19 namespace Digikam
20 {
21
22 PAlbumPath::PAlbumPath(int albumRootId, const QString& albumPath)
23 : albumRootId(albumRootId),
24 albumPath (albumPath)
25 {
26 }
27
28 PAlbumPath::PAlbumPath(const PAlbum* const album)
29 {
30 if (album->isRoot())
31 {
32 albumRootId = -1;
33 }
34 else
35 {
36 albumRootId = album->albumRootId();
37 albumPath = album->albumPath();
38 }
39 }
40
41 bool PAlbumPath::operator==(const PAlbumPath& other) const
42 {
43 return (
44 (other.albumRootId == albumRootId) &&
45 (other.albumPath == albumPath)
46 );
47 }
48
49 // -----------------------------------------------------------------------------------
50
51 QString AlbumManager::Private::labelForAlbumRootAlbum(const CollectionLocation& location)
52 {
53 QString label = location.label();
54
55 if (label.isEmpty())
56 {
57 label = location.albumRootPath();
58 }
59
60 return label;
61 }
62
63 // -----------------------------------------------------------------------------------
64
65 ChangingDB::ChangingDB(AlbumManager::Private* const dd)
66 : d(dd)
67 {
68 d->changingDB = true;
69 }
70
71 ChangingDB::~ChangingDB()
72 {
73 d->changingDB = false;
74 }
75
76 } // namespace Digikam