File indexing completed on 2024-06-23 05:49:23
0001 /* 0002 This file is part of the Kasten Framework, made within the KDE community. 0003 0004 SPDX-FileCopyrightText: 2008 Friedrich W. H. Kossebau <kossebau@kde.org> 0005 0006 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0007 */ 0008 0009 #include "testdocumentfilewritethread.hpp" 0010 0011 // lib 0012 #include "testdocument.hpp" 0013 // Qt 0014 #include <QDataStream> 0015 #include <QFile> 0016 0017 namespace Kasten { 0018 0019 TestDocumentFileWriteThread::~TestDocumentFileWriteThread() = default; 0020 0021 void TestDocumentFileWriteThread::run() 0022 { 0023 const QByteArray* byteArray = mDocument->data(); 0024 0025 QDataStream outStream(mFile); 0026 outStream.writeRawData(mHeader.data(), mHeader.size()); 0027 outStream.writeRawData(byteArray->data(), byteArray->size()); 0028 0029 // byteArray->setModified( false ); 0030 0031 // registerDiskModifyTime( file );TODO move into synchronizer 0032 0033 mSuccess = (outStream.status() == QDataStream::Ok); 0034 0035 Q_EMIT documentWritten(mSuccess); 0036 } 0037 0038 } 0039 0040 #include "moc_testdocumentfilewritethread.cpp"