equal
deleted
inserted
replaced
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 #include "javauseragent.h" |
18 #include "javauseragent.h" |
19 #ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS |
19 #ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS |
20 #include <QWebpage.h> |
|
21 #include "javaenvinfo.h" |
|
22 #else |
20 #else |
23 #include <cuseragent.h> |
21 #include <cuseragent.h> |
24 #endif |
22 #endif |
25 |
23 |
26 #ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS |
|
27 class Page: public QWebPage |
|
28 { |
|
29 public: |
|
30 QString userAgentForUrl ( const QUrl & url ) const; |
|
31 |
24 |
32 }; |
|
33 |
|
34 QString Page::userAgentForUrl ( const QUrl & url ) const |
|
35 { |
|
36 return url.toString(); |
|
37 } |
|
38 #endif |
|
39 |
25 |
40 HBufC* JavaUserAgent::GetUserAgentL() |
26 HBufC* JavaUserAgent::GetUserAgentL() |
41 { |
27 { |
42 #ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS |
28 #ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS |
43 /*QApplication app(); |
29 |
44 QUrl uri; |
|
45 Page page; |
|
46 QString webUserAgent = page.userAgentForUrl(uri); |
|
47 HBufC* agent = HBufC::NewMaxLC(webUserAgent.length()); |
|
48 agent->Des().Copy(webUserAgent.utf16()); |
|
49 agent->Des().Append(*(Java::JavaEnvInfo::GetUserAgentHeaderL())); |
|
50 return agent; |
|
51 */ |
|
52 _LIT(KString,"null"); |
30 _LIT(KString,"null"); |
53 HBufC* agent = HBufC::NewLC(5); |
31 HBufC* agent = HBufC::NewLC(5); |
54 *agent = KString; |
32 *agent = KString; |
55 CleanupStack::Pop(agent); |
33 CleanupStack::Pop(agent); |
56 return agent; |
34 return agent; |