LibKEduVocDocument
keduvocdocument.cpp
111 KEduVocDocument::ErrorCode initializeKAutoSave(KAutoSaveFile &autosave, QString const &fpath, FileHandlingFlags flags) const;
125 m_lessonContainer = new KEduVocLesson(i18nc("The top level lesson which contains all other lessons of the document.", "Document Lesson"), q);
154KEduVocDocument::KEduVocDocumentPrivate::initializeKAutoSave(KAutoSaveFile &autosave, QString const &fpath, FileHandlingFlags flags) const
156 QList<KAutoSaveFile *> staleFiles = KAutoSaveFile::staleFiles(QUrl::fromLocalFile(fpath), QCoreApplication::instance()->applicationName());
231 KIO::FileCopyJob *job = KIO::file_copy(url, QUrl::fromLocalFile(tempFile.fileName()), -1, KIO::Overwrite);
258 errorMessage = i18n("Could not open or properly read \"%1\"\n(Error reported: %2)", url.toDisplayString(), reader->errorMessage());
282KEduVocDocument::ErrorCode KEduVocDocument::saveAs(const QUrl &url, FileType ft, FileHandlingFlags flags)
657 identifier(i).setName(i18nc("The name of the first language/column of vocabulary, if we have to guess it.", "Original"));
659 identifier(i).setName(i18nc("The name of the second, third ... language/column of vocabulary, if we have to guess it.", "Translation %1", i));
828 newfilters.append(KLocalizedString(filters[i].description).toString() + " (" + QLatin1String(filters[i].extensions) + ')');
bool open(OpenMode openmode) override
virtual void releaseLock()
QUrl managedFile() const
void setManagedFile(const QUrl &filename)
static QList< KAutoSaveFile * > staleFiles(const QUrl &url, const QString &applicationName=QString())
void close() override
bool open(QIODevice::OpenMode mode) override
The primary entry point to the hierarchy of objects describing vocabularies.
Definition keduvocdocument.h:32
ErrorCode saveAs(const QUrl &url, FileType ft, FileHandlingFlags flags=FileDefaultHandling)
Saves the data under the given name.
Definition keduvocdocument.cpp:282
@ FileOpenReadOnly
Open without any intention to change and save back later. This also implies FileIgnoreLock.
Definition keduvocdocument.h:70
void setGenerator(const QString &generator)
Sets the generator of the file.
Definition keduvocdocument.cpp:776
void setCsvDelimiter(const QString &delimiter)
Sets the delimiter (separator) used for csv import and export.
Definition keduvocdocument.cpp:803
int appendIdentifier(const KEduVocIdentifier &identifier=KEduVocIdentifier())
Appends a new identifier (usually a language)
Definition keduvocdocument.cpp:650
void setDocumentComment(const QString &comment)
Set the comment of the file.
Definition keduvocdocument.cpp:770
static QString pattern(FileDialogMode mode)
Create a string with the supported document types, that can be used as filter in KFileDialog.
Definition keduvocdocument.cpp:809
KEDUVOCDOCUMENT_DEPRECATED void setQueryIdentifier(const QString &org, const QString &trans)
Sets the identifiers for the current query not written in the new version!
Definition keduvocdocument.cpp:757
static QString errorDescription(int errorCode)
Returns a QString description of the errorCode.
Definition keduvocdocument.cpp:838
static FileType detectFileType(const QString &fileName)
Definition keduvocdocument.cpp:196
void setModified(bool dirty=true)
Indicates if the document is modified.
Definition keduvocdocument.cpp:190
void merge(KEduVocDocument *docToMerge, bool matchIdentifiers)
Merges data from another document (UNIMPLEMENTED)
Definition keduvocdocument.cpp:383
void docModified(bool mod)
Emitted when the document becomes modified or saved.
KEduVocWordType * wordTypeContainer()
Returns the root word type object.
Definition keduvocdocument.cpp:671
int indexOfIdentifier(const QString &name) const
Determines the index of a given identifier.
Definition keduvocdocument.cpp:624
KEDUVOCDOCUMENT_DEPRECATED void queryIdentifier(QString &org, QString &trans) const
Retrieves the identifiers for the current query not written in the new version!
Definition keduvocdocument.cpp:751
@ FileIsReadOnly
Can't save this file because it was opened read-only.
Definition keduvocdocument.h:63
KEduVocDocument(QObject *parent=nullptr)
Constructor for a KDEEdu vocabulary document.
Definition keduvocdocument.cpp:179
KEduVocLeitnerBox * leitnerContainer()
Returns the root Leitner container.
Definition keduvocdocument.cpp:676
QByteArray toByteArray(const QString &generator)
Definition keduvocdocument.cpp:376
KEduVocIdentifier & identifier(int index)
Returns the identifier of translation index.
Definition keduvocdocument.cpp:607
QString csvDelimiter() const
Returns the delimiter (separator) used for csv import and export.
Definition keduvocdocument.cpp:798
void setLicense(const QString &license)
Set the license of the file.
Definition keduvocdocument.cpp:764
ErrorCode open(const QUrl &url, FileHandlingFlags flags=FileDefaultHandling)
Opens and locks a document file.
Definition keduvocdocument.cpp:208
void setCategory(const QString &category)
Set the category of the file.
Definition keduvocdocument.cpp:739
void setIdentifier(int index, const KEduVocIdentifier &lang)
Sets the identifier of translation.
Definition keduvocdocument.cpp:615
void setAuthorContact(const QString &authorContact)
Set the author contact info.
Definition keduvocdocument.cpp:723
void close()
Close a document file and release the lock on the file.
Definition keduvocdocument.cpp:275
void removeIdentifier(int index)
Removes identifier and the according translation in all entries.
Definition keduvocdocument.cpp:632
void setVersion(const QString &ver)
Sets version of the loaded file.
Definition keduvocdocument.cpp:792
Class to store meta information about a language or any other category in the vocabulary.
Definition keduvocidentifier.h:22
Class to write kvtml2 data files from KEduVocDocument.
Definition keduvockvtml2writer.h:29
QString errorString() const override
bool exec()
static ReaderPtr reader(QIODevice &device)
returns a reader that can read this device.
Definition readermanager.cpp:21
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
KIOCORE_EXPORT FileCopyJob * file_copy(const QUrl &src, const QUrl &dest, int permissions=-1, JobFlags flags=DefaultFlags)
Overwrite
QCoreApplication * instance()
bool exists(const QString &fileName)
virtual QString fileName() const const override
bool open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags)
bool remove()
virtual void close() override
ReadWrite
void append(QList< T > &&value)
qsizetype count() const const
bool isEmpty() const const
void prepend(parameter_type value)
void removeAt(qsizetype i)
qsizetype size() const const
Q_EMITQ_EMIT
QObject * parent() const const
bool isEmpty() const const
QString right(qsizetype n) const const
QString simplified() const const
QString trimmed() const const
QString join(QChar separator) const const
virtual QString fileName() const const override
bool open()
QString fileName(ComponentFormattingOptions options) const const
QUrl fromLocalFile(const QString &localFile)
bool isEmpty() const const
bool isLocalFile() const const
QString path(ComponentFormattingOptions options) const const
QString toDisplayString(FormattingOptions options) const const
QString toLocalFile() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.