KTextEditor
kateswapfile.cpp
59 connect(syncTimer(), &QTimer::timeout, this, &Kate::SwapFile::writeFileToDisk, Qt::DirectConnection);
91 connect(m_document, &KTextEditor::Document::editingStarted, this, &Kate::SwapFile::startEditing);
92 connect(m_document, &KTextEditor::Document::editingFinished, this, &Kate::SwapFile::finishEditing);
93 connect(m_document, &KTextEditor::DocumentPrivate::modifiedChanged, this, &SwapFile::modifiedChanged);
100 disconnect(m_document, &KTextEditor::Document::editingStarted, this, &Kate::SwapFile::startEditing);
101 disconnect(m_document, &KTextEditor::Document::editingFinished, this, &Kate::SwapFile::finishEditing);
102 disconnect(m_document, &KTextEditor::DocumentPrivate::modifiedChanged, this, &SwapFile::modifiedChanged);
105 disconnect(m_document, &KTextEditor::Document::lineUnwrapped, this, &Kate::SwapFile::unwrapLine);
106 disconnect(m_document, &KTextEditor::Document::textInserted, this, &Kate::SwapFile::insertText);
345 m_document->insertText(KTextEditor::Cursor(line, column), QString::fromUtf8(text.data(), text.size()));
366 m_document->removeText(KTextEditor::Range(KTextEditor::Cursor(line, startColumn), KTextEditor::Cursor(line, endColumn)));
499void SwapFile::insertText(KTextEditor::Document *, const KTextEditor::Cursor position, const QString &text)
521 m_stream << EA_RemoveText << range.start().line() << range.start().column() << range.end().column();
581 if (KateDocumentConfig::global()->swapFileMode() == KateDocumentConfig::SwapFilePresetDirectory) {
586 path.append(QString::fromLatin1(QCryptographicHash::hash(fullLocalPath.toUtf8(), QCryptographicHash::Sha1).toHex()));
629 m_swapMessage = new KTextEditor::Message(i18n("The file was not closed properly."), KTextEditor::Message::Warning);
632 QAction *diffAction = new QAction(QIcon::fromTheme(QStringLiteral("split")), i18n("View Changes"), nullptr);
633 QAction *recoverAction = new QAction(QIcon::fromTheme(QStringLiteral("edit-redo")), i18n("Recover Data"), nullptr);
634 QAction *discardAction = new QAction(KStandardGuiItem::discard().icon(), i18n("Discard"), nullptr);
641 connect(recoverAction, &QAction::triggered, this, qOverload<>(&Kate::SwapFile::recover), Qt::QueuedConnection);
constexpr int column() const noexcept
Retrieve the column on which this cursor is situated.
Definition cursor.h:192
constexpr bool isValid() const noexcept
Returns whether the current position of this cursor is a valid position (line + column must both be >...
Definition cursor.h:102
constexpr int line() const noexcept
Retrieve the line on which this cursor is situated.
Definition cursor.h:174
Backend of KTextEditor::Document related public KTextEditor interfaces.
Definition katedocument.h:68
void configChanged(KTextEditor::Document *document)
This signal is emitted whenever the current document configuration is changed.
void editingFinished(KTextEditor::Document *document)
Editing transaction has finished.
void lineUnwrapped(KTextEditor::Document *document, int line)
A line got unwrapped.
void editingStarted(KTextEditor::Document *document)
Editing transaction has started.
void lineWrapped(KTextEditor::Document *document, KTextEditor::Cursor position)
A line got wrapped.
void modifiedChanged(KTextEditor::Document *document)
This signal is emitted whenever the document's buffer changed from either state unmodified to modifie...
void textInserted(KTextEditor::Document *document, KTextEditor::Cursor position, const QString &text)
Text got inserted.
void textRemoved(KTextEditor::Document *document, KTextEditor::Range range, const QString &text)
Text got removed.
An object representing a section of text, from one Cursor to another.
Definition include/ktexteditor/range.h:49
constexpr Cursor end() const noexcept
Get the end position of this range.
Definition include/ktexteditor/range.h:163
constexpr Cursor start() const noexcept
Get the start position of this range.
Definition include/ktexteditor/range.h:153
virtual bool setCursorPosition(Cursor position)=0
Set the view's new cursor to position.
void loaded(const QString &filename, bool encodingErrors)
Buffer loaded successfully a file.
QString i18n(const char *text, const TYPE &arg...)
Type type(const QSqlDatabase &db)
QString path(const QString &relativePath)
KGuiItem discard()
void triggered(bool checked)
char * data()
qsizetype size() const const
QByteArray toHex(char separator) const const
QCoreApplication * instance()
QByteArray hash(QByteArrayView data, Algorithm method)
Qt_4_6
bool atEnd() const const
bool mkpath(const QString &dirPath) const const
ReadOwner
QIcon fromTheme(const QString &name)
ReadOnly
QString & append(QChar ch)
QString fromLatin1(QByteArrayView str)
QString fromUtf8(QByteArrayView str)
QString & insert(qsizetype position, QChar ch)
bool isNull() const const
qsizetype lastIndexOf(QChar ch, Qt::CaseSensitivity cs) const const
QByteArray toUtf8() const const
DirectConnection
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
void timeout()
bool isEmpty() const const
bool isLocalFile() const const
QString toLocalFile() const const
QString url(FormattingOptions options) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:11:27 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:11:27 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.