[Bug 130709] can't open attachments using apps that immediately return

David Faure faure at kde.org
Thu Apr 12 10:35:42 BST 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=130709         
faure kde org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From faure kde org  2007-04-12 11:35 -------
SVN commit 652915 by dfaure:

forwardport 652914:
OK, we can wait 3mn before deleting a tempfile, if it helps with apps that fork on startup like OOo or amarok.
Thanks to Jonathan Marten for the idea and patch.
BUG: 130709


 M  +9 -2      main.cpp  


--- trunk/KDE/kdebase/runtime/kioexec/main.cpp #652914:652915
 @ -240,9 +240,16  @
             }
         }
 
-        // don't delete a local file, except it is defined to be temporary (with --tempfiles switch)
-        if ( !dest.isLocalFile() || tempfiles )
+        if ( !dest.isLocalFile() ) {
             unlink( QFile::encodeName(src) );
+        } else if ( tempfiles ) {
+            // Wait for a reasonable time so that even if the application forks on startup (like OOo or amarok)
+            // i will have time to start up and read the file before it gets deleted. #130709.
+            kdDebug() << "sleeping..." << endl;
+            sleep(180); // 3 mn
+            kdDebug() << "about to delete " << src << endl;
+            unlink( QFile::encodeName(src) );
+        }
     }
 
     QApplication::exit(0);



More information about the Kdepim-bugs mailing list