#include <klfliblegacyengine_p.h>
Definition at line 39 of file klfliblegacyengine_p.h.
Definition at line 118 of file klfliblegacyengine_p.h.
KLFLibLegacyFileDataPrivate::~KLFLibLegacyFileDataPrivate | ( | ) | [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().
static QString KLFLibLegacyFileDataPrivate::canonicalFilePath | ( | const QString & | fname | ) | [inline, static] |
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().
int KLFLibLegacyFileDataPrivate::deref | ( | ) | [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().
void KLFLibLegacyFileDataPrivate::emitResourcePropertyChanged | ( | int | propId | ) | [inline, slot] |
Definition at line 204 of file klfliblegacyengine_p.h.
References resourcePropertyChanged().
Referenced by KLFLibLegacyEngine::saveResourceProperty().
QString KLFLibLegacyFileDataPrivate::fileName | ( | ) | const [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().
static KLFLibLegacyFileDataPrivate* KLFLibLegacyFileDataPrivate::instanceFor | ( | const QString | fname, |
bool | starttimer | ||
) | [inline, static] |
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().
void KLFLibLegacyFileDataPrivate::ref | ( | ) | [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.
void KLFLibLegacyFileDataPrivate::resourcePropertyChanged | ( | int | propId | ) | [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().
static KLFLegacyData::KLFLibraryItem KLFLibLegacyFileDataPrivate::toLegacyLibItem | ( | const KLFLibEntry & | entry | ) | [inline, static] |
Definition at line 154 of file klfliblegacyengine_p.h.
References KLFLegacyData::KLFLibraryItem::category, KLFLibEntry::category(), KLFLibEntry::dateTime(), KLFLegacyData::KLFLibraryItem::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, KLFLegacyData::KLFLibraryItem::tags, KLFLibEntry::tags(), and toLegacyStyle().
Referenced by KLFLibLegacyEngine::insertEntries().
static KLFLegacyData::KLFStyle KLFLibLegacyFileDataPrivate::toLegacyStyle | ( | const KLFStyle & | style | ) | [inline, static] |
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().
static KLFLibEntry KLFLibLegacyFileDataPrivate::toLibEntry | ( | const KLFLegacyData::KLFLibraryItem & | item | ) | [inline, static] |
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().
static KLFStyle KLFLibLegacyFileDataPrivate::toStyle | ( | const KLFLegacyData::KLFStyle & | oldstyle | ) | [inline, static] |
Definition at line 179 of file klfliblegacyengine_p.h.
References KLFLegacyData::KLFStyle::bg_color, KLFStyle::bg_color, KLFLegacyData::KLFStyle::dpi, KLFStyle::dpi, KLFLegacyData::KLFStyle::fg_color, KLFStyle::fg_color, KLFLegacyData::KLFStyle::mathmode, KLFStyle::mathmode, KLFLegacyData::KLFStyle::name, KLFStyle::name, KLFLegacyData::KLFStyle::preamble, KLFStyle::preamble, and style.
Referenced by toLibEntry().
Definition at line 140 of file klfliblegacyengine_p.h.
Referenced by instanceFor(), KLFLibLegacyEngine::setAutoSaveInterval(), and ~KLFLibLegacyFileDataPrivate().
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().
Definition at line 138 of file klfliblegacyengine_p.h.
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().
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().