PDA

View Full Version : QProcess and kfmclient exec problem



ramazangirgin
2nd June 2008, 10:39
Hi all,
I'm using QProcess and kfmclient exec <filename> on Linux. I want to open file and wait for close. But when using kfmclient , after opening file QProcess emit finished signal but my <filename> still open.
On Windows, I'm using QProcess and cmd.exe for opening exernal file and it waits until <filename> file closed.
How can i do this on linux?How can i use kfmclient for opening any file( with correct app) and wait until closed.
Thanks in advance
Ramazan

jpn
2nd June 2008, 13:11
"Waiting until closed" would mean your application would be frozen meanwhile. Is that really what you want? Btw. there is QDesktopServices::openUrl() which uses kfmclient on KDE but works on other platforms too, out of the box.

ramazangirgin
3rd June 2008, 07:42
"Waiting until closed" would mean your application would be frozen meanwhile. Is that really what you want? Btw. there is QDesktopServices::openUrl() which uses kfmclient on KDE but works on other platforms too, out of the box.

i have just tried QDesktopServices class. But it doesn't blockmy application.While new opened file still open , my application exit. I want to block my application or a signal like QProcess::finished() for understand new opened file closed. On windows i can do this with cmd.exe and QProcess but on linux kfmclient exe doesn't wait for new opened file to close. kfmclient exits immediately while new opened file still open.

ramazangirgin
5th June 2008, 15:45
Hi everybody !!!
How can i solve this problem.???

jpn
5th June 2008, 16:48
Blocking an application sounds brutal. Why don't you use QFileSystemWatcher to detect changes to the file?

ramazangirgin
6th June 2008, 09:31
Blocking an application sounds brutal. Why don't you use QFileSystemWatcher to detect changes to the file?
I don't want to watch changes of file. I want to be aware of closing of file. I want to open file and when file is closed i want to do other some works.QFileSystemWatcher is not agreeable for me.Thanks for your answer.