diff options
author | Russell Brenner <russellbrenner@google.com> | 2010-11-18 17:33:13 -0800 |
---|---|---|
committer | Russell Brenner <russellbrenner@google.com> | 2010-12-02 13:47:21 -0800 |
commit | 6b70adc33054f8aee8c54d0f460458a9df11b8a5 (patch) | |
tree | 103a13998c33944d6ab3b8318c509a037e639460 /WebKitTools/MiniBrowser/qt/main.cpp | |
parent | bdf4ebc8e70b2d221b6ee7a65660918ecb1d33aa (diff) | |
download | external_webkit-6b70adc33054f8aee8c54d0f460458a9df11b8a5.zip external_webkit-6b70adc33054f8aee8c54d0f460458a9df11b8a5.tar.gz external_webkit-6b70adc33054f8aee8c54d0f460458a9df11b8a5.tar.bz2 |
Merge WebKit at r72274: Initial merge by git.
Change-Id: Ie51f0b4a16da82942bd516dce59cfb79ebbe25fb
Diffstat (limited to 'WebKitTools/MiniBrowser/qt/main.cpp')
-rw-r--r-- | WebKitTools/MiniBrowser/qt/main.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/WebKitTools/MiniBrowser/qt/main.cpp b/WebKitTools/MiniBrowser/qt/main.cpp index 8ff3de8..20f4ff5 100644 --- a/WebKitTools/MiniBrowser/qt/main.cpp +++ b/WebKitTools/MiniBrowser/qt/main.cpp @@ -27,28 +27,37 @@ */ #include "BrowserWindow.h" +#include <QLatin1String> +#include <QRegExp> +#include <qgraphicswkview.h> #include <QtGui> int main(int argc, char** argv) { QApplication app(argc, argv); QStringList args = QApplication::arguments(); - QStringList urls = args; - urls.removeAt(0); + args.removeAt(0); - if (urls.isEmpty()) { + QGraphicsWKView::BackingStoreType backingStoreTypeToUse = QGraphicsWKView::Simple; + int indexOfTiledOption; + if ((indexOfTiledOption = args.indexOf(QRegExp(QLatin1String("-tiled")))) != -1) { + backingStoreTypeToUse = QGraphicsWKView::Tiled; + args.removeAt(indexOfTiledOption); + } + + if (args.isEmpty()) { QString defaultUrl = QString("file://%1/%2").arg(QDir::homePath()).arg(QLatin1String("index.html")); if (QDir(defaultUrl).exists()) - urls.append(defaultUrl); + args.append(defaultUrl); else - urls.append("http://www.google.com"); + args.append("http://www.google.com"); } - BrowserWindow* window = new BrowserWindow(); - window->load(urls[0]); + BrowserWindow* window = new BrowserWindow(backingStoreTypeToUse); + window->load(args[0]); - for (int i = 1; i < urls.size(); ++i) - window->newWindow(urls[i]); + for (int i = 1; i < args.size(); ++i) + window->newWindow(args[i]); app.exec(); |