#include <klfliblegacyengine_p.h>
Public Types | |
enum | LegacyLibType { LocalHistoryType = 1, LocalLibraryType, ExportLibraryType } |
Public Slots | |
bool | load (const QString &fname=QString()) |
bool | save (const QString &fname=QString()) |
void | emitResourcePropertyChanged (int propId) |
Signals | |
void | resourcePropertyChanged (int propId) |
Public Member Functions | |
~KLFLibLegacyFileDataPrivate () | |
void | ref () |
int | deref () |
QString | fileName () const |
int | findResourceName (const QString &resname) |
int | getReservedResourceId (const QString &resourceName, int defaultId) |
![]() | |
QObject (QObject *parent=0) | |
blockSignals (bool block) | |
childEvent (QChildEvent *event) | |
children () | |
connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type=Qt::AutoCompatConnection) | |
connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type=Qt::AutoCompatConnection) | |
connectNotify (const char *signal) | |
customEvent (QEvent *event) | |
deleteLater () | |
destroyed (QObject *obj=0) | |
disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) | |
disconnect (const char *signal=0, const QObject *receiver=0, const char *method=0) | |
disconnect (const QObject *receiver, const char *method=0) | |
disconnectNotify (const char *signal) | |
dumpObjectInfo () | |
dumpObjectTree () | |
dynamicPropertyNames () | |
event (QEvent *e) | |
eventFilter (QObject *watched, QEvent *event) | |
findChild (const QString &name=QString() | |
findChildren (const QString &name=QString() | |
findChildren (const QRegExp ®Exp) | |
inherits (const char *className) | |
installEventFilter (QObject *filterObj) | |
isWidgetType () | |
killTimer (int id) | |
metaObject () | |
moveToThread (QThread *targetThread) | |
parent () | |
property (const char *name) | |
receivers (const char *signal) | |
removeEventFilter (QObject *obj) | |
sender () | |
setParent (QObject *parent) | |
setProperty (const char *name, const QVariant &value) | |
signalsBlocked () | |
startTimer (int interval) | |
thread () | |
timerEvent (QTimerEvent *event) | |
tr (const char *sourceText, const char *comment=0, int n=-1) | |
trUtf8 (const char *sourceText, const char *comment=0, int n=-1) | |
staticMetaObject | |
QObject (QObject *parent, const char *name) | |
checkConnectArgs (const char *signal, const QObject *object, const char *method) | |
child (const char *objName, const char *inheritsClass=0, bool recursiveSearch=true) | |
className () | |
insertChild (QObject *object) | |
isA (const char *className) | |
name () | |
name (const char *defaultName) | |
normalizeSignalSlot (const char *signalSlot) | |
removeChild (QObject *object) | |
setName (const char *name) | |
Static Public Member Functions | |
static KLFLibLegacyFileDataPrivate * | instanceFor (const QString fname, bool starttimer) |
static QString | canonicalFilePath (const QString &fname) |
static KLFLibEntry | toLibEntry (const KLFLegacyData::KLFLibraryItem &item) |
static KLFLegacyData::KLFLibraryItem | toLegacyLibItem (const KLFLibEntry &entry) |
static KLFLegacyData::KLFStyle | toLegacyStyle (const KLFStyle &style) |
static KLFStyle | toStyle (const KLFLegacyData::KLFStyle &oldstyle) |
Public Attributes | |
bool | haschanges |
KLFLegacyData::KLFLibrary | library |
KLFLegacyData::KLFLibraryResourceList | resources |
QVariantMap | metadata |
LegacyLibType | legacyLibType |
QTimer * | autoSaveTimer |
Definition at line 39 of file klfliblegacyengine_p.h.
Enumerator | |
---|---|
LocalHistoryType | |
LocalLibraryType | |
ExportLibraryType |
Definition at line 118 of file klfliblegacyengine_p.h.
|
inline |
Saves the file, removes this instance from the static instance list and deletes the timer.
Definition at line 99 of file klfliblegacyengine_p.h.
References autoSaveTimer, haschanges, klfDbg, QMap::remove(), and save().
Returns a path that will be "canonicalized", ie. two (string-wise) different paths pointing to the same file will have the same canonical path (eg. '..' entries simplified, symlinks resolved).
Works for both existing and non-existing files. However for non-existing files the containing directory must exist.
An empty string is returned to indicate an error (eg. containing directory does not exist).
Definition at line 74 of file klfliblegacyengine_p.h.
References QFileInfo::absolutePath(), QFileInfo::canonicalFilePath(), QString::endsWith(), QFileInfo::exists(), QFileInfo::fileName(), QFileInfo::isDir(), QString::isEmpty(), KLF_FUNC_NAME, and klfDbg.
Referenced by KLFLibLegacyEngine::createDotKLF(), instanceFor(), and save().
|
inline |
Dereferences, and returns the remaining number of references to this object. The caller should delete the object if the return value is zero.
Definition at line 113 of file klfliblegacyengine_p.h.
Referenced by KLFLibLegacyEngine::~KLFLibLegacyEngine().
|
inlineslot |
Definition at line 204 of file klfliblegacyengine_p.h.
References resourcePropertyChanged().
Referenced by KLFLibLegacyEngine::saveResourceProperty().
|
inline |
Definition at line 115 of file klfliblegacyengine_p.h.
Referenced by KLFLibLegacyEngine::canModifyData(), and KLFLibLegacyEngine::updateResourceProperty().
int KLFLibLegacyFileDataPrivate::findResourceName | ( | const QString & | resname | ) |
Returns the index in resources
Definition at line 381 of file klfliblegacyengine.cpp.
References resources, and QList::size().
Referenced by KLFLibLegacyEngine::allEntries(), KLFLibLegacyEngine::changeEntries(), KLFLibLegacyEngine::deleteEntries(), KLFLibLegacyEngine::deleteSubResource(), KLFLibLegacyEngine::entry(), KLFLibLegacyEngine::insertEntries(), and KLFLibLegacyEngine::renameSubResource().
int KLFLibLegacyFileDataPrivate::getReservedResourceId | ( | const QString & | resourceName, |
int | defaultId | ||
) |
Definition at line 365 of file klfliblegacyengine.cpp.
References QString::compare(), KLFLegacyData::LibResource_Archive, KLFLegacyData::LibResource_History, and QString::localeAwareCompare().
Referenced by KLFLibLegacyEngine::createSubResource(), and KLFLibLegacyEngine::renameSubResource().
|
inlinestatic |
Get the KLFLibLegacyFileDataPrivate instance assigned to file fname
. The file data is already loaded, ie. don't call load().
Don't forget to call ref() to reference the returned object.
autoSaveTimer
is instantiated and started; however you must
Definition at line 50 of file klfliblegacyengine_p.h.
References autoSaveTimer, canonicalFilePath(), QMap::contains(), QString::isEmpty(), KLF_FUNC_NAME, klfDbg, and QTimer::start().
Loads the current object from the file.
Definition at line 185 of file klfliblegacyengine.cpp.
References QList::append(), QDataStream::atEnd(), ExportLibraryType, haschanges, KLFLegacyData::KLFLibraryResource::id, QString::isEmpty(), KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfDbg, legacyLibType, library, KLFLegacyData::LibResource_History, LocalHistoryType, LocalLibraryType, KLFLegacyData::KLFLibraryItem::MaxId, metadata, KLFLegacyData::KLFLibraryResource::name, QFile::open(), resources, QDataStream::setVersion(), QList::size(), QDataStream::status(), and QObject::tr().
|
inline |
Should be called explicitely by any class that wishes to use this instance. See also deref()
Definition at line 110 of file klfliblegacyengine_p.h.
|
signal |
Referenced by emitResourcePropertyChanged().
Saves the current object to the file
Definition at line 267 of file klfliblegacyengine.cpp.
References canonicalFilePath(), QMessageBox::critical(), QString::endsWith(), ExportLibraryType, QFileInfo::fileName(), haschanges, KLFConfig::homeConfigDir, QDir::homePath(), QString::isEmpty(), KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfconfig, klfDbg, legacyLibType, library, LocalHistoryType, LocalLibraryType, KLFLegacyData::KLFLibraryItem::MaxId, metadata, QObject::name(), resources, QDataStream::setVersion(), QList::size(), QString::startsWith(), QObject::tr(), and QMessageBox::warning().
Referenced by KLFLibLegacyEngine::save(), KLFLibLegacyEngine::saveTo(), KLFLibLegacyEngine::~KLFLibLegacyEngine(), and ~KLFLibLegacyFileDataPrivate().
|
inlinestatic |
Definition at line 154 of file klfliblegacyengine_p.h.
References KLFLibEntry::category(), KLFLegacyData::KLFLibraryItem::category, KLFLegacyData::KLFLibraryItem::datetime, KLFLibEntry::dateTime(), QPixmap::fromImage(), KLFLegacyData::KLFLibraryItem::id, KLFLibEntry::latex(), KLFLegacyData::KLFLibraryItem::latex, KLFLibEntry::latexAddCategoryTagsComment(), KLFLegacyData::KLFLibraryItem::MaxId, KLFLibEntry::preview(), KLFLegacyData::KLFLibraryItem::preview, KLFLibEntry::stripCategoryTagsFromLatex(), KLFLibEntry::style(), KLFLegacyData::KLFLibraryItem::style, KLFLibEntry::tags(), KLFLegacyData::KLFLibraryItem::tags, and toLegacyStyle().
Referenced by KLFLibLegacyEngine::insertEntries().
|
inlinestatic |
Definition at line 168 of file klfliblegacyengine_p.h.
References KLFStyle::bg_color, KLFLegacyData::KLFStyle::bg_color, KLFStyle::dpi, KLFLegacyData::KLFStyle::dpi, KLFStyle::fg_color, KLFLegacyData::KLFStyle::fg_color, KLFStyle::mathmode, KLFLegacyData::KLFStyle::mathmode, KLFStyle::name, KLFLegacyData::KLFStyle::name, KLFStyle::preamble, and KLFLegacyData::KLFStyle::preamble.
Referenced by KLFLibLegacyEngine::changeEntries(), and toLegacyLibItem().
|
inlinestatic |
Definition at line 148 of file klfliblegacyengine_p.h.
References KLFLegacyData::KLFLibraryItem::category, KLFLegacyData::KLFLibraryItem::datetime, KLFLegacyData::KLFLibraryItem::latex, KLFLegacyData::KLFLibraryItem::preview, QPixmap::size(), KLFLibEntry::stripCategoryTagsFromLatex(), KLFLegacyData::KLFLibraryItem::style, KLFLegacyData::KLFLibraryItem::tags, QPixmap::toImage(), and toStyle().
Referenced by KLFLibLegacyEngine::allEntries(), and KLFLibLegacyEngine::entry().
|
inlinestatic |
Definition at line 179 of file klfliblegacyengine_p.h.
References KLFStyle::bg_color, KLFLegacyData::KLFStyle::bg_color, KLFStyle::dpi, KLFLegacyData::KLFStyle::dpi, KLFStyle::fg_color, KLFLegacyData::KLFStyle::fg_color, KLFStyle::mathmode, KLFLegacyData::KLFStyle::mathmode, KLFStyle::name, KLFLegacyData::KLFStyle::name, KLFStyle::preamble, and KLFLegacyData::KLFStyle::preamble.
Referenced by toLibEntry().
QTimer* KLFLibLegacyFileDataPrivate::autoSaveTimer |
Definition at line 140 of file klfliblegacyengine_p.h.
Referenced by instanceFor(), KLFLibLegacyEngine::setAutoSaveInterval(), and ~KLFLibLegacyFileDataPrivate().
bool KLFLibLegacyFileDataPrivate::haschanges |
Definition at line 120 of file klfliblegacyengine_p.h.
Referenced by KLFLibLegacyEngine::changeEntries(), KLFLibLegacyEngine::createSubResource(), KLFLibLegacyEngine::deleteEntries(), KLFLibLegacyEngine::insertEntries(), load(), save(), KLFLibLegacyEngine::saveResourceProperty(), KLFLibLegacyEngine::~KLFLibLegacyEngine(), and ~KLFLibLegacyFileDataPrivate().
LegacyLibType KLFLibLegacyFileDataPrivate::legacyLibType |
Definition at line 138 of file klfliblegacyengine_p.h.
KLFLegacyData::KLFLibrary KLFLibLegacyFileDataPrivate::library |
upon modification, DON'T FORGET to set haschanges !
Definition at line 123 of file klfliblegacyengine_p.h.
Referenced by KLFLibLegacyEngine::allEntries(), KLFLibLegacyEngine::changeEntries(), KLFLibLegacyEngine::createSubResource(), KLFLibLegacyEngine::deleteEntries(), KLFLibLegacyEngine::deleteSubResource(), KLFLibLegacyEngine::entry(), KLFLibLegacyEngine::insertEntries(), load(), KLFLibLegacyEngine::renameSubResource(), save(), and KLFLibLegacyEngine::~KLFLibLegacyEngine().
QVariantMap KLFLibLegacyFileDataPrivate::metadata |
Metadata, may be used for any purpose.
upon modification, DON'T FORGET to set haschanges !
List of properties:
"ResProps"
: a QVariantMap with all resource properties as { 'name' => value }Definition at line 136 of file klfliblegacyengine_p.h.
Referenced by load(), save(), KLFLibLegacyEngine::saveResourceProperty(), and KLFLibLegacyEngine::updateResourceProperty().
KLFLegacyData::KLFLibraryResourceList KLFLibLegacyFileDataPrivate::resources |
upon modification, DON'T FORGET to set haschanges !
Definition at line 125 of file klfliblegacyengine_p.h.
Referenced by KLFLibLegacyEngine::allEntries(), KLFLibLegacyEngine::changeEntries(), KLFLibLegacyEngine::createSubResource(), KLFLibLegacyEngine::deleteEntries(), KLFLibLegacyEngine::deleteSubResource(), KLFLibLegacyEngine::entry(), findResourceName(), KLFLibLegacyEngine::insertEntries(), load(), KLFLibLegacyEngine::renameSubResource(), save(), KLFLibLegacyEngine::subResourceList(), and KLFLibLegacyEngine::~KLFLibLegacyEngine().