From kde-core-devel Wed Mar 30 15:30:46 2005 From: "Aaron J. Seigo" Date: Wed, 30 Mar 2005 15:30:46 +0000 To: kde-core-devel Subject: Re: [PATCH] KSaveFile::abort() on win32 Message-Id: <200503300830.57672.aseigo () kde ! org> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=111219680130123 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart2038163.Mo9n68pIeM" --nextPart2038163.Mo9n68pIeM Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 30 March 2005 08:58, Jaros=C5=82aw Staniek wrote: > For win32: close is required _before_ unlinking. > > ok? IMHO this is exactly the style of patch that should be avoided while portin= g=20 to a platform. doubly so for one that does things as differently as win32=20 from the rest of our target platforms. instead of creating a mess of #if's that turn a clear two line method into = 11=20 lines of spaghetti, can we instead just have two separate code paths? e.g.: KSaveFile::abort() { #ifdef Q_WS_WIN //for win32: close before unlinking mTempFile.close(); if (!mTempFile.name().isEmpty()) QFile::remove(mTempFile.name()); #else mTempFile.unlink(); mTempFile.close(); #endif } =2D-=20 Aaron J. Seigo GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43 --nextPart2038163.Mo9n68pIeM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBCSsYx1rcusafx20MRAiQNAJ453CZPIkXJhgoHCdfVT7ox6HVAZACfYddJ Rcl+SAkoq9JoNhlrVEpyljg= =6A7Q -----END PGP SIGNATURE----- --nextPart2038163.Mo9n68pIeM--