From kde-core-devel Wed Mar 30 20:31:56 2005 From: Jaroslaw Staniek Date: Wed, 30 Mar 2005 20:31:56 +0000 To: kde-core-devel Subject: Re: [PATCH] KSaveFile::abort() on win32 Message-Id: <424B1B17.2020909 () iidea ! pl> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=111221471602925 > 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 > } ok, why not -- regards / pozdrawiam, Jaroslaw Staniek / OpenOffice Polska / Kexi Team http://www.openoffice.com.pl | http://www.kexi-project.org KDElibs/Windows: http://wiki.kde.org/tiki-index.php?page=KDElibs+for+win32