File indexing completed on 2024-10-06 12:23:33
0001 /* 0002 SPDX-FileCopyrightText: 2010 Ryan Rix <ry@n.rix.si> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef KPACKAGE_PACKAGELOADER_P_H 0008 #define KPACKAGE_PACKAGELOADER_P_H 0009 0010 #include "packagestructure.h" 0011 #include <KPluginMetaData> 0012 0013 namespace KPackage 0014 { 0015 class PackageLoaderPrivate 0016 { 0017 public: 0018 PackageLoaderPrivate() 0019 : isDefaultLoader(false) 0020 , packageStructurePluginDir(QStringLiteral("kpackage/packagestructure")) 0021 { 0022 } 0023 0024 QHash<QString, QPointer<PackageStructure>> structures; 0025 bool isDefaultLoader; 0026 QString packageStructurePluginDir; 0027 // We only use this cache during start of the process to speed up many consecutive calls 0028 // After that, we're too afraid to produce race conditions and it's not that time-critical anyway 0029 // the 20 seconds here means that the cache is only used within 20sec during startup, after that, 0030 // complexity goes up and we'd have to update the cache in order to avoid subtle bugs 0031 // just not using the cache is way easier then, since it doesn't make *that* much of a difference, 0032 // anyway 0033 int maxCacheAge = 20; 0034 qint64 pluginCacheAge = 0; 0035 QHash<QString, QList<KPluginMetaData>> pluginCache; 0036 }; 0037 0038 } 0039 0040 #endif