[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdevelop/parts/appwizard
From: Alexander Dymo <cloudtemple () mksat ! net>
Date: 2004-06-17 21:06:40
Message-ID: 20040617210640.E3BE19649 () office ! kde ! org
[Download RAW message or body]
CVS commit by dymo:
Avoid using KArchiveFile::copyTo(dest) when dest is not a directory name. This fixes \
weird problems with files being zero-length after copied from archive.
M +5 -7 appwizarddlg.cpp 1.93
--- kdevelop/parts/appwizard/appwizarddlg.cpp #1.92:1.93
@@ -664,4 +664,6 @@ void AppWizardDialog::unpackArchive( con
kdDebug() << "Entries : " << entries.join(",") << endl;
+ KTempDir tdir;
+
QStringList::Iterator entry = entries.begin();
for( ; entry != entries.end(); ++entry )
@@ -683,21 +685,17 @@ void AppWizardDialog::unpackArchive( con
else
{
- KTempFile temp;
- temp.close(); // cannot write to a still opened \
file
- QString tempName = temp.name();
- file->copyTo( tempName ); // This is plain \
wrong, KArchiveFile::copyTo takes a directory + \
file->copyTo(tdir.name());
// assume that an archive does not contain XML files
// ( where should we currently get that info from? )
- if ( !copyFile( temp.name(), dest + "/" + \
file->name(), false, process ) ) + if ( !copyFile( \
QDir::cleanDirPath(tdir.name()+"/"+file->name()), dest + "/" + file->name(), false, \
process ) ) {
KMessageBox::sorry(this, QString( i18n("The \
file %1 cannot be created.")).arg( dest) );
- temp.unlink();
return;
}
setPermissions(file, dest + "/" + file->name());
- temp.unlink();
}
}
}
+ tdir.unlink();
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic