kate: adjust to Katie changes

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-11-05 00:49:55 +02:00
parent 8c756d868f
commit c31839755f
5 changed files with 4 additions and 14 deletions

View file

@ -49,7 +49,6 @@ class TextLoader
, m_lastLineStart (0)
, m_eol (TextBuffer::eolUnknown) // no eol type detected atm
, m_buffer (KATE_FILE_LOADER_BS, 0)
, m_digest (KATE_HASH_ALGORITHM)
, m_converter (0)
, m_bomFound (false)
, m_firstRead (true)

View file

@ -4364,7 +4364,7 @@ bool KateDocument::createDigest ()
QFile f ( url().toLocalFile() );
if ( f.open( QIODevice::ReadOnly) )
{
QCryptographicHash crypto(KATE_HASH_ALGORITHM);
QCryptographicHash crypto;
crypto.addData(&f);
sha1sum = crypto.result();
}

View file

@ -33,7 +33,6 @@
#include <ktexteditor/containerinterface.h>
#include <ktexteditor/templateinterface.h>
#include <QList>
#include <QCryptographicHash>
#include <qplatformdefs.h>
class KateCmd;
@ -61,17 +60,10 @@ namespace Kate {
Q_DECLARE_METATYPE(KSharedConfig::Ptr)
/**
* loader block size, load 256 kb at once per default
* if file size is smaller, fall back to file size
* must be a multiple of 2
* loader block size
*/
static const qint64 KATE_FILE_LOADER_BS = QT_BUFFSIZE;
/**
* loader hash sum algorithm
*/
static const QCryptographicHash::Algorithm KATE_HASH_ALGORITHM = QCryptographicHash::KAT;
/**
* KateGlobal
* One instance of this class is hold alive during

View file

@ -708,7 +708,7 @@ bool KateDocManager::computeUrlChecksum(const KUrl &url, QByteArray &result)
if (f.exists() && f.open(QIODevice::ReadOnly))
{
QCryptographicHash crypto(QCryptographicHash::KAT);
QCryptographicHash crypto;
crypto.addData(&f);
QByteArray sha1 = crypto.result();

View file

@ -332,8 +332,7 @@ void KateDocumentTest::testInsertNewline()
// sure, these two implementations result in the same checksum.
void KateDocumentTest::testDigest()
{
// QCryptographicHash is used, therefore we need fromHex here
// Katie checksum of data/sha1checksum.txt: ba8bd2ee351783dffd6bb7b750271549e1b0c356e28aced4b0480d9f262d869d
// QCryptographicHash is used, therefore fromHex() is used here
const QByteArray fileDigest = QByteArray::fromHex("ba8bd2ee351783dffd6bb7b750271549e1b0c356e28aced4b0480d9f262d869d");
// make sure, Kate::TextBuffer and KateDocument::createDigest() equal