PDA

View Full Version : QProcess open all file -> url.dll,FileProtocolHandler



patrik08
22nd June 2006, 09:37
To open file , doc, pdf , url , xml, ecc...
i found this method .... on win32..


/* function preview html result ...*/
bool is;
/*file_put_contents(BROWSER_PAGE_2,TidyXHTML(bridge _real_tag));*/
is = file_put_contents(BROWSER_PAGE_1,bridge_real_tag); /* path/index.html */
if (is) {
QProcess p;
#if defined(Q_WS_WIN)
QStringList s;
s << "url.dll,FileProtocolHandler" << BROWSER_PAGE_1;
p.startDetached(QString("rundll32.exe") , s );
#endif
#if defined( Q_WS_MACX )
/* ............ */
#endif
#if defined( Q_WS_X11 )
/* ............ */
#endif
}

and on mac anybody know a similar function? or hack?

e8johan
22nd June 2006, 17:29
Since there is no central management of mime-types on Unix, you will probably have to go KDE and/or Gnome-specific there. As for OS X - I don't know.

patrik08
26th June 2006, 18:07
Since there is no central management of mime-types on Unix, you will probably have to go KDE and/or Gnome-specific there. As for OS X - I don't know.



I solved problem to open file url mailto:xxx@xxx.com pdf ecc...

open url file code .....


void Gui_Main::OpenUrl()
{
#if defined(Q_WS_WIN)
QProcess p;
QStringList s;
s << "url.dll,FileProtocolHandler" << "http://www.osxentwicklerforum.de/";
p.startDetached(QString("rundll32.exe") , s );
#endif
#if defined Q_WS_MAC
QProcess m;
QStringList macs;
macs << "http://www.osxentwicklerforum.de/";
m.startDetached(QString("open") , macs );
#endif
}

Simple :) on mac is possibel to use...

QProcess p;
p.addArgument( "/usr/bin/osascript" );
p.addArgument( scriptFilename );
p.start();

apple script mount a samba , webdav disk and moore application or cronjobs....