Changeset 82059 in webkit
- Timestamp:
- Mar 27, 2011 12:18:55 AM (13 years ago)
- Location:
- trunk/Source/WebKit/qt
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/qt/Api/qwebkitversion.cpp
r59456 r82059 41 41 QString qWebKitVersion() 42 42 { 43 return QString ("%1.%2").arg(WEBKIT_MAJOR_VERSION).arg(WEBKIT_MINOR_VERSION);43 return QString::fromLatin1("%1.%2").arg(WEBKIT_MAJOR_VERSION).arg(WEBKIT_MINOR_VERSION); 44 44 } 45 45 -
trunk/Source/WebKit/qt/Api/qwebpage.cpp
r81600 r82059 1169 1169 QString p = q->property("_q_RepaintThrottlingPreset").toString(); 1170 1170 for(int i = 0; i < sizeof(presets) / sizeof(presets[0]); i++) { 1171 if (p == presets[i].name) {1171 if (p == QLatin1String(presets[i].name)) { 1172 1172 FrameView::setRepaintThrottlingDeferredRepaintDelay( 1173 1173 presets[i].deferredRepaintDelay); … … 2074 2074 // At this point DRT's WebPage has already been destroyed 2075 2075 if (QWebPagePrivate::drtRun) { 2076 if (message == "PLUGIN: NPP_Destroy")2076 if (message == QLatin1String("PLUGIN: NPP_Destroy")) 2077 2077 fprintf (stdout, "CONSOLE MESSAGE: line %d: %s\n", lineNumber, message.toUtf8().constData()); 2078 2078 } -
trunk/Source/WebKit/qt/ChangeLog
r82034 r82059 1 2011-03-27 Benjamin Poulain <benjamin.poulain@nokia.com> 2 3 Reviewed by Andreas Kling. 4 5 [Qt] QtWebKit will not compile with QT_ASCII_CAST_WARNINGS enabled 6 https://bugs.webkit.org/show_bug.cgi?id=57087 7 8 Use explicit conversion for string to avoid depending on the default codec 9 installed by the user code. 10 11 * Api/qwebkitversion.cpp: 12 (qWebKitVersion): 13 * Api/qwebpage.cpp: 14 (QWebPagePrivate::dynamicPropertyChangeEvent): 15 (QWebPage::javaScriptConsoleMessage): 16 * WebCoreSupport/DumpRenderTreeSupportQt.cpp: 17 (convertToPropertyName): 18 (DumpRenderTreeSupportQt::setEditingBehavior): 19 (DumpRenderTreeSupportQt::plainText): 20 * WebCoreSupport/EditorClientQt.cpp: 21 (dumpRange): 22 * WebCoreSupport/FrameLoaderClientQt.cpp: 23 (drtDescriptionSuitableForTestResult): 24 (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction): 25 * WebCoreSupport/InspectorClientQt.cpp: 26 (WebCore::InspectorClientQt::openInspectorFrontend): 27 * WebCoreSupport/InspectorServerQt.cpp: 28 (WebCore::parseWebSocketChallengeNumber): 29 (WebCore::InspectorServerRequestHandlerQt::tcpReadyRead): 30 1 31 2011-03-26 Andreas Kling <kling@webkit.org> 2 32 -
trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
r81309 r82059 532 532 static QString convertToPropertyName(const QString& name) 533 533 { 534 QStringList parts = name.split( '-');534 QStringList parts = name.split(QLatin1Char('-')); 535 535 QString camelCaseName; 536 536 for (int j = 0; j < parts.count(); ++j) { … … 627 627 WebCore::EditingBehaviorType coreEditingBehavior; 628 628 629 if (editingBehavior == "win")629 if (editingBehavior == QLatin1String("win")) 630 630 coreEditingBehavior = EditingWindowsBehavior; 631 else if (editingBehavior == "mac")631 else if (editingBehavior == QLatin1String("mac")) 632 632 coreEditingBehavior = EditingMacBehavior; 633 else if (editingBehavior == "unix")633 else if (editingBehavior == QLatin1String("unix")) 634 634 coreEditingBehavior = EditingUnixBehavior; 635 635 else { … … 924 924 { 925 925 QMap<QString, QVariant> map = range.toMap(); 926 QVariant startContainer = map.value( "startContainer");926 QVariant startContainer = map.value(QLatin1String("startContainer")); 927 927 map = startContainer.toMap(); 928 928 929 return map.value( "innerText").toString();929 return map.value(QLatin1String("innerText")).toString(); 930 930 } 931 931 -
trunk/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
r81965 r82059 77 77 WebCore::ExceptionCode code; 78 78 79 QString str = QString ("range from %1 of %2 to %3 of %4")80 .arg(range->startOffset(code)).arg(dumpPath(range->startContainer(code)))81 .arg(range->endOffset(code)).arg(dumpPath(range->endContainer(code)));79 QString str = QString::fromLatin1("range from %1 of %2 to %3 of %4") 80 .arg(range->startOffset(code)).arg(dumpPath(range->startContainer(code))) 81 .arg(range->endOffset(code)).arg(dumpPath(range->endContainer(code))); 82 82 83 83 return str; -
trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
r82034 r82059 123 123 return _url.string(); 124 124 // Remove the leading path from file urls 125 return QString(_url.string()).re place(WebCore::FrameLoaderClientQt::dumpResourceLoadCallbacksPath, "").mid(1);125 return QString(_url.string()).remove(WebCore::FrameLoaderClientQt::dumpResourceLoadCallbacksPath).mid(1); 126 126 } 127 127 … … 151 151 QString result; 152 152 if (exception) { 153 result.append( "ERROR");153 result.append(QLatin1String("ERROR")); 154 154 return result; 155 155 } 156 156 if (!node) { 157 result.append( "NULL");157 result.append(QLatin1String("NULL")); 158 158 return result; 159 159 } … … 161 161 RefPtr<WebCore::Node> parent = node->parentNode(); 162 162 if (parent) { 163 result.append( " > ");163 result.append(QLatin1String(" > ")); 164 164 result.append(drtDescriptionSuitableForTestResult(parent, 0)); 165 165 } … … 1230 1230 printf("Policy delegate: attempt to load %s with navigation type '%s'%s\n", 1231 1231 qPrintable(drtDescriptionSuitableForTestResult(request.url())), navigationTypeToString(action.type()), 1232 (node) ? qPrintable(QString (" originating from " + drtDescriptionSuitableForTestResult(node, 0))) : "");1232 (node) ? qPrintable(QString::fromLatin1(" originating from ") + drtDescriptionSuitableForTestResult(node, 0)) : ""); 1233 1233 1234 1234 if (policyDelegatePermissive) -
trunk/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
r81762 r82059 141 141 QString settingKey(settingStoragePrefix + QString(name)); 142 142 qsettings.setValue(settingKey, valueToStore); 143 qsettings.setValue(settingKey + settingStorageTypeSuffix, Q Variant::typeToName(valueToStore.type()));143 qsettings.setValue(settingKey + settingStorageTypeSuffix, QLatin1String(QVariant::typeToName(valueToStore.type()))); 144 144 #endif // QT_NO_SETTINGS 145 145 } … … 221 221 #endif 222 222 if (!inspectorUrl.isValid()) 223 inspectorUrl = QUrl( "qrc:/webkit/inspector/inspector.html");223 inspectorUrl = QUrl(QLatin1String("qrc:/webkit/inspector/inspector.html")); 224 224 225 225 #ifndef QT_NO_PROPERTIES -
trunk/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp
r77950 r82059 74 74 for (int i = 0; i < field.size(); i++) { 75 75 QChar c = field[i]; 76 if (c == (QChar)' ') {76 if (c == QLatin1Char(' ')) 77 77 numSpaces++; 78 } else if ((c >= (QChar)'0') && (c <= (QChar)'9')) { 79 nString.append((QChar)c); 80 } 78 else if ((c >= QLatin1Char('0')) && (c <= QLatin1Char('9'))) 79 nString.append(c); 81 80 } 82 81 quint32 num = nString.toLong(); … … 196 195 m_contentType = header.contentType().toLatin1(); 197 196 m_contentLength = header.contentLength(); 198 if (header.hasKey( "Upgrade") && (header.value("Upgrade") == QLatin1String("WebSocket")))197 if (header.hasKey(QLatin1String("Upgrade")) && (header.value(QLatin1String("Upgrade")) == QLatin1String("WebSocket"))) 199 198 isWebSocket = true; 200 199 … … 205 204 206 205 if (m_endOfHeaders) { 207 QStringList pathAndQuery = m_path.split( "?");206 QStringList pathAndQuery = m_path.split(QLatin1Char('?')); 208 207 m_path = pathAndQuery[0]; 209 QStringList words = m_path.split(Q String::fromLatin1("/"));208 QStringList words = m_path.split(QLatin1Char('/')); 210 209 211 210 if (isWebSocket) { … … 217 216 QByteArray key3 = m_tcpConnection->read(8); 218 217 219 quint32 number1 = parseWebSocketChallengeNumber(header.value( "Sec-WebSocket-Key1"));220 quint32 number2 = parseWebSocketChallengeNumber(header.value( "Sec-WebSocket-Key2"));218 quint32 number1 = parseWebSocketChallengeNumber(header.value(QLatin1String("Sec-WebSocket-Key1"))); 219 quint32 number2 = parseWebSocketChallengeNumber(header.value(QLatin1String("Sec-WebSocket-Key2"))); 221 220 222 221 char responseData[16]; … … 224 223 QByteArray response(responseData, sizeof(responseData)); 225 224 226 QHttpResponseHeader responseHeader(101, "WebSocket Protocol Handshake", 1, 1);227 responseHeader.setValue( "Upgrade", header.value("Upgrade"));228 responseHeader.setValue( "Connection", header.value("Connection"));229 responseHeader.setValue( "Sec-WebSocket-Origin", header.value("Origin"));230 responseHeader.setValue( "Sec-WebSocket-Location", ("ws://" + header.value("Host") + m_path));225 QHttpResponseHeader responseHeader(101, QLatin1String("WebSocket Protocol Handshake"), 1, 1); 226 responseHeader.setValue(QLatin1String("Upgrade"), header.value(QLatin1String("Upgrade"))); 227 responseHeader.setValue(QLatin1String("Connection"), header.value(QLatin1String("Connection"))); 228 responseHeader.setValue(QLatin1String("Sec-WebSocket-Origin"), header.value(QLatin1String("Origin"))); 229 responseHeader.setValue(QLatin1String("Sec-WebSocket-Location"), (QLatin1String("ws://") + header.value(QLatin1String("Host")) + m_path)); 231 230 responseHeader.setContentLength(response.size()); 232 231 m_tcpConnection->write(responseHeader.toString().toLatin1()); … … 260 259 261 260 // If no path is specified, generate an index page. 262 if ( (m_path == "") || (m_path == "/")) {263 QString indexHtml = "<html><head><title>Remote Web Inspector</title></head><body><ul>\n";261 if (m_path.isEmpty() || (m_path == QString(QLatin1Char('/')))) { 262 QString indexHtml = QLatin1String("<html><head><title>Remote Web Inspector</title></head><body><ul>\n"); 264 263 for (QMap<int, InspectorClientQt* >::const_iterator it = m_server->m_inspectorClients.begin(); 265 264 it != m_server->m_inspectorClients.end(); 266 265 ++it) { 267 indexHtml.append(QString ("<li><a href=\"/webkit/inspector/inspector.html?page=%1\">%2</li>\n")266 indexHtml.append(QString::fromLatin1("<li><a href=\"/webkit/inspector/inspector.html?page=%1\">%2</li>\n") 268 267 .arg(it.key()) 269 268 .arg(it.value()->m_inspectedWebPage->mainFrame()->url().toString())); 270 269 } 271 indexHtml.append( "</ul></body></html>");270 indexHtml.append(QLatin1String("</ul></body></html>")); 272 271 response = indexHtml.toLatin1(); 273 272 } else { 274 QString path = QString (":%1").arg(m_path);273 QString path = QString::fromLatin1(":%1").arg(m_path); 275 274 QFile file(path); 276 275 // It seems that there should be an enum or define for these status codes somewhere in Qt or WebKit,
Note: See TracChangeset
for help on using the changeset viewer.