kdevplatform/serialization
itemrepositoryregistry.cpp
Go to the documentation of this file.
62 qCWarning(SERIALIZATION) << "repository" << path << "was write-locked, it probably is inconsistent";
81 bool userAnswer = askUser(i18np("The previous session crashed.", "Session crashed %1 times in a row.",
86 "Press Clear if you want KDevelop to clear the cache, otherwise press Continue if you are sure the crash has another origin."),
176 // the given session is ours, its cache path is used by the said global item-repository registry.
211 void ItemRepositoryRegistry::registerRepository(AbstractItemRepository* repository, AbstractRepositoryManager* manager)
280 //lockForWriting creates a file, that prevents any other KDevelop instance from using the directory as it is.
287 // Just recreate the directory then; leave old path (as it is dependent on appname and session only).
302 qCWarning(SERIALIZATION) << QStringLiteral("The data-repository at %1 has to be cleared.").arg(path);
340 for (auto it = d->m_repositories.constBegin(), end = d->m_repositories.constEnd(); it != end; ++it) {
344 QFile versionFile(d->m_path + QStringLiteral("/version_%1").arg(staticItemRepositoryVersion()));
372 for (auto it = d->m_repositories.constBegin(), end = d->m_repositories.constEnd(); it != end; ++it) {
const_iterator constBegin() const
virtual void close()
bool resize(qint64 sz)
bool remove()
virtual bool open(QFlags< QIODevice::OpenModeFlag > mode)
int finalCleanup()
Does a big cleanup, removing all non-persistent items in the repositories.
Definition: itemrepositoryregistry.cpp:379
void printAllStatistics() const
Prints the statistics of all registered item-repositories to the command line using qDebug().
Definition: itemrepositoryregistry.cpp:367
void store()
Stores all repositories to disk, eventually unloading unused data to save memory.
Definition: itemrepositoryregistry.cpp:335
virtual void close(bool doStore=false)=0
virtual bool open(const QString &path)=0
static ItemRepositoryRegistry * self()
Definition: itemrepositoryregistry.cpp:167
uint staticItemRepositoryVersion()
Returns a version-number that is used to reset the item-repository after incompatible layout changes.
Definition: abstractitemrepository.cpp:24
QAtomicInt & customCounter(const QString &identity, int initialValue)
Returns a custom counter persistently stored as part of item-repositories in the same directory,...
Definition: itemrepositoryregistry.cpp:194
void lockForWriting()
Marks the directory as inconsistent, so it will be discarded on next startup if the application crash...
Definition: itemrepositoryregistry.cpp:244
void unlockForWriting()
Removes the inconsistency mark set by lockForWriting().
Definition: itemrepositoryregistry.cpp:258
bool isEmpty() const
bool mkpath(const QString &dirPath) const
virtual QString printStatistics() const =0
ItemRepositoryRegistry & globalItemRepositoryRegistry()
The global item-repository registry that is used by default.
Definition: itemrepositoryregistry.cpp:206
void unRegisterRepository(AbstractItemRepository *repository)
Remove a repository.
Definition: itemrepositoryregistry.cpp:265
Internal helper class that wraps around a repository object and manages its lifetime.
Definition: abstractitemrepository.h:51
~ItemRepositoryRegistry()
Definition: itemrepositoryregistry.cpp:406
virtual QString repositoryName() const =0
void registerRepository(AbstractItemRepository *repository, AbstractRepositoryManager *manager)
Add a new repository.
Definition: itemrepositoryregistry.cpp:211
The interface class for an item-repository object.
Definition: abstractitemrepository.h:33
Definition: abstractitemrepository.cpp:23
virtual int finalCleanup()=0
Does a big cleanup, removing all non-persistent items in the repositories.
QString path() const
Definition: itemrepositoryregistry.cpp:226
static void deleteRepositoryFromDisk(const QString &repositoryPath)
Deletes the item-repository of a specified session; or, if it is currently used, marks it for deletio...
Definition: itemrepositoryregistry.cpp:173
static void initialize(const QString &repositoryPath)
Initialize the global item-repository registry for the given session.
Definition: itemrepositoryregistry.cpp:156
Manages a set of item-repositories and allows loading/storing them all at once from/to disk.
Definition: itemrepositoryregistry.h:41
void shutdown()
Indicates that the application has been closed gracefully.
Definition: itemrepositoryregistry.cpp:417
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Apr 10 2021 23:30:57 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Apr 10 2021 23:30:57 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.