Commit 4ceb4ed8 authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Fix saving/loading compressed, kigz, files

Seems to have been broken for some time.
parent 9a63765e
......@@ -108,6 +108,10 @@ KigDocument* KigFilterNative::load( const QString& file)
if ( tempdir.isEmpty() )
KIG_FILTER_PARSE_ERROR;
if (!tempdir.endsWith(QLatin1Char('/'))) {
tempdir += QLatin1Char('/');
}
QString tempname = file.section( '/', -1 );
if ( file.endsWith( QLatin1String( ".kigz" ), Qt::CaseInsensitive ) )
{
......@@ -745,7 +749,11 @@ bool KigFilterNative::save07( const KigDocument& data, const QString& outfile )
else
return false;
QString tmpfile = tempdir + tempname + ".kig";
if (!tempdir.endsWith(QLatin1Char('/'))) {
  • @ahmadsamir Hi. QStandardPaths::writableLocation always returns a path without a trailing /, so no need to check that (here and above), just always add it. Compare other usages and the list e.g. given on https://doc.qt.io/qt-5/qstandardpaths.html

    BTW, please consider to backport/commit this fix also in the release/21.08 branch, now we have it.

  • Good point, I'd forgotten about that quirk of QStandardPaths.

Please register or sign in to reply
tempdir += QLatin1Char('/');
}
const QString tmpfile = tempdir + tempname + ".kig";
QFile ftmpfile( tmpfile );
if ( !ftmpfile.open( QIODevice::WriteOnly ) )
return false;
......
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