ginebra2/emulator/main.cpp
changeset 16 3c88a81ff781
parent 12 afcd8e6d025b
equal deleted inserted replaced
14:6aeb7a756187 16:3c88a81ff781
    25 #include <QWebFrame>
    25 #include <QWebFrame>
    26 #include <QTranslator>
    26 #include <QTranslator>
    27 #include <QLocale>
    27 #include <QLocale>
    28 #include <QWebSettings>
    28 #include <QWebSettings>
    29 #include <QGraphicsWebView>
    29 #include <QGraphicsWebView>
    30 #ifndef NO_QSTM_GESTURE
       
    31 #include "WebGestureHelper.h"
    30 #include "WebGestureHelper.h"
    32 #endif
    31 
    33 
    32 
    34 #include <QNetworkProxyFactory>
    33 #include <QNetworkProxyFactory>
    35 #include "browser.h"
    34 #include "browser.h"
    36 
    35 
    37 #include "bedrockprovisioning.h"
    36 #include "bedrockprovisioning.h"
       
    37 
       
    38 #if defined(ORBIT_UI)
       
    39 #include <hbapplication.h>
       
    40 #endif
    38 
    41 
    39 #include <QDebug>
    42 #include <QDebug>
    40 
    43 
    41 #ifdef QTHIGHWAY
    44 #ifdef QTHIGHWAY
    42 #include <xqserviceutil.h>
    45 #include <xqserviceutil.h>
   217 //        {
   220 //        {
   218 //        qDebug() << "main - argv[" << i << "] = " << argv[i];
   221 //        qDebug() << "main - argv[" << i << "] = " << argv[i];
   219 //        }
   222 //        }
   220 
   223 
   221 /* openurl should only work in Orbit UI application. */
   224 /* openurl should only work in Orbit UI application. */
   222 #ifdef ORBIT_UI
   225 
   223 #ifdef OPENURL
   226 #if defined(ORBIT_UI) && defined(OPENURL)
   224 #ifdef NO_QSTM_GESTURE
       
   225     HbApplication app(AppFactoryL, argc, argv);
       
   226 #else
       
   227     BrowserApp app(AppFactoryL, argc, argv);
   227     BrowserApp app(AppFactoryL, argc, argv);
   228 #endif
   228 #else /* !(ORBIT_UI && OPENURL) */
   229 #else /* !OPENURL */
       
   230 #ifdef NO_QSTM_GESTURE
       
   231   HbApplication app(argc, argv);
       
   232 #else // ORBIT_UI
       
   233   BrowserApp app(argc, argv);
   229   BrowserApp app(argc, argv);
   234 #endif
   230 #endif /* ORBIT_UI && OPENURL */
   235 #endif /* OPENURL */
   231 
   236 #else
   232     //  qDebug() << "main - after app";
   237 #ifdef NO_QSTM_GESTURE
       
   238   QApplication app(argc, argv);
       
   239 #else
       
   240   BrowserApp app(argc, argv);
       
   241 #endif
       
   242 #endif // ORBIT_UI
       
   243 
   233 
   244 #ifdef QTHIGHWAY
   234 #ifdef QTHIGHWAY
   245     //qDebug() << "ServiceInfo:" << (XQServiceUtil::isService() ? "Service" : "Normal") << "launch";
   235     //qDebug() << "ServiceInfo:" << (XQServiceUtil::isService() ? "Service" : "Normal") << "launch";
   246     //qDebug() << "  Embedded=" << XQServiceUtil::isEmbedded() << "Interface=" << XQServiceUtil::interfaceName() << "Operation=" << XQServiceUtil::operationName();
   236     //qDebug() << "  Embedded=" << XQServiceUtil::isEmbedded() << "Interface=" << XQServiceUtil::interfaceName() << "Operation=" << XQServiceUtil::operationName();
   247 
   237 
   248     // provide service for html mime type
   238     // provide service for html mime type
   249     FileService *fileServiceProvider = new FileService();
   239     FileService *fileServiceProvider = new FileService();
   250 #endif
   240 #endif
   251 
   241 
   252 //  qDebug() << "main - after app";
   242 //  qDebug() << "main - after app";
   253 #ifdef Q_OS_SYMBIAN
   243 #if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5)
   254     //Object cache settings. NB: these need to be tuned per device
   244     //Object cache settings. NB: these need to be tuned per device
   255     QWebSettings::globalSettings()->setObjectCacheCapacities(128*1024, 1024*1024, 1024*1024);
   245     QWebSettings::globalSettings()->setObjectCacheCapacities(128*1024, 8*1024*1024, 10*1024*1024);
   256 #endif
   246 #endif
   257 
   247 
   258     if (BEDROCK_PROVISIONING::BedrockProvisioning::createBedrockProvisioning()->value("DnsPrefetchEnabled").toBool())
   248     if (BEDROCK_PROVISIONING::BedrockProvisioning::createBedrockProvisioning()->value("DnsPrefetchEnabled").toBool())
   259 	{
   249 	{
   260 	// Specifies whether QtWebkit will try to pre-fetch DNS entries to speed up browsing.
   250 	// Specifies whether QtWebkit will try to pre-fetch DNS entries to speed up browsing.
   266 
   256 
   267     configureHtml5OfflineStorage();
   257     configureHtml5OfflineStorage();
   268 
   258 
   269     QString lang = QLocale::system().name();
   259     QString lang = QLocale::system().name();
   270 
   260 
   271     //install the common translator from platform
   261     // load the common translator
   272     QTranslator common;
   262     QTranslator common;
       
   263     #ifdef PLATFORM_LOCALIZATION
       
   264     // load from platform
   273     common.load("z:/resource/qt/translations/common_" + lang);
   265     common.load("z:/resource/qt/translations/common_" + lang);
       
   266     #else
       
   267     // load from Browser
       
   268     common.load(":/resource/qt/translations/common_" + lang);
       
   269     #endif
   274     QApplication::installTranslator(&common);
   270     QApplication::installTranslator(&common);
   275 
   271 
   276 
   272 
   277     //install the translator from Browser
   273     // install the translator from Browser
   278     QTranslator translator;
   274     QTranslator translator;
   279     QString transFilePath = "Z:/resource/qt/translations/";
   275     QString transFilePath = ":/translations";
       
   276     #ifdef PLATFORM_LOCALIZATION
       
   277     // install from platform
       
   278     transFilePath = "Z:/resource/qt/translations/";
       
   279     #endif
   280     QString transFile = QLatin1String("browserloc_") +  lang;
   280     QString transFile = QLatin1String("browserloc_") +  lang;
   281     translator.load(transFile, transFilePath);
   281     bool isLoaded2 = translator.load(transFile, transFilePath);
   282     QApplication::installTranslator(&translator);
   282     QApplication::installTranslator(&translator);
   283 
   283 
   284 // To make the native urlsearch bar selection visible, the following lines have to be removed
   284 // To make the native urlsearch bar selection visible, the following lines have to be removed
   285 // The keypad navigation still works for ginebra2 even without enabling keypad navigation
   285 // The keypad navigation still works for ginebra2 even without enabling keypad navigation
   286 /*
   286 /*
   304     PERF_TRACE_OUT() << "NO_NETWORK_ACCESS_MANAGER\n";
   304     PERF_TRACE_OUT() << "NO_NETWORK_ACCESS_MANAGER\n";
   305 #endif
   305 #endif
   306 #if defined(NO_RESIZE_ON_LOAD)
   306 #if defined(NO_RESIZE_ON_LOAD)
   307     PERF_TRACE_OUT() << "NO_RESIZE_ON_LOAD\n";
   307     PERF_TRACE_OUT() << "NO_RESIZE_ON_LOAD\n";
   308 #endif
   308 #endif
   309 #if defined(NO_QSTM_GESTURE)
       
   310     PERF_TRACE_OUT() << "NO_QSTM_GESTURE\n";
       
   311 #endif
       
   312 #if defined(__gva_no_chrome__)
   309 #if defined(__gva_no_chrome__)
   313     PERF_TRACE_OUT() << "__gva_no_chrome__\n";
   310     PERF_TRACE_OUT() << "__gva_no_chrome__\n";
   314 #endif
   311 #endif
   315 #if defined(NO_HISTORY)
   312 #if defined(NO_HISTORY)
   316     PERF_TRACE_OUT() << "NO_HISTORY\n";
   313     PERF_TRACE_OUT() << "NO_HISTORY\n";