[PATCH] KSaveFile::abort() on win32

Jaroslaw Staniek js at iidea.pl
Wed Mar 30 22:33:11 BST 2005






> 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





More information about the kde-core-devel mailing list