Commit a19e140b authored by Laurent Montel's avatar Laurent Montel 😁

Allow to update attachment when edit file

parent 606ebaa8
......@@ -314,15 +314,15 @@ void AttachmentControllerBase::Private::editDone( MessageViewer::EditorWatcher *
Q_ASSERT( part );
KTemporaryFile *tempFile = editorTempFile.take( watcher );
Q_ASSERT( tempFile );
if( watcher->fileChanged() ) {
kDebug() << "File has changed.";
// Read the new data and update the part in the model.
tempFile->reset();
QByteArray data = tempFile->readAll();
part->setData( data );
model->updateAttachment( part );
const QString name = watcher->url().path();
QFile file( name );
if ( file.open( QIODevice::ReadOnly ) ) {
const QByteArray data = file.readAll();
part->setData( data );
model->updateAttachment( part );
}
}
delete tempFile;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment