Author Topic: Opening A File From The Command Line In Qtopia App  (Read 2260 times)

tml

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Opening A File From The Command Line In Qtopia App
« 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.
SL-C3100

sdjf

  • Sr. Member
  • ****
  • Posts: 447
    • View Profile
    • http://www.sdjf.wordpress.com and http://www.sdjf.esmartdesign.com
Opening A File From The Command Line In Qtopia App
« Reply #1 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  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
« Last Edit: March 11, 2007, 11:07:37 am by sdjf »
http://www.sdjf.esmartdesign.com
http://www.sdjf.wordpress.com
-----------------
sl5500 running Sharp ROM 2.38 (dead batteries)
sl6000L running Sharp ROM 1.12 (still working)
Opera 7.25 and 7.30
Socket CF 56k modem
3Com USB Ethernet Adapter
Toshiba, Lexar and Kingston SD cards
Lexar, Kingston and Transcend CF cards