Commit 285ebb8f authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Fix saving/loading compressed, kigz, files

Seems to have been broken for some time.

(cherry picked from commit 4ceb4ed8)
parent fd204579
...@@ -108,6 +108,10 @@ KigDocument* KigFilterNative::load( const QString& file) ...@@ -108,6 +108,10 @@ KigDocument* KigFilterNative::load( const QString& file)
if ( tempdir.isEmpty() ) if ( tempdir.isEmpty() )
KIG_FILTER_PARSE_ERROR; KIG_FILTER_PARSE_ERROR;
if (!tempdir.endsWith(QLatin1Char('/'))) {
tempdir += QLatin1Char('/');
}
QString tempname = file.section( '/', -1 ); QString tempname = file.section( '/', -1 );
if ( file.endsWith( QLatin1String( ".kigz" ), Qt::CaseInsensitive ) ) if ( file.endsWith( QLatin1String( ".kigz" ), Qt::CaseInsensitive ) )
{ {
...@@ -745,7 +749,11 @@ bool KigFilterNative::save07( const KigDocument& data, const QString& outfile ) ...@@ -745,7 +749,11 @@ bool KigFilterNative::save07( const KigDocument& data, const QString& outfile )
else else
return false; return false;
QString tmpfile = tempdir + tempname + ".kig"; if (!tempdir.endsWith(QLatin1Char('/'))) {
tempdir += QLatin1Char('/');
}
const QString tmpfile = tempdir + tempname + ".kig";
QFile ftmpfile( tmpfile ); QFile ftmpfile( tmpfile );
if ( !ftmpfile.open( QIODevice::WriteOnly ) ) if ( !ftmpfile.open( QIODevice::WriteOnly ) )
return false; 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