File indexing completed on 2024-04-28 03:56:34

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 #include <QHash>
0013 #include <QPointer>
0014 
0015 namespace KPackage
0016 {
0017 class PackageLoaderPrivate
0018 {
0019 public:
0020     QHash<QString, QPointer<PackageStructure>> structures;
0021     // We only use this cache during start of the process to speed up many consecutive calls
0022     // After that, we're too afraid to produce race conditions and it's not that time-critical anyway
0023     // the 20 seconds here means that the cache is only used within 20sec during startup, after that,
0024     // complexity goes up and we'd have to update the cache in order to avoid subtle bugs
0025     // just not using the cache is way easier then, since it doesn't make *that* much of a difference,
0026     // anyway
0027     int maxCacheAge = 20;
0028     qint64 pluginCacheAge = 0;
0029     QHash<QString, QList<KPluginMetaData>> pluginCache;
0030 };
0031 
0032 }
0033 
0034 #endif