[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: [PATCH] KSaveFile::abort() on win32
From: "Aaron J. Seigo" <aseigo () kde ! org>
Date: 2005-03-30 15:30:46
Message-ID: 200503300830.57672.aseigo () kde ! org
[Download RAW message or body]
On Wednesday 30 March 2005 08:58, Jarosław Staniek wrote:
> For win32: close is required _before_ unlinking.
>
> ok?
IMHO this is exactly the style of patch that should be avoided while porting
to a platform. doubly so for one that does things as differently as win32
from the rest of our target platforms.
instead of creating a mess of #if's that turn a clear two line method into 11
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
}
--
Aaron J. Seigo
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43
[Attachment #3 (application/pgp-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic