Commit d582378b2587d37fca837ff837ff1a0602696e07

  • avatar
  • Jakub Wieczorek <faw217 @gm…l.com>
  • Fri Jun 26 23:59:51 CEST 2009
As WebKit trunk has been merged into 4.6 snapshots, change
the #ifdefs so that the features that require the newest QtWebKit API
will be compiled both when using Qt 4.6 and WebKit trunk.
  
660660 this, SLOT(viewPageSource()));
661661 m_viewMenu->addAction(m_viewSourceAction);
662662
663#if WEBKIT_TRUNK
663#if QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK)
664664 m_viewMenu->addSeparator();
665665
666666 m_viewTextEncodingAction = new QAction(m_viewMenu);
796796
797797void BrowserMainWindow::aboutToShowTextEncodingMenu()
798798{
799#if WEBKIT_TRUNK
799#if QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK)
800800 m_viewTextEncodingMenu->clear();
801
801
802802 int currentCodec = -1;
803803 QStringList codecs;
804804 QList<int> mibs = QTextCodec::availableMibs();
807807 codecs.append(codec);
808808 }
809809 codecs.sort();
810
810
811811 QString defaultTextEncoding = QWebSettings::globalSettings()->defaultTextEncoding();
812812 currentCodec = codecs.indexOf(defaultTextEncoding);
813813
832832void BrowserMainWindow::viewTextEncoding(QAction *action)
833833{
834834 Q_UNUSED(action);
835#if WEBKIT_TRUNK
835#if QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK)
836836 Q_ASSERT(action);
837837 QList<QByteArray> codecs = QTextCodec::availableCodecs();
838838 int offset = action->data().toInt();
884884 m_viewSourceAction->setText(tr("Page S&ource"));
885885 m_viewSourceAction->setShortcut(tr("Ctrl+Alt+U"));
886886 m_viewFullScreenAction->setText(tr("&Full Screen"));
887#if WEBKIT_TRUNK
887#if QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK)
888888 m_viewTextEncodingAction->setText(tr("Text Encoding"));
889889#endif
890890
  
3333#include <qwebframe.h>
3434#include <qwebview.h>
3535
36#ifdef WEBKIT_TRUNK
36#if QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK)
3737#include <qwebelement.h>
3838#endif
3939
104104 if (!view)
105105 return;
106106
107#ifdef WEBKIT_TRUNK
107#if QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK)
108108 const QString selector = QLatin1String("%1[type=\"application/x-shockwave-flash\"]");
109109 const QString mime = QLatin1String("application/futuresplash");
110110
  
326326 event->acceptProposedAction();
327327 loadUrl(url, TabWidget::NewSelectedTab);
328328 }
329
329
330330 QTabBar::dropEvent(event);
331331}
332332#endif
  
3838#include <qsettings.h>
3939#include <qwebframe.h>
4040
41#ifdef WEBKIT_TRUNK
41#if QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK)
4242#include <qwebelement.h>
4343#endif
4444
8080{
8181 QList<WebPageLinkedResource> resources;
8282
83#ifdef WEBKIT_TRUNK
83#if QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK)
8484 QList<QWebElement> linkElements = mainFrame()->findAllElements(QLatin1String("html > head > link"));
8585
8686 foreach (const QWebElement &linkElement, linkElements) {
  
8181#include <qmenubar.h>
8282#include <qwebframe.h>
8383
84#ifdef WEBKIT_TRUNK
84#if QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK)
8585Q_DECLARE_METATYPE(QWebElement)
8686#include <qinputdialog.h>
8787#include <qmessagebox.h>
118118 m_zoomLevels << 110 << 120 << 133 << 150 << 170 << 200 << 240 << 300;
119119}
120120
121#if 1 // soon to be #if QT_VERSION <= 0x040600
121#if !(QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK))
122122#include <qdir.h>
123123QUrl WebView::guessUrlFromString(const QString &string)
124124{
219219 connect(searchMenu, SIGNAL(triggered(QAction *)), this, SLOT(searchRequested(QAction *)));
220220 }
221221
222#ifdef WEBKIT_TRUNK
222#if QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK)
223223 QWebElement element = r.element();
224224 if (!element.isNull()
225225 && element.tagName().toLower() == QLatin1String("input")
357357 }
358358}
359359
360#ifdef WEBKIT_TRUNK
360#if QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK)
361361void WebView::addSearchEngine()
362362{
363363 QAction *action = qobject_cast<QAction*>(sender());
  
7979 WebView(QWidget *parent = 0);
8080 WebPage *webPage() const { return m_page; }
8181
82#if 1 // soon to be #if QT_VERSION <= 0x040600
82#if !(QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK))
8383 static QUrl guessUrlFromString(const QString &url);
8484#endif
8585
128128 void copyImageLocationToClipboard();
129129 void bookmarkLink();
130130 void searchRequested(QAction *action);
131#ifdef WEBKIT_TRUNK
131#if QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK)
132132 void addSearchEngine();
133133#endif
134134