[go: up one dir, main page]

Menu

[57156d]: / browserlauncer.cpp  Maximize  Restore  History

Download this file

30 lines (26 with data), 599 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "browserlauncer.h"
#ifdef Q_OS_MSDOS
#include <windows.h>
#endif
BrowserLauncer::BrowserLauncer(QObject *parent) :
QObject(parent)
{
}
void BrowserLauncer::doWork()
{
#ifdef Q_OS_LINUX
// Only under Linux
QString urlTxt("x-www-browser \"");
urlTxt.append(m_urlTxt);
urlTxt.append("\"");
m_response = system(urlTxt.toLocal8Bit().data());
#endif
#ifdef Q_OS_MSDOS
WCHAR wStr[1000];
m_urlTxt.toWCharArray(wStr);
WCHAR wCmd[100];
QString sCmd("open");
sCmd.toWCharArray(wCmd);
ShellExecute(NULL, wCmd,wStr,NULL, NULL, SW_SHOWNORMAL);
#endif
}