[QtMoko] Patch to modify default userAgent

Giacomo 'giotti' Mariani giacomomariani at yahoo.it
Wed Jul 20 15:13:55 CEST 2011


Hello everyone,
      wondering why the mobile visualization was missing in arora I 
found informations about the userAgent (thanks Sanvy).
Following some links I arrived at 
http://www.ericgiguere.com/tools/http-header-viewer.html which, reached 
from qtmoko-arora showed a given string with no "mobile keyword". I 
grepped in qtmoko src code and found that the userAgent is probably 
defined in
qtmoko/qtopiacore/qt/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp

As Sanvy reported a very well working string is the following one:
Mozilla/5.0 (Linux; U; Android 1.5; en-us; HTC Dream Build/FRG83) 
AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1

To reach the desired goal, even if in a dirty way, a added two lines to 
qwebpage.cpp:
2509      }
2510 +   ua.clear();
2511 +   ua = QLatin1String("Mozilla/5.0 (Linux; U; Android 1.5; en-us; 
HTC Dream Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 
Mobile Safari/533.1");
2512      return ua;
2513      }

Now I'm try to compile it, but I'd like to avoid compiling the whole 
system... I found the directory
build/qtopiacore/target/src/3rdparty/webkit/WebCore/

which contains a "good" project file, but, when I run make, I get:
[...]
make: arm-linux-g++: Command not found
make: *** [.obj/release-shared-emb-arm/qwebpage.o] Error 127

even if the toolchain is well working under "normal conditions"  (like, 
for example: build/src/3rdparty/applications/neocontrol).

Thanks for any hints,
     Giacomo

-- 
##############################################################
giacomo 'giotti' mariani
gpg --keyserver pool.sks-keyservers.net --recv-key 0x99bfa859
O<  ASCII ribbon campaign: stop HTML mail
www.asciiribbon.org
##############################################################




More information about the community mailing list