File indexing completed on 2023-11-26 08:17:50

0001 /*
0002    SPDX-FileCopyrightText: 2018-2023 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "libruqolacore_export.h"
0010 #include <QHash>
0011 #include <QString>
0012 
0013 class LIBRUQOLACORE_EXPORT ManagerDataPaths
0014 {
0015 public:
0016     enum PathType {
0017         Config = 0,
0018         Cache = 1,
0019         Picture = 2,
0020         Video = 3,
0021     };
0022     ManagerDataPaths();
0023     static ManagerDataPaths *self();
0024 
0025     [[nodiscard]] QString path(PathType type, const QString &accountName, const QString &subdirectory = QString()) const;
0026 
0027     [[nodiscard]] QString accountConfigFileName(const QString &accountName) const;
0028     [[nodiscard]] QString accountAvatarConfigPath(const QString &accountName) const;
0029 
0030 private:
0031     LIBRUQOLACORE_NO_EXPORT void initializePaths();
0032     QHash<ManagerDataPaths::PathType, QString> mPathTypeHash;
0033     [[nodiscard]] QString accountConfigPath(const QString &accountName) const;
0034 };