QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
KAutoSaveFile Class Reference

#include <kautosavefile.h>

Inherits QFile.

Collaboration diagram for KAutoSaveFile:
Collaboration graph

Public Member Functions

 KAutoSaveFile (const QUrl &filename, QObject *parent=nullptr)
 KAutoSaveFile (QObject *parent=nullptr)
 ~KAutoSaveFile () override
QUrl managedFile () const
void setManagedFile (const QUrl &filename)
virtual void releaseLock ()
bool open (OpenMode openmode) override

Static Public Member Functions

static QList< KAutoSaveFile * > staleFiles (const QUrl &url, const QString &applicationName=QString())
static QList< KAutoSaveFile * > allStaleFiles (const QString &applicationName=QString())

Private Attributes

QUrl m_managed_file
std::unique_ptr< QLockFile > m_lock
bool m_managed_file_name_changed = false

Detailed Description

Small Qt-only replacement for the KAutoSaveFile API used by QET.

It stores crash-recovery files below the application data autosave folder and protects each recovery file with QLockFile. The original managed file path is kept in a sidecar file so allStaleFiles() can present recoverable projects on the next startup.

Constructor & Destructor Documentation

◆ KAutoSaveFile() [1/2]

KAutoSaveFile::KAutoSaveFile ( const QUrl & filename,
QObject * parent = nullptr )
explicit
Here is the call graph for this function:
Here is the caller graph for this function:

◆ KAutoSaveFile() [2/2]

KAutoSaveFile::KAutoSaveFile ( QObject * parent = nullptr)
explicit

◆ ~KAutoSaveFile()

KAutoSaveFile::~KAutoSaveFile ( )
override
Here is the call graph for this function:

Member Function Documentation

◆ allStaleFiles()

QList< KAutoSaveFile * > KAutoSaveFile::allStaleFiles ( const QString & applicationName = QString())
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ managedFile()

QUrl KAutoSaveFile::managedFile ( ) const
Here is the caller graph for this function:

◆ open()

bool KAutoSaveFile::open ( OpenMode openmode)
override
Here is the caller graph for this function:

◆ releaseLock()

void KAutoSaveFile::releaseLock ( )
virtual
Here is the caller graph for this function:

◆ setManagedFile()

void KAutoSaveFile::setManagedFile ( const QUrl & filename)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ staleFiles()

QList< KAutoSaveFile * > KAutoSaveFile::staleFiles ( const QUrl & url,
const QString & applicationName = QString() )
static
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_lock

std::unique_ptr<QLockFile> KAutoSaveFile::m_lock
private

◆ m_managed_file

QUrl KAutoSaveFile::m_managed_file
private

◆ m_managed_file_name_changed

bool KAutoSaveFile::m_managed_file_name_changed = false
private

The documentation for this class was generated from the following files: