Bug 49627

Summary: [Qt][WK2] Make it possible to set custom user agent strings in MiniBrowser
Product: WebKit Reporter: Andras Becsi <abecsi>
Component: WebKit2Assignee: Andras Becsi <abecsi>
Status: RESOLVED FIXED    
Severity: Normal CC: kling, rniwa, tonikitoo
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
proposed patch
none
proposed patch v2 none

Description Andras Becsi 2010-11-16 14:57:27 PST
It is not possible to set custom user agent strings in MiniBrowser.
Comment 1 Andras Becsi 2010-11-16 15:08:30 PST
Created attachment 74045 [details]
proposed patch
Comment 2 Andreas Kling 2010-11-17 01:14:13 PST
Comment on attachment 74045 [details]
proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=74045&action=review

> WebKitTools/MiniBrowser/qt/BrowserWindow.cpp:151
> +    QDialog* dialog = new QDialog(this);

Put this on the stack instead, no need for the explicit delete later.

> WebKitTools/MiniBrowser/qt/MiniBrowser.qrc:3
> +        <file>useragentlist.txt</file>

Could we share this file with QtTestBrowser somehow?
Seems unnecessary to have two copies of it.
Comment 3 Andras Becsi 2010-11-17 08:43:20 PST
Created attachment 74118 [details]
proposed patch v2

Addressed Andreas' suggestions.
Comment 4 Andreas Kling 2010-11-17 09:03:49 PST
Comment on attachment 74118 [details]
proposed patch v2

View in context: https://bugs.webkit.org/attachment.cgi?id=74118&action=review

LGTM, just one thing:

> WebKitTools/MiniBrowser/qt/BrowserWindow.cpp:141
> +    ASSERT(!m_userAgentList.isEmpty());

Use Q_ASSERT instead and remove the WTF include + JavaScriptCore path in .pro
Comment 5 Andras Becsi 2010-11-17 10:40:39 PST
Committed r72220: <http://trac.webkit.org/changeset/72220>
Comment 6 Andras Becsi 2010-11-17 10:43:04 PST
Comment on attachment 74118 [details]
proposed patch v2

Clearing flags.
Comment 7 Ryosuke Niwa 2010-11-17 10:59:46 PST
I think this broke qt release build.
Comment 8 Andras Becsi 2010-11-17 11:31:26 PST
(In reply to comment #7)
> I think this broke qt release build.
Build fixed with r72223 and r72224.