OESF Portables Forum

Everything Else => Zaurus Distro Support and Discussion => Distros, Development, and Model Specific Forums => Archived Forums => Sharp ROMs => Topic started by: tml on April 01, 2006, 06:02:07 am

Title: Opening A File From The Command Line In Qtopia App
Post by: tml on April 01, 2006, 06:02:07 am
Hi,

I assume I can use qcop for this but I wasn't able to find out how.

I want to open a document (say "hello.html") using the default application as if I would double click on the file icon in the document tab. How do I do this? I guess something like qcop QPE/System '+++(QString)' hello.txt would do the job. I tried a view possibilities but all I achieved were interesting crashes.

Any ideas?

Cheers,
Thomas.
Title: Opening A File From The Command Line In Qtopia App
Post by: sdjf on March 11, 2007, 11:02:50 am
Yeah, well, your use of qcop is simply as a messenger, to tell the appropriate application it should open the file.

If you want textedit to open the file, then try something like (untested):

qcop QPE/Application/textedit 'start(QString)' 'hello.txt'

Use the qcoptest app I described at http://www.sdjf.esmartdesign.com/ipks/qcoptest.html (http://www.sdjf.esmartdesign.com/ipks/qcoptest.html)  to test your syntax without crashing.

You also may need to google or search here for examples of successful qcop calls.

I also found running strace to be quite helpful in figuring out the causes of crashes.

Cheers,
sdjf