kdevelop/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."),
172 // the given session is ours, its cache path is used by the said global item-repository registry.
207 void ItemRepositoryRegistry::registerRepository(AbstractItemRepository* repository, AbstractRepositoryManager* manager)
276 //lockForWriting creates a file, that prevents any other KDevelop instance from using the directory as it is.
283 // Just recreate the directory then; leave old path (as it is dependent on appname and session only).
298 qCWarning(SERIALIZATION) << QStringLiteral("The data-repository at %1 has to be cleared.").arg(path);
336 for (auto it = d->m_repositories.constBegin(), end = d->m_repositories.constEnd(); it != end; ++it) {
340 QFile versionFile(d->m_path + QStringLiteral("/version_%1").arg(staticItemRepositoryVersion()));
368 for (auto it = d->m_repositories.constBegin(), end = d->m_repositories.constEnd(); it != end; ++it) {
381 for (auto it = d->m_repositories.constBegin(), end = d->m_repositories.constEnd(); it != end; ++it) {
void lockForWriting()
Marks the directory as inconsistent, so it will be discarded on next startup if the application crash...
Definition: itemrepositoryregistry.cpp:240
The interface class for an item-repository object.
Definition: abstractitemrepository.h:33
virtual bool open(const QString &path)=0
bool resize(qint64 sz)
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:190
bool remove()
virtual int finalCleanup()=0
Does a big cleanup, removing all non-persistent items in the repositories.
virtual QString printStatistics() const =0
const_iterator constBegin() const
void printAllStatistics() const
Prints the statistics of all registered item-repositories to the command line using qDebug()...
Definition: itemrepositoryregistry.cpp:363
void shutdown()
Indicates that the application has been closed gracefully.
Definition: itemrepositoryregistry.cpp:413
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:169
~ItemRepositoryRegistry()
Definition: itemrepositoryregistry.cpp:402
void unRegisterRepository(AbstractItemRepository *repository)
Remove a repository.
Definition: itemrepositoryregistry.cpp:261
void registerRepository(AbstractItemRepository *repository, AbstractRepositoryManager *manager)
Add a new repository.
Definition: itemrepositoryregistry.cpp:207
bool isEmpty() const
ItemRepositoryRegistry & globalItemRepositoryRegistry()
The global item-repository registry that is used by default.
Definition: itemrepositoryregistry.cpp:202
int finalCleanup()
Does a big cleanup, removing all non-persistent items in the repositories.
Definition: itemrepositoryregistry.cpp:375
virtual bool open(QFlags< QIODevice::OpenModeFlag > mode)
QString path() const
Definition: itemrepositoryregistry.cpp:222
static void initialize(const QString &repositoryPath)
Initialize the global item-repository registry for the given session.
Definition: itemrepositoryregistry.cpp:154
Manages a set of item-repositories and allows loading/storing them all at once from/to disk...
Definition: itemrepositoryregistry.h:41
Internal helper class that wraps around a repository object and manages its lifetime.
Definition: abstractitemrepository.h:51
virtual void close()
void store()
Stores all repositories to disk, eventually unloading unused data to save memory. ...
Definition: itemrepositoryregistry.cpp:331
virtual void close(bool doStore=false)=0
uint staticItemRepositoryVersion()
Returns a version-number that is used to reset the item-repository after incompatible layout changes...
Definition: abstractitemrepository.cpp:24
void unlockForWriting()
Removes the inconsistency mark set by lockForWriting().
Definition: itemrepositoryregistry.cpp:254
bool mkpath(const QString &dirPath) const
virtual QString repositoryName() const =0
static ItemRepositoryRegistry * self()
Definition: itemrepositoryregistry.cpp:163
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Fri Dec 6 2019 04:51:35 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2019 The KDE developers.
Generated on Fri Dec 6 2019 04:51:35 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.