digiKam
Loading...
Searching...
No Matches
itemsortcollator.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date : 2020-10-11
7 * Description : item sort based on QCollator
8 *
9 * SPDX-FileCopyrightText: 2020 by Maik Qualmann <metzpinguin at gmail dot com>
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 *
13 * ============================================================ */
14
15#pragma once
16
17// Qt includes
18
19#include <QObject>
20#include <QString>
21
22// Local includes
23
24#include "digikam_export.h"
25
26namespace Digikam
27{
28
29class DIGIKAM_DATABASE_EXPORT ItemSortCollator : public QObject
30{
31 Q_OBJECT
32
33public:
34
39 static ItemSortCollator* instance();
40
41 int itemCompare(const QString& a, const QString& b,
42 Qt::CaseSensitivity caseSensitive, bool natural) const;
43
44 int albumCompare(const QString& a, const QString& b,
45 Qt::CaseSensitivity caseSensitive, bool natural) const;
46
47private:
48
49 // Disable
50
52 explicit ItemSortCollator(QObject*) = delete;
53
54 ~ItemSortCollator() override;
55
56private:
57
58 class Private;
59 Private* const d = nullptr;
60
61 friend class ItemSortCollatorCreator;
62};
63
64} // namespace Digikam
Definition itemsortcollator.h:30
Definition datefolderview.cpp:34