[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kdecore
From:       Peter Kümmel <syntheticpp () yahoo ! com>
Date:       2006-10-24 10:22:05
Message-ID: 1161685325.894764.27466.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 598650 by kuemmel:

kdecore/ksafefile.cpp:
	- open stream with duplicated fd to workaround the problem
	  with msvc which closes also the file handle when fclose is called
	- open the file in fstream() when not already open

kdecore/tests/ksafefile.cpp:
	- fix comment
	- test automatical opening of the file
	- remove debug output
  


 M  +3 -3      ksavefile.cpp  
 M  +1 -3      tests/ksavefiletest.cpp  


--- trunk/KDE/kdelibs/kdecore/ksavefile.cpp #598649:598650
@@ -224,10 +224,10 @@
 FILE* KSaveFile::fstream()
 {
     if ( !d->stream ) {
-        close(); //Close the QFile to prevent problems in Windows
-
+        if (!isOpen())
+            open();
         //Provide a hack for old code that should be updated.
-        d->stream = KDE_fopen(QFile::encodeName(d->tempFileName), "r+");
+        d->stream = KDE_fdopen(dup(handle()), "r+");
     }
 
     return d->stream;
--- trunk/KDE/kdelibs/kdecore/tests/ksavefiletest.cpp #598649:598650
@@ -385,12 +385,10 @@
 void KSaveFileTest::test_fstream()
 {
     // test to check portability 
-    // remove this test with together with KSaveFile::fstream
+    // remove this test together with KSaveFile::fstream
     QString path=QDir::homePath();
     path = path + QLatin1String("/test_KSaveFileTest_fstream.tmp");
-    printf("KSaveFileTest::test_fstream(): path='%s'\n", qPrintable(path));
     KSaveFile sf(path);
-    sf.open();
     FILE* fs = sf.fstream();
     sf.finalize();
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic