changeset 74:37caa90ce503

more porting
author mandel
date Fri, 22 May 2009 23:43:58 +0000
parents 7bfd46c330dc
children 44a75b467197
files demos/browser/TODO.txt demos/browser/autosaver.d demos/browser/bookmarks.d demos/browser/browserapplication.d demos/browser/browsermainwindow.d demos/browser/build demos/browser/chasewidget.d demos/browser/cookiejar.d demos/browser/downloadmanager.d demos/browser/edittreeview.d demos/browser/history.d demos/browser/modelmenu.d demos/browser/networkaccessmanager.d demos/browser/searchlineedit.d demos/browser/settings.d demos/browser/tabwidget.d demos/browser/toolbarsearch.d demos/browser/urllineedit.d demos/browser/webview.d demos/browser/xbel.d
diffstat 20 files changed, 715 insertions(+), 740 deletions(-) [+]
line wrap: on
line diff
--- a/demos/browser/TODO.txt	Fri May 22 10:59:00 2009 +0000
+++ b/demos/browser/TODO.txt	Fri May 22 23:43:58 2009 +0000
@@ -7,7 +7,8 @@
 - some '::' and most '->' have been replaced by '.'
 
 Todo:
-- imports need to be corrected
-- module declarations are probably missing
 - what about Q_PROPERTY/Q_UNUSED?
-- everything else...
+- resolve multiple inheritance
+- QString -> char[]
+- QList -> []
+- everything else...
\ No newline at end of file
--- a/demos/browser/autosaver.d	Fri May 22 10:59:00 2009 +0000
+++ b/demos/browser/autosaver.d	Fri May 22 23:43:58 2009 +0000
@@ -51,8 +51,8 @@
 import QtDebug;
 
 
-const uint AUTOSAVE_IN  = 1000 * 3  // seconds
-const uint MAXWAIT = 1000 * 15 // seconds
+const uint AUTOSAVE_IN  = 1000 * 3;  // seconds
+const uint MAXWAIT = 1000 * 15; // seconds
 
 
 /*
@@ -71,7 +71,7 @@
 		assert(parent);
 	}
 	
-	~this();
+	~this()
 	{
 		if (m_timer.isActive())
 			qWarning() << "AutoSaver: still active when destroyed, changes not saved.";
@@ -90,7 +90,7 @@
 
 public:
 
-	void changeOccurred();
+	void changeOccurred()
 	{
 		if (m_firstChange.isNull())
 			m_firstChange.start();
--- a/demos/browser/bookmarks.d	Fri May 22 10:59:00 2009 +0000
+++ b/demos/browser/bookmarks.d	Fri May 22 23:43:58 2009 +0000
@@ -79,9 +79,9 @@
 */
 class BookmarksManager : public QObject
 {
-	mixin Signal!("entryAdded", BookmarkNode item);
-	mixin Signal!("entryRemoved", BookmarkNode parent, int row, BookmarkNode item);
-	mixin Signal!("entryChanged", BookmarkNode item);
+	mixin Signal!("entryAdded", BookmarkNode /*item*/);
+	mixin Signal!("entryRemoved", BookmarkNode /*parent*/, int /*row*/, BookmarkNode /*item*/);
+	mixin Signal!("entryChanged", BookmarkNode /*item*/);
 
 public:
 
@@ -111,8 +111,7 @@
 		m_commands.push(command);
 	}
 
-
-	void removeBookmark(BookmarkNode node);
+	void removeBookmark(BookmarkNode node)
 	{
 		if (!m_loaded)
 			return;
@@ -124,7 +123,7 @@
 		m_commands.push(command);
 	}
 
-	void setTitle(BookmarkNode node, QString newTitle);
+	void setTitle(BookmarkNode node, QString newTitle)
 	{
 		if (!m_loaded)
 			return;
@@ -134,8 +133,7 @@
 		m_commands.push(command);
 	}
 
-
-	void setUrl(BookmarkNode node, QString newUrl);
+	void setUrl(BookmarkNode node, QString newUrl)
 	{
 		if (!m_loaded)
 			return;
@@ -145,20 +143,19 @@
 		m_commands.push(command);
 	}
 
-
 	void changeExpanded()
 	{
 		m_saveTimer.changeOccurred();
 	}
 
-	BookmarkNode bookmarks();
+	BookmarkNode bookmarks()
 	{
 		if (!m_loaded)
 			load();
 		return m_bookmarkRootNode;
 	}
 
-	BookmarkNode menu();
+	BookmarkNode menu()
 	{
 		if (!m_loaded)
 			load();
@@ -172,7 +169,7 @@
 		return 0;
 	}
 
-	BookmarkNode toolbar();
+	BookmarkNode toolbar()
 	{
 		if (!m_loaded)
 			load();
@@ -267,7 +264,7 @@
 
 		BookmarkNode toolbar = null;
 		BookmarkNode menu = null;
-		QList<BookmarkNode> others;
+		BookmarkNode[] others;
 		for (int i = m_bookmarkRootNode.children().count() - 1; i >= 0; --i) {
 			BookmarkNode node = m_bookmarkRootNode.children().at(i);
 			if (node.type() == BookmarkNode.Folder) {
@@ -323,7 +320,7 @@
 
 	this(BookmarksManager m_bookmarkManagaer, BookmarkNode parent, int row)
 	{
-		super(BookmarksManager.tr("Remove Bookmark"))
+		super(BookmarksManager.tr("Remove Bookmark"));
 		m_row = row;
 		m_bookmarkManagaer = m_bookmarkManagaer;
 		m_node = parent.children().value(row);
@@ -341,14 +338,14 @@
 	void undo()
 	{
 		m_parent.add(m_node, m_row);
-		emit m_bookmarkManagaer.entryAdded(m_node);
+		m_bookmarkManagaer.entryAdded.emit(m_node);
 		m_done = false;
 	}
 
 	void redo()
 	{
 		m_parent.remove(m_node);
-		emit m_bookmarkManagaer.entryRemoved(m_parent, m_row, m_node);
+		m_bookmarkManagaer.entryRemoved.emit(m_parent, m_row, m_node);
 		m_done = true;
 	}
 
@@ -402,7 +399,7 @@
 			m_node.title = m_oldValue;
 		else
 			m_node.url = m_oldValue;
-		emit m_bookmarkManagaer.entryChanged(m_node);
+		m_bookmarkManagaer.entryChanged.emit(m_node);
 	}
 
 	void redo()
@@ -411,7 +408,7 @@
 			m_node.title = m_newValue;
 		else
 			m_node.url = m_newValue;
-		emit m_bookmarkManagaer.entryChanged(m_node);
+		m_bookmarkManagaer.entryChanged.emit(m_node);
 	}
 
 private:
@@ -444,8 +441,7 @@
 		endInsertRows();
 	}
 
-
-	void entryRemoved(BookmarkNode parent, int row, BookmarkNode item);
+	void entryRemoved(BookmarkNode parent, int row, BookmarkNode item)
 	{
 		// item was already removed, re-add so beginRemoveRows works
 		parent.add(item, row);
@@ -454,10 +450,10 @@
 		endRemoveRows();
 	}
 
-	void entryChanged(BookmarkNode item);
+	void entryChanged(BookmarkNode item)
 	{
 		QModelIndex idx = index(item);
-		emit dataChanged(idx, idx);
+		dataChanged.emit(idx, idx);
 	}
 
 public:
@@ -467,11 +463,11 @@
 		UrlRole = Qt.UserRole + 2,
 		UrlStringRole = Qt.UserRole + 3,
 		SeparatorRole = Qt.UserRole + 4
-	}
+	};
 
-	BookmarksModel(BookmarksManager bookmarkManager, QObject parent = null)
+	this(BookmarksManager bookmarkManager, QObject parent = null)
 	{
-		super(parent)
+		super(parent);
 		m_endMacro = false;
 		m_bookmarksManager = bookmarkManager;
 		bookmarkManager.entryAdded.connect(&this.entryAdded);
@@ -479,10 +475,12 @@
 		bookmarkManager.entryChanged.connect(&this.entryChanged);
 	}
     
-    
-	BookmarksManager bookmarksManager() { return m_bookmarksManager; }
+	BookmarksManager bookmarksManager()
+	{
+		return m_bookmarksManager;
+	}
 
-	QVariant headerData(int section, Qt.Orientation orientation, int role = Qt.DisplayRole);
+	QVariant headerData(int section, Qt.Orientation orientation, int role = Qt.DisplayRole)
 	{
 		if (orientation == Qt.Horizontal && role == Qt.DisplayRole) {
 			switch (section) {
@@ -493,7 +491,6 @@
 		return QAbstractItemModel.headerData(section, orientation, role);
 	}
     
-    
 	QVariant data(QModelIndex index, int role = Qt.DisplayRole)
 	{
 		if (!index.isValid() || index.model() != this)
@@ -551,11 +548,11 @@
 		if (!parent.isValid())
 			return m_bookmarksManager.bookmarks().children().count();
 
-		BookmarkNode item = static_cast<BookmarkNode>(parent.internalPointer());
+		BookmarkNode item = cast(BookmarkNode) parent.internalPointer();
 		return item.children().count();
 	}
 
-	QModelIndex index(int, int, QModelIndex& = QModelIndex())
+	QModelIndex index(int row, int column, QModelIndex parent = QModelIndex())
 	{
 		if (row < 0 || column < 0 || row >= rowCount(parent) || column >= columnCount(parent))
 			return QModelIndex();
@@ -565,7 +562,7 @@
 		return createIndex(row, column, parentNode.children().at(row));
 	}
 
-	QModelIndex parent(QModelIndex& index= QModelIndex())
+	QModelIndex parent(QModelIndex index = QModelIndex())
 	{
 		if (!index.isValid())
 			return QModelIndex();
@@ -601,13 +598,12 @@
 		return flags;
 	}
 
-	Qt.DropActions supportedDropActions ();
+	Qt.DropActions supportedDropActions()
 	{
 		return Qt.CopyAction | Qt.MoveAction;
 	}
 
-
-	bool removeRows(int row, int count, QModelIndex parent = QModelIndex());
+	bool removeRows(int row, int count, QModelIndex parent = QModelIndex())
 	{
 		if (row < 0 || count <= 0 || row + count > rowCount(parent))
 			return false;
@@ -660,13 +656,12 @@
 		return true;
 	}
 
-
-	QMimeData mimeData(QModelIndexList indexes);
+	QMimeData mimeData(QModelIndexList indexes)
 	{
 		QMimeData mimeData = new QMimeData();
 		QByteArray data;
 		auto stream = new QDataStream(&data, QIODevice.WriteOnly);
-		foreach (QModelIndex index, indexes) {
+		foreach (QModelIndex index; indexes) {
 			if (index.column() != 0 || !index.isValid())
 				continue;
 			QByteArray encodedData;
@@ -681,8 +676,7 @@
 		return mimeData;
 	}
 
-
-const char[] MIMETYPE = QLatin1String("application/bookmarks.xbel")
+	const char[] MIMETYPE = QLatin1String("application/bookmarks.xbel");
 
 	QStringList mimeTypes()
 	{
@@ -700,7 +694,7 @@
 			return false;
 
 		QByteArray ba = data.data(MIMETYPE);
-		QDataStream stream(&ba, QIODevice.ReadOnly);
+		QDataStream stream = new QDataStream(&ba, QIODevice.ReadOnly);
 		if (stream.atEnd())
 			return false;
 
@@ -710,12 +704,12 @@
 		while (!stream.atEnd()) {
 			QByteArray encodedData;
 			stream >> encodedData;
-			QBuffer buffer(&encodedData);
+			QBuffer buffer = new QBuffer(&encodedData);
 			buffer.open(QBuffer.ReadOnly);
 
 			XbelReader reader;
 			BookmarkNode rootNode = reader.read(&buffer);
-			QList<BookmarkNode> children = rootNode.children();
+			BookmarkNode[] children = rootNode.children();
 			for (int i = 0; i < children.count(); ++i) {
 				BookmarkNode bookmarkNode = children.at(i);
 				rootNode.remove(bookmarkNode);
@@ -739,7 +733,7 @@
 
 	BookmarkNode node(QModelIndex index)
 	{
-		BookmarkNode itemNode = static_cast<BookmarkNode>(index.internalPointer());
+		BookmarkNode itemNode = cast(BookmarkNode) index.internalPointer();
 		if (!itemNode)
 			return m_bookmarksManager.bookmarks();
 		return itemNode;
@@ -764,11 +758,11 @@
 
 class BookmarksMenu : public ModelMenu
 {
-	mixin Signal!("openUrl", QUrl url);
+	mixin Signal!("openUrl", QUrl /*url*/);
 
 public:
 
-	BookmarksMenu(QWidget parent = null)
+	this(QWidget parent = null)
 	{
 		super(parent);	
 		m_bookmarksManager = 0;
@@ -778,7 +772,7 @@
 		setSeparatorRole(BookmarksModel.SeparatorRole);
 	}
 	
-	void setInitialActions(QList<QAction> actions);
+	void setInitialActions(QAction[] actions)
 	{
 		m_initialActions = actions;
 		for (int i = 0; i < m_initialActions.count(); ++i)
@@ -805,13 +799,13 @@
 
 	void activated(QModelIndex index)
 	{
-		emit openUrl(index.data(BookmarksModel.UrlRole).toUrl());
+		openUrl.emit(index.data(BookmarksModel.UrlRole).toUrl());
 	}
 
 private:
 
 	BookmarksManager m_bookmarksManager;
-	QList<QAction> m_initialActions;
+	QAction[] m_initialActions;
 }
 
 /*
@@ -854,7 +848,7 @@
 public:
 
 	this(QString url, QString title, QWidget parent = null, BookmarksManager bookmarkManager = null)
-	: QDialog(parent)
+	//: QDialog(parent)
 	{
 		m_url = url;
 		m_bookmarksManager = bookmarkManager;
@@ -912,12 +906,12 @@
 //class TreeProxyModel;
 class BookmarksDialog : public QDialog, public Ui_BookmarksDialog
 {
-	mixin Signal!("openUrl", QUrl url);
+	mixin Signal!("openUrl", QUrl /*url*/);
 
 public:
 
 	this(QWidget parent = null, BookmarksManager manager = null)
-	: QDialog(parent)
+	//: QDialog(parent)
 	{
 		m_bookmarksManager = manager;
 		if (!m_bookmarksManager)
@@ -975,7 +969,7 @@
 		QModelIndex index = tree.currentIndex();
 		if (!index.parent().isValid())
 			return;
-		emit openUrl(index.sibling(index.row(), 1).data(BookmarksModel.UrlRole).toUrl());
+		openUrl.emit(index.sibling(index.row(), 1).data(BookmarksModel.UrlRole).toUrl());
 	}
 
 	void newFolder()
@@ -1031,11 +1025,13 @@
 	TreeProxyModel m_proxyModel;
 }
 
+
 import qt.gui.QToolBar;
 
+
 class BookmarksToolBar : public QToolBar
 {
-mixin Signal!("openUrl", QUrl url);
+mixin Signal!("openUrl", QUrl /*url*/);
 
 public:
 
@@ -1052,7 +1048,7 @@
 		setAcceptDrops(true);
 	}
 
-	void setRootIndex(QModelIndex index);
+	void setRootIndex(QModelIndex index)
 	{
 		m_root = index;
 		build();
@@ -1077,7 +1073,7 @@
 	{
 		const QMimeData mimeData = event.mimeData();
 		if (mimeData.hasUrls() && mimeData.hasText()) {
-			QList<QUrl> urls = mimeData.urls();
+			QUrl[] urls = mimeData.urls();
 			QAction action = actionAt(event.pos());
 			QString dropText;
 			if (action)
@@ -1113,14 +1109,14 @@
 	void triggered(QAction action)
 	{
 		QVariant v = action.data();
-		if (v.canConvert<QUrl>()) {
-			emit openUrl(v.toUrl());
+		if (v.canConvert!(QUrl)()) {
+			openUrl.emit(v.toUrl());
 		}
 	}
 
 	void activated(QModelIndex index)
 	{
-		emit openUrl(index.data(BookmarksModel.UrlRole).toUrl());
+		openUrl.emit(index.data(BookmarksModel.UrlRole).toUrl());
 	}
 
 	void build()
--- a/demos/browser/browserapplication.d	Fri May 22 10:59:00 2009 +0000
+++ b/demos/browser/browserapplication.d	Fri May 22 23:43:58 2009 +0000
@@ -39,14 +39,32 @@
 **
 ****************************************************************************/
 
-import QtGui.QApplication;
+module browserapplication;
 
-import QtCore.QUrl;
-import QtCore.QPointer;
 
-import QtGui.QIcon;
+import qt.core.QBuffer;
+import qt.core.QDir;
+import qt.core.QLibraryInfo;
+import qt.core.QSettings;
+import qt.core.QTextStream;
+import qt.core.QTranslator;
+import qt.core.QUrl;
+import qt.core.QPointer;
 
-import browserapplication;
+import qt.gui.QApplication;
+import qt.gui.QIcon;
+import qt.gui.QDesktopServices;
+import qt.gui.QFileOpenEvent;
+import qt.gui.QMessageBox;
+
+import qt.network.QLocalServer;
+import qt.network.QLocalSocket;
+import qt.network.QNetworkProxy;
+import qt.network.QSslSocket;
+
+import QtWebKit.QWebSettings;
+
+import qt.core.QDebug;
 
 import bookmarks;
 import browsermainwindow;
@@ -57,451 +75,406 @@
 import tabwidget;
 import webview;
 
-import QtCore.QBuffer;
-import QtCore.QDir;
-import QtCore.QLibraryInfo;
-import QtCore.QSettings;
-import QtCore.QTextStream;
-import QtCore.QTranslator;
-
-import QtGui.QDesktopServices;
-import QtGui.QFileOpenEvent;
-import QtGui.QMessageBox;
-
-import QtNetwork.QLocalServer;
-import QtNetwork.QLocalSocket;
-import QtNetwork.QNetworkProxy;
-import QtNetwork.QSslSocket;
-
-import QtWebKit.QWebSettings;
-
-import QtCore.QDebug;
-
-DownloadManager *BrowserApplication::s_downloadManager = 0;
-HistoryManager *BrowserApplication::s_historyManager = 0;
-NetworkAccessManager *BrowserApplication::s_networkAccessManager = 0;
-BookmarksManager *BrowserApplication::s_bookmarksManager = 0;
-
-
-/*
-QT_BEGIN_NAMESPACE
-class QLocalServer;
-QT_END_NAMESPACE
-
-class BookmarksManager;
-class BrowserMainWindow;
-class CookieJar;
-class DownloadManager;
-class HistoryManager;
-class NetworkAccessManager;
-*/
 
 class BrowserApplication : public QApplication
 {
-    Q_OBJECT
+public:
+
+	this(char[] args)
+	{
+		super(args);
+		m_localServer = 0;
+		QCoreApplication.setOrganizationName(QLatin1String("Trolltech"));
+		QCoreApplication.setApplicationName(QLatin1String("demobrowser"));
+		QCoreApplication.setApplicationVersion(QLatin1String("0.1"));
+		version(Q_WS_QWS)
+		{
+			// Use a different server name for QWS so we can run an X11
+			// browser and a QWS browser in parallel on the same machine for
+			// debugging
+			QString serverName = QCoreApplication.applicationName() + QLatin1String("_qws");
+		} else {
+			QString serverName = QCoreApplication.applicationName();
+		}
+		QLocalSocket socket;
+		socket.connectToServer(serverName);
+		if (socket.waitForConnected(500)) {
+			auto stream = new QTextStream(&socket);
+			QStringList args = QCoreApplication.arguments();
+			if (args.count() > 1)
+				stream << args.last();
+			else
+				stream << QString();
+			stream.flush();
+			socket.waitForBytesWritten();
+			return;
+		}
+
+		version(Q_WS_MAC) {
+			QApplication.setQuitOnLastWindowClosed(false);
+		} else {
+			QApplication.setQuitOnLastWindowClosed(true);
+		}
+
+		m_localServer = new QLocalServer(this);
+		m_localServer.newConnection.connect(&this.newLocalSocketConnection);
+		if (!m_localServer.listen(serverName)) {
+			if (m_localServer.serverError() == QAbstractSocket.AddressInUseError
+				&& QFile.exists(m_localServer.serverName())) {
+				QFile.remove(m_localServer.serverName());
+				m_localServer.listen(serverName);
+			}
+		}
+
+		version(QT_NO_OPENSSL) {} else {
+			if (!QSslSocket.supportsSsl()) {
+				QMessageBox.information(0, "Demo Browser",
+				"This system does not support OpenSSL. SSL websites will not be available.");
+			}
+		}
+
+		QDesktopServices.setUrlHandler(QLatin1String("http"), this, "openUrl");
+		QString localSysName = QLocale.system().name();
+
+		installTranslator(QLatin1String("qt_") + localSysName);
+
+		QSettings settings;
+		settings.beginGroup(QLatin1String("sessions"));
+		m_lastSession = settings.value(QLatin1String("lastSession")).toByteArray();
+		settings.endGroup();
+
+		version(Q_WS_MAC) {
+			this.lastWindowClosed.connect(&this.lastWindowClosed);
+		}
+
+		QTimer.singleShot(0, this, SLOT(postLaunch()));
+	}
+
+	~this()
+	{
+		delete s_downloadManager;
+		for (int i = 0; i < m_mainWindows.size(); ++i) {
+			BrowserMainWindow window = m_mainWindows.at(i);
+			delete window;
+		}
+		delete s_networkAccessManager;
+		delete s_bookmarksManager;
+	}
+
+	static BrowserApplication instance()
+	{
+		return cast(BrowserApplication) QCoreApplication.instance();
+	}
+
+	void loadSettings()
+	{
+		QSettings settings;
+		settings.beginGroup(QLatin1String("websettings"));
+
+		QWebSettings defaultSettings = QWebSettings.globalSettings();
+		QString standardFontFamily = defaultSettings.fontFamily(QWebSettings.StandardFont);
+		int standardFontSize = defaultSettings.fontSize(QWebSettings.DefaultFontSize);
+		QFont standardFont = QFont(standardFontFamily, standardFontSize);
+		standardFont = qVariantValue!(QFont)(settings.value(QLatin1String("standardFont"), standardFont));
+		defaultSettings.setFontFamily(QWebSettings.StandardFont, standardFont.family());
+		defaultSettings.setFontSize(QWebSettings.DefaultFontSize, standardFont.pointSize());
+
+		QString fixedFontFamily = defaultSettings.fontFamily(QWebSettings.FixedFont);
+		int fixedFontSize = defaultSettings.fontSize(QWebSettings.DefaultFixedFontSize);
+		QFont fixedFont = QFont(fixedFontFamily, fixedFontSize);
+		fixedFont = qVariantValue!(QFont)(settings.value(QLatin1String("fixedFont"), fixedFont));
+		defaultSettings.setFontFamily(QWebSettings.FixedFont, fixedFont.family());
+		defaultSettings.setFontSize(QWebSettings.DefaultFixedFontSize, fixedFont.pointSize());
+
+		defaultSettings.setAttribute(QWebSettings.JavascriptEnabled, settings.value(QLatin1String("enableJavascript"), true).toBool());
+		defaultSettings.setAttribute(QWebSettings.PluginsEnabled, settings.value(QLatin1String("enablePlugins"), true).toBool());
+
+		QUrl url = settings.value(QLatin1String("userStyleSheet")).toUrl();
+		defaultSettings.setUserStyleSheetUrl(url);
+
+		settings.endGroup();
+	}
+
+	bool isTheOnlyBrowser()
+	{
+		return (m_localServer != 0);
+	}
+
+	BrowserMainWindow mainWindow()
+	{
+		clean();
+		if (m_mainWindows.isEmpty())
+			newMainWindow();
+		return m_mainWindows[0];
+	}
+
+	BrowserMainWindow[] mainWindows()
+	{
+		clean();
+		BrowserMainWindow[] list;
+		for (int i = 0; i < m_mainWindows.count(); ++i)
+			list ~= m_mainWindows.at(i);
+		return list;
+	}
+
+	QIcon icon(QUrl url)
+	{
+		QIcon icon = QWebSettings.iconForUrl(url);
+		if (!icon.isNull())
+			return icon.pixmap(16, 16);
+		if (m_defaultIcon.isNull())
+			m_defaultIcon = QIcon(QLatin1String(":defaulticon.png"));
+		return m_defaultIcon.pixmap(16, 16);
+	}
+
+	void saveSession()
+	{
+		QWebSettings globalSettings = QWebSettings.globalSettings();
+		if (globalSettings.testAttribute(QWebSettings.PrivateBrowsingEnabled))
+			return;
+
+		clean();
+
+		QSettings settings;
+		settings.beginGroup(QLatin1String("sessions"));
+
+		QByteArray data;
+		auto buffer = new QBuffer(&data);
+		auto stream = new QDataStream(&buffer);
+		buffer.open(QIODevice.ReadWrite);
+
+		stream << m_mainWindows.count();
+		for (int i = 0; i < m_mainWindows.count(); ++i)
+			stream << m_mainWindows.at(i).saveState();
+		settings.setValue(QLatin1String("lastSession"), data);
+		settings.endGroup();
+	}
+
+	bool canRestoreSession()
+	{
+		return !m_lastSession.isEmpty();
+	}
+
+	static HistoryManager historyManager()
+	{
+		if (!s_historyManager) {
+			s_historyManager = new HistoryManager();
+			QWebHistoryInterface.setDefaultInterface(s_historyManager);
+		}
+		return s_historyManager;
+	}
+
+	static CookieJar cookieJar()
+	{
+		return cast(CookieJar) networkAccessManager().cookieJar();
+	}
+	
+	static DownloadManager downloadManager()
+	{
+		if (!s_downloadManager) {
+			s_downloadManager = new DownloadManager();
+		}
+		return s_downloadManager;
+	}
+
+	static NetworkAccessManager networkAccessManager()
+	{
+		if (!s_networkAccessManager) {
+			s_networkAccessManager = new NetworkAccessManager();
+			s_networkAccessManager.setCookieJar(new CookieJar);
+		}
+		return s_networkAccessManager;
+	}
+
+
+	static BookmarksManager bookmarksManager()
+	{
+		if (!s_bookmarksManager) {
+			s_bookmarksManager = new BookmarksManager;
+		}
+		return s_bookmarksManager;
+	}
+
+
+version(Q_WS_MAC)
+{
+	bool event(QEvent event)
+	{
+		switch (event.type()) {
+			case QEvent.ApplicationActivate: {
+				clean();
+				if (!m_mainWindows.isEmpty()) {
+					BrowserMainWindow mw = mainWindow();
+					if (mw && !mw.isMinimized()) {
+						mainWindow().show();
+					}
+					return true;
+				}
+			}
+			case QEvent.FileOpen:
+				if (!m_mainWindows.isEmpty()) {
+					mainWindow().loadPage(cast(QFileOpenEvent) event.file());
+					return true;
+				}
+			default:
+				break;
+		}
+		return QApplication.event(event);
+	}
+}
 
 public:
-this(char[] args)
+
+	BrowserMainWindow newMainWindow()
+	{
+		BrowserMainWindow browser = new BrowserMainWindow();
+		m_mainWindows.prepend(browser);
+		browser.show();
+		return browser;
+	}
+
+	void restoreLastSession()
+	{
+		QByteArray[] windows;
+		auto buffer = new QBuffer(&m_lastSession);
+		auto stream = new QDataStream(&buffer);
+		buffer.open(QIODevice.ReadOnly);
+		int windowCount;
+		stream >> windowCount;
+		for (int i = 0; i < windowCount; ++i) {
+			QByteArray windowState;
+			stream >> windowState;
+			windows ~= windowState;
+		}
+		for (int i = 0; i < windows.count(); ++i) {
+			BrowserMainWindow newWindow = 0;
+			if (m_mainWindows.count() == 1 && mainWindow().tabWidget().count() == 1
+				&& mainWindow().currentTab().url() == QUrl()) {
+				newWindow = mainWindow();
+			} else {
+				newWindow = newMainWindow();
+			}
+			newWindow.restoreState(windows.at(i));
+		}
+	}
+
+
+version(Q_WS_MAC)
 {
-	super(args);
-	m_localServer = 0;
-    QCoreApplication::setOrganizationName(QLatin1String("Trolltech"));
-    QCoreApplication::setApplicationName(QLatin1String("demobrowser"));
-    QCoreApplication::setApplicationVersion(QLatin1String("0.1"));
-version(Q_WS_QWS)
+	import qt.gui.QMessageBox;
+	
+	void quitBrowser()
 	{
-    // Use a different server name for QWS so we can run an X11
-    // browser and a QWS browser in parallel on the same machine for
-    // debugging
-    QString serverName = QCoreApplication::applicationName() + QLatin1String("_qws");
-} else {
-    QString serverName = QCoreApplication::applicationName();
-}
-    QLocalSocket socket;
-    socket.connectToServer(serverName);
-    if (socket.waitForConnected(500)) {
-        QTextStream stream(&socket);
-        QStringList args = QCoreApplication::arguments();
-        if (args.count() > 1)
-            stream << args.last();
-        else
-            stream << QString();
-        stream.flush();
-        socket.waitForBytesWritten();
-        return;
-    }
+		clean();
+		int tabCount = 0;
+		for (int i = 0; i < m_mainWindows.count(); ++i) {
+			tabCount =+ m_mainWindows.at(i).tabWidget().count();
+		}
 
-version(Q_WS_MAC) {
-    QApplication::setQuitOnLastWindowClosed(false);
-} else {
-    QApplication::setQuitOnLastWindowClosed(true);
+		if (tabCount > 1) {
+			int ret = QMessageBox.warning(mainWindow(), QString(),
+			tr("There are %1 windows and %2 tabs open\n"
+				"Do you want to quit anyway?").arg(m_mainWindows.count()).arg(tabCount),
+			QMessageBox.Yes | QMessageBox.No,
+			QMessageBox.No);
+			if (ret == QMessageBox.No)
+				return;
+		}
+
+		exit(0);
+	}
+	
+	void lastWindowClosed()
+	{
+		clean();
+		BrowserMainWindow mw = new BrowserMainWindow;
+		mw.slotHome();
+		m_mainWindows.prepend(mw);
+	}
 }
 
-    m_localServer = new QLocalServer(this);
-    connect(m_localServer, SIGNAL(newConnection()),
-            this, SLOT(newLocalSocketConnection()));
-    if (!m_localServer->listen(serverName)) {
-        if (m_localServer->serverError() == QAbstractSocket::AddressInUseError
-            && QFile::exists(m_localServer->serverName())) {
-            QFile::remove(m_localServer->serverName());
-            m_localServer->listen(serverName);
-        }
-    }
-
-#ifndef QT_NO_OPENSSL
-    if (!QSslSocket::supportsSsl()) {
-    QMessageBox::information(0, "Demo Browser",
-                 "This system does not support OpenSSL. SSL websites will not be available.");
-    }
-}
-
-    QDesktopServices::setUrlHandler(QLatin1String("http"), this, "openUrl");
-    QString localSysName = QLocale::system().name();
-
-    installTranslator(QLatin1String("qt_") + localSysName);
-
-    QSettings settings;
-    settings.beginGroup(QLatin1String("sessions"));
-    m_lastSession = settings.value(QLatin1String("lastSession")).toByteArray();
-    settings.endGroup();
-
-version(Q_WS_MAC) {
-    connect(this, SIGNAL(lastWindowClosed()),
-            this, SLOT(lastWindowClosed()));
-}
-
-    QTimer::singleShot(0, this, SLOT(postLaunch()));
-}
-
-    ~this()
-{
-    delete s_downloadManager;
-    for (int i = 0; i < m_mainWindows.size(); ++i) {
-        BrowserMainWindow *window = m_mainWindows.at(i);
-        delete window;
-    }
-    delete s_networkAccessManager;
-    delete s_bookmarksManager;
-}
-
-    static BrowserApplication *instance()
-{
-    return (static_cast<BrowserApplication *>(QCoreApplication::instance()));
-}
-
-
-
-    void loadSettings()
-{
-    QSettings settings;
-    settings.beginGroup(QLatin1String("websettings"));
-
-    QWebSettings *defaultSettings = QWebSettings::globalSettings();
-    QString standardFontFamily = defaultSettings->fontFamily(QWebSettings::StandardFont);
-    int standardFontSize = defaultSettings->fontSize(QWebSettings::DefaultFontSize);
-    QFont standardFont = QFont(standardFontFamily, standardFontSize);
-    standardFont = qVariantValue<QFont>(settings.value(QLatin1String("standardFont"), standardFont));
-    defaultSettings->setFontFamily(QWebSettings::StandardFont, standardFont.family());
-    defaultSettings->setFontSize(QWebSettings::DefaultFontSize, standardFont.pointSize());
-
-    QString fixedFontFamily = defaultSettings->fontFamily(QWebSettings::FixedFont);
-    int fixedFontSize = defaultSettings->fontSize(QWebSettings::DefaultFixedFontSize);
-    QFont fixedFont = QFont(fixedFontFamily, fixedFontSize);
-    fixedFont = qVariantValue<QFont>(settings.value(QLatin1String("fixedFont"), fixedFont));
-    defaultSettings->setFontFamily(QWebSettings::FixedFont, fixedFont.family());
-    defaultSettings->setFontSize(QWebSettings::DefaultFixedFontSize, fixedFont.pointSize());
-
-    defaultSettings->setAttribute(QWebSettings::JavascriptEnabled, settings.value(QLatin1String("enableJavascript"), true).toBool());
-    defaultSettings->setAttribute(QWebSettings::PluginsEnabled, settings.value(QLatin1String("enablePlugins"), true).toBool());
-
-    QUrl url = settings.value(QLatin1String("userStyleSheet")).toUrl();
-    defaultSettings->setUserStyleSheetUrl(url);
-
-    settings.endGroup();
-}
-
-    bool isTheOnlyBrowser() const
-{
-    return (m_localServer != 0);
-}
-
-    BrowserMainWindow *mainWindow()
-{
-    clean();
-    if (m_mainWindows.isEmpty())
-        newMainWindow();
-    return m_mainWindows[0];
-}
-
-    QList<BrowserMainWindow*> mainWindows()
-{
-    clean();
-    QList<BrowserMainWindow*> list;
-    for (int i = 0; i < m_mainWindows.count(); ++i)
-        list.append(m_mainWindows.at(i));
-    return list;
-}
-
-
-    QIcon icon(const QUrl &url) const
-{
-    QIcon icon = QWebSettings::iconForUrl(url);
-    if (!icon.isNull())
-        return icon.pixmap(16, 16);
-    if (m_defaultIcon.isNull())
-        m_defaultIcon = QIcon(QLatin1String(":defaulticon.png"));
-    return m_defaultIcon.pixmap(16, 16);
-}
-
-    void saveSession()
-{
-    QWebSettings *globalSettings = QWebSettings::globalSettings();
-    if (globalSettings->testAttribute(QWebSettings::PrivateBrowsingEnabled))
-        return;
-
-    clean();
-
-    QSettings settings;
-    settings.beginGroup(QLatin1String("sessions"));
-
-    QByteArray data;
-    QBuffer buffer(&data);
-    QDataStream stream(&buffer);
-    buffer.open(QIODevice::ReadWrite);
-
-    stream << m_mainWindows.count();
-    for (int i = 0; i < m_mainWindows.count(); ++i)
-        stream << m_mainWindows.at(i)->saveState();
-    settings.setValue(QLatin1String("lastSession"), data);
-    settings.endGroup();
-}
-
-    bool canRestoreSession() const
-{
-    return !m_lastSession.isEmpty();
-}
-
-    static HistoryManager *historyManager()
-{
-    if (!s_historyManager) {
-        s_historyManager = new HistoryManager();
-        QWebHistoryInterface::setDefaultInterface(s_historyManager);
-    }
-    return s_historyManager;
-}
-
-    static CookieJar *cookieJar()
-{
-    return (CookieJar*)networkAccessManager()->cookieJar();
-}
-    static DownloadManager *downloadManager()
-{
-    if (!s_downloadManager) {
-        s_downloadManager = new DownloadManager();
-    }
-    return s_downloadManager;
-}
-
-
-    static NetworkAccessManager *networkAccessManager()
-{
-    if (!s_networkAccessManager) {
-        s_networkAccessManager = new NetworkAccessManager();
-        s_networkAccessManager->setCookieJar(new CookieJar);
-    }
-    return s_networkAccessManager;
-}
-
-
-    static BookmarksManager *bookmarksManager()
-{
-    if (!s_bookmarksManager) {
-        s_bookmarksManager = new BookmarksManager;
-    }
-    return s_bookmarksManager;
-}
-
-
-version(Q_WS_MAC) {
-bool event(QEvent* event)
-{
-    switch (event->type()) {
-    case QEvent::ApplicationActivate: {
-        clean();
-        if (!m_mainWindows.isEmpty()) {
-            BrowserMainWindow *mw = mainWindow();
-            if (mw && !mw->isMinimized()) {
-                mainWindow()->show();
-            }
-            return true;
-        }
-    }
-    case QEvent::FileOpen:
-        if (!m_mainWindows.isEmpty()) {
-            mainWindow()->loadPage(static_cast<QFileOpenEvent *>(event)->file());
-            return true;
-        }
-    default:
-        break;
-    }
-    return QApplication::event(event);
-}
-}
-
-public slots:
-    BrowserMainWindow *newMainWindow()
-{
-    BrowserMainWindow *browser = new BrowserMainWindow();
-    m_mainWindows.prepend(browser);
-    browser->show();
-    return browser;
-}
-
-    void restoreLastSession()
-{
-    QList<QByteArray> windows;
-    QBuffer buffer(&m_lastSession);
-    QDataStream stream(&buffer);
-    buffer.open(QIODevice::ReadOnly);
-    int windowCount;
-    stream >> windowCount;
-    for (int i = 0; i < windowCount; ++i) {
-        QByteArray windowState;
-        stream >> windowState;
-        windows.append(windowState);
-    }
-    for (int i = 0; i < windows.count(); ++i) {
-        BrowserMainWindow *newWindow = 0;
-        if (m_mainWindows.count() == 1
-            && mainWindow()->tabWidget()->count() == 1
-            && mainWindow()->currentTab()->url() == QUrl()) {
-            newWindow = mainWindow();
-        } else {
-            newWindow = newMainWindow();
-        }
-        newWindow->restoreState(windows.at(i));
-    }
-}
-
-
-version(Q_WS_MAC) {
-import QtGui.QMessageBox;
-void BrowserApplication::quitBrowser()
-{
-    clean();
-    int tabCount = 0;
-    for (int i = 0; i < m_mainWindows.count(); ++i) {
-        tabCount =+ m_mainWindows.at(i)->tabWidget()->count();
-    }
-
-    if (tabCount > 1) {
-        int ret = QMessageBox::warning(mainWindow(), QString(),
-                           tr("There are %1 windows and %2 tabs open\n"
-                              "Do you want to quit anyway?").arg(m_mainWindows.count()).arg(tabCount),
-                           QMessageBox::Yes | QMessageBox::No,
-                           QMessageBox::No);
-        if (ret == QMessageBox::No)
-            return;
-    }
-
-    exit(0);
-}
-}
-
-version(Q_WS_MAC) {
-void lastWindowClosed()
-{
-    clean();
-    BrowserMainWindow *mw = new BrowserMainWindow;
-    mw->slotHome();
-    m_mainWindows.prepend(mw);
-}
-}
-
-
-private slots:
-
-/*!
-    Any actions that can be delayed until the window is visible
- */
-void postLaunch()
-{
-    QString directory = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
-    if (directory.isEmpty())
-        directory = QDir::homePath() + QLatin1String("/.") + QCoreApplication::applicationName();
-    QWebSettings::setIconDatabasePath(directory);
-
-    setWindowIcon(QIcon(QLatin1String(":browser.svg")));
-
-    loadSettings();
-
-    // newMainWindow() needs to be called in main() for this to happen
-    if (m_mainWindows.count() > 0) {
-        QStringList args = QCoreApplication::arguments();
-        if (args.count() > 1)
-            mainWindow()->loadPage(args.last());
-        else
-            mainWindow()->slotHome();
-    }
-    BrowserApplication::historyManager();
-}
-
-    void openUrl(const QUrl &url)
-{
-    mainWindow()->loadPage(url.toString());
-}
-
-    void newLocalSocketConnection();
-{
-    QLocalSocket *socket = m_localServer->nextPendingConnection();
-    if (!socket)
-        return;
-    socket->waitForReadyRead(1000);
-    QTextStream stream(socket);
-    QString url;
-    stream >> url;
-    if (!url.isEmpty()) {
-        QSettings settings;
-        settings.beginGroup(QLatin1String("general"));
-        int openLinksIn = settings.value(QLatin1String("openLinksIn"), 0).toInt();
-        settings.endGroup();
-        if (openLinksIn == 1)
-            newMainWindow();
-        else
-            mainWindow()->tabWidget()->newTab();
-        openUrl(url);
-    }
-    delete socket;
-    mainWindow()->raise();
-    mainWindow()->activateWindow();
-}
 
 private:
-    void clean()
-{
-    // cleanup any deleted main windows first
-    for (int i = m_mainWindows.count() - 1; i >= 0; --i)
-        if (m_mainWindows.at(i).isNull())
-            m_mainWindows.removeAt(i);
+
+	/*!
+	Any actions that can be delayed until the window is visible
+	*/
+	void postLaunch()
+	{
+		QString directory = QDesktopServices.storageLocation(QDesktopServices.DataLocation);
+		if (directory.isEmpty())
+			directory = QDir.homePath() ~ QLatin1String("/.") ~ QCoreApplication.applicationName();
+		QWebSettings.setIconDatabasePath(directory);
+
+		setWindowIcon(QIcon(QLatin1String(":browser.svg")));
+
+		loadSettings();
+
+		// newMainWindow() needs to be called in main() for this to happen
+		if (m_mainWindows.count() > 0) {
+			QStringList args = QCoreApplication.arguments();
+			if (args.count() > 1)
+				mainWindow().loadPage(args.last());
+			else
+				mainWindow().slotHome();
+		}
+		BrowserApplication.historyManager();
+	}
+
+	void openUrl( QUrl url)
+	{
+		mainWindow().loadPage(url.toString());
+	}
+
+	void newLocalSocketConnection()
+	{
+		QLocalSocket socket = m_localServer.nextPendingConnection();
+		if (!socket)
+			return;
+		socket.waitForReadyRead(1000);
+		QTextStream stream(socket);
+		QString url;
+		stream >> url;
+		if (!url.isEmpty()) {
+			QSettings settings;
+			settings.beginGroup(QLatin1String("general"));
+			int openLinksIn = settings.value(QLatin1String("openLinksIn"), 0).toInt();
+			settings.endGroup();
+			if (openLinksIn == 1)
+				newMainWindow();
+			else
+				mainWindow().tabWidget().newTab();
+			openUrl(url);
+		}
+		delete socket;
+		mainWindow().raise();
+		mainWindow().activateWindow();
+	}
+
+private:
+
+	void clean()
+	{
+		// cleanup any deleted main windows first
+		for (int i = m_mainWindows.count() - 1; i >= 0; --i)
+			if (m_mainWindows.at(i).isNull())
+				m_mainWindows.removeAt(i);
+	}
+
+	void installTranslator(QString name)
+	{
+		QTranslator translator = new QTranslator(this);
+		translator.load(name, QLibraryInfo.location(QLibraryInfo.TranslationsPath));
+		QApplication.installTranslator(translator);
+	}
+
+	static HistoryManager s_historyManager;
+	static DownloadManager s_downloadManager;
+	static NetworkAccessManager s_networkAccessManager;
+	static BookmarksManager s_bookmarksManager;
+	
+	QPointer!(BrowserMainWindow)[] m_mainWindows;
+	QLocalServer m_localServer;
+	QByteArray m_lastSession;
+	QIcon m_defaultIcon;
 }
-
-void installTranslator(const QString &name)
-{
-    QTranslator *translator = new QTranslator(this);
-    translator->load(name, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
-    QApplication::installTranslator(translator);
-}
-
-    static HistoryManager *s_historyManager;
-    static DownloadManager *s_downloadManager;
-    static NetworkAccessManager *s_networkAccessManager;
-    static BookmarksManager *s_bookmarksManager;
-
-    QList<QPointer<BrowserMainWindow> > m_mainWindows;
-    QLocalServer *m_localServer;
-    QByteArray m_lastSession;
-    mutable QIcon m_defaultIcon;
-};
-
-}
-
--- a/demos/browser/browsermainwindow.d	Fri May 22 10:59:00 2009 +0000
+++ b/demos/browser/browsermainwindow.d	Fri May 22 23:43:58 2009 +0000
@@ -38,7 +38,7 @@
 ** $QT_END_LICENSE$
 **
 ****************************************************************************/
-module browsermainwindow:
+module browsermainwindow;
 
 
 import qt.core.QUrl;
@@ -87,7 +87,7 @@
 
 public:
 
-	this(QWidget parent = null, Qt.WindowFlags flags = 0);
+	this(QWidget parent = null, Qt.WindowFlags flags = 0)
 	{
 		super(parent, flags);
 		m_tabWidget = new TabWidget(this);
@@ -165,10 +165,10 @@
 
 public:
 
-	static QUrl guessUrlFromString(QString &string)
+	static QUrl guessUrlFromString(QString string)
 	{
 		QString urlStr = string.trimmed();
-		QRegExp test(QLatin1String("^[a-zA-Z]+\\:.*"));
+		auto test = new QRegExp(QLatin1String("^[a-zA-Z]+\\:.*"));
 
 		// Check if it looks like a qualified URL. Try parsing it and see.
 		bool hasSchema = test.exactMatch(urlStr);
@@ -218,12 +218,12 @@
 
 	QByteArray saveState(bool withTabs)
 	{
-		int version = 2;
+		int version_ = 2;
 		QByteArray data;
-		QDataStream stream(&data, QIODevice.WriteOnly);
+		auto stream = new QDataStream(&data, QIODevice.WriteOnly);
 
 		stream << qint32(BrowserMainWindowMagic);
-		stream << qint32(version);
+		stream << qint32(version_);
 
 		stream << size();
 		stream << !m_navigationBar.isHidden();
@@ -241,7 +241,7 @@
 	{
 		int version_ = 2;
 		QByteArray sd = state;
-		QDataStream stream(&sd, QIODevice.ReadOnly);
+		auto stream = new QDataStream(&sd, QIODevice.ReadOnly);
 		if (stream.atEnd())
 			return false;
 
@@ -289,7 +289,6 @@
 		loadUrl(url);
 	}
 
-
 	void slotHome()
 	{
 		QSettings settings;
@@ -300,7 +299,7 @@
 
 protected:
 
-	void closeEvent(QCloseEvent event);
+	void closeEvent(QCloseEvent event)
 	{
 		if (m_tabWidget.count() > 1) {
 			int ret = QMessageBox.warning(this, QString(),
@@ -349,12 +348,12 @@
 		}
 	}
 
-	void slotUpdateStatusbar(QString &string);
+	void slotUpdateStatusbar(QString string)
 	{
 		statusBar().showMessage(string, 2000);
 	}
 
-	void slotUpdateWindowTitle(QString &title = QString())
+	void slotUpdateWindowTitle(QString title = QString())
 	{
 		if (title.isEmpty()) {
 			setWindowTitle(tr("Qt Demo Browser"));
@@ -368,7 +367,7 @@
 		}
 	}
 
-	void loadUrl(QUrl &url);
+	void loadUrl(QUrl url)
 	{
 		if (!currentTab() || !url.isValid())
 			return;
@@ -401,7 +400,7 @@
 		loadPage(file);
 	}
 
-	void slotFilePrintPreview();
+	void slotFilePrintPreview()
 	{
 		version(QT_NO_PRINTER)
 		{
@@ -428,11 +427,11 @@
 			QString title = tr("Are you sure you want to turn on private browsing?");
 			QString text = tr("<b>%1</b><br><br>When private browsing in turned on,"
 			" webpages are not added to the history,"
-			" items are automatically removed from the Downloads window," \
-			" new cookies are not stored, current cookies can't be accessed," \
-			" site icons wont be stored, session wont be saved, " \
-			" and searches are not addded to the pop-up menu in the Google search box." \
-			"  Until you close the window, you can still click the Back and Forward buttons" \
+			" items are automatically removed from the Downloads window,"
+			" new cookies are not stored, current cookies can't be accessed,"
+			" site icons wont be stored, session wont be saved, "
+			" and searches are not addded to the pop-up menu in the Google search box."
+			"  Until you close the window, you can still click the Back and Forward buttons"
 			" to return to the webpages you have opened.").arg(title);
 
 			QMessageBox.StandardButton button = QMessageBox.question(this, QString(), text,
@@ -444,10 +443,10 @@
 		} else {
 			settings.setAttribute(QWebSettings.PrivateBrowsingEnabled, false);
 
-			QList<BrowserMainWindow*> windows = BrowserApplication.instance().mainWindows();
+			BrowserMainWindow[] windows = BrowserApplication.instance().mainWindows();
 			for (int i = 0; i < windows.count(); ++i) {
 				BrowserMainWindow window = windows.at(i);
-				window.m_lastSearch = QString.null;
+				window.m_lastSearch = null; //QString::null
 				window.tabWidget().clear();
 			}
 		}
@@ -463,8 +462,7 @@
 		if (!currentTab())
 			return;
 		bool ok;
-		QString search = QInputDialog.getText(this, tr("Find"),
-			tr("Text:"), QLineEdit.Normal, m_lastSearch, &ok);
+		QString search = QInputDialog.getText(this, tr("Find"), tr("Text:"), QLineEdit.Normal, m_lastSearch, &ok);
 		if (ok && !search.isEmpty()) {
 			m_lastSearch = search;
 			if (!currentTab().findText(m_lastSearch))
@@ -486,8 +484,7 @@
 		currentTab().findText(m_lastSearch, QWebPage.FindBackward);
 	}
 
-
-	void slotShowBookmarksDialog();
+	void slotShowBookmarksDialog()
 	{
 		BookmarksDialog dialog = new BookmarksDialog(this);
 		dialog.openUrl.connect(&m_tabWidget.loadUrlInCurrentTab);
@@ -601,7 +598,7 @@
 		m_toolbarSearch.lineEdit().setFocus();
 	}
 
-	void slotToggleInspector(bool enable);
+	void slotToggleInspector(bool enable)
 	{
 		QWebSettings.globalSettings().setAttribute(QWebSettings.DeveloperExtrasEnabled, enable);
 		if (enable) {
@@ -631,13 +628,13 @@
 		BrowserApplication.downloadManager().show();
 	}
 
-	void slotSelectLineEdit();
+	void slotSelectLineEdit()
 	{
 		m_tabWidget.currentLineEdit().selectAll();
 		m_tabWidget.currentLineEdit().setFocus();
 	}
 
-	void slotAboutToShowBackMenu();
+	void slotAboutToShowBackMenu()
 	{
 		m_historyBackMenu.clear();
 		if (!currentTab())
@@ -655,8 +652,7 @@
 		}
 	}
 
-
-	void slotAboutToShowForwardMenu();
+	void slotAboutToShowForwardMenu()
 	{
 		m_historyForwardMenu.clear();
 		if (!currentTab())
@@ -683,7 +679,7 @@
 		m_windowMenu.addAction(tr("Downloads"), this, SLOT(slotDownloadManager()), QKeySequence(tr("Alt+Ctrl+L", "Download Manager")));
 
 		m_windowMenu.addSeparator();
-		QList<BrowserMainWindow*> windows = BrowserApplication.instance().mainWindows();
+		BrowserMainWindow[] windows = BrowserApplication.instance().mainWindows();
 		for (int i = 0; i < windows.count(); ++i) {
 			BrowserMainWindow window = windows.at(i);
 			QAction action = m_windowMenu.addAction(window.windowTitle(), this, SLOT(slotShowWindow()));
@@ -706,11 +702,11 @@
 
 	void slotShowWindow()
 	{
-		if (QAction action = qobject_cast<QAction*>(sender())) {
+		if (QAction action = cast(QAction) sender()) {
 			QVariant v = action.data();
-			if (v.canConvert<int>()) {
-				int offset = qvariant_cast<int>(v);
-				QList<BrowserMainWindow*> windows = BrowserApplication.instance().mainWindows();
+			if (v.canConvert!(int)()) {
+				int offset = cast(int) v;
+				BrowserMainWindow[] windows = BrowserApplication.instance().mainWindows();
 				windows.at(offset).activateWindow();
 				windows.at(offset).currentTab().setFocus();
 			}
@@ -738,12 +734,11 @@
 		}
 	}
 
-	void geometryChangeRequested(QRect &geometry)
+	void geometryChangeRequested(QRect geometry)
 	{
 		setGeometry(geometry);
 	}
 
-
 	void updateToolbarActionText(bool visible)
 	{
 		m_viewToolbar.setText(!visible ? tr("Show Toolbar") : tr("Hide Toolbar"));
@@ -765,7 +760,7 @@
 		settings.endGroup();
 	}
 
-	void setupMenu();
+	void setupMenu()
 	{
 		new QShortcut(QKeySequence(Qt.Key_F6), this, SLOT(slotSwapFocus()));
 
@@ -858,7 +853,7 @@
 		viewMenu.addSeparator();
 
 		m_stop = viewMenu.addAction(tr("&Stop"));
-		QList<QKeySequence> shortcuts;
+		QKeySequence[] shortcuts;
 		shortcuts.append(QKeySequence(Qt.CTRL | Qt.Key_Period));
 		shortcuts.append(Qt.Key_Escape);
 		m_stop.setShortcuts(shortcuts);
@@ -878,7 +873,7 @@
 
 		viewMenu.addSeparator();
 		viewMenu.addAction(tr("Page S&ource"), this, SLOT(slotViewPageSource()), tr("Ctrl+Alt+U"));
-		QAction a = viewMenu.addAction(tr("&Full Screen"), this, SLOT(slotViewFullScreen(bool)),  Qt.Key_F11);
+		QAction a = viewMenu.addAction(tr("&Full Screen"), this, SLOT(slotViewFullScreen),  Qt.Key_F11);
 		a.setCheckable(true);
 
 		// History
@@ -887,7 +882,7 @@
 		historyMenu.hovered.connect(&this.slotUpdateStatusbar);
 		historyMenu.setTitle(tr("Hi&story"));
 		menuBar().addMenu(historyMenu);
-		QList<QAction> historyActions;
+		QAction[] historyActions;
 
 		m_historyBack = new QAction(tr("Back"), this);
 		m_tabWidget.addWebAction(m_historyBack, QWebPage.Back);
@@ -921,7 +916,7 @@
 		bookmarksMenu.setTitle(tr("&Bookmarks"));
 		menuBar().addMenu(bookmarksMenu);
 
-		QList<QAction> bookmarksActions;
+		QAction[] bookmarksActions;
 
 		QAction showAllBookmarksAction = new QAction(tr("Show All Bookmarks"), this);
 		showAllBookmarksAction.triggered().connect(&this.slotShowBookmarksDialog);
@@ -944,7 +939,7 @@
 		toolsMenu.addAction(tr("Web &Search"), this, SLOT(slotWebSearch()), QKeySequence(tr("Ctrl+K", "Web Search")));
 		version(Q_CC_MINGW)
 		{
-			a = toolsMenu.addAction(tr("Enable Web &Inspector"), this, SLOT(slotToggleInspector(bool)));
+			a = toolsMenu.addAction(tr("Enable Web &Inspector"), this, SLOT(slotToggleInspector));
 			a.setCheckable(true);
 		}
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/demos/browser/build	Fri May 22 23:43:58 2009 +0000
@@ -0,0 +1,15 @@
+#! /bin/bash
+
+../../tools/duic/duic bookmarks.ui -o ui_bookmarks.d
+../../tools/duic/duic addbookmarkdialog.ui -o ui_addbookmarkdialog.d
+../../tools/duic/duic addbookmarkdialog.ui -o ui_addbookmarkdialog.d
+../../tools/duic/duic cookiesexceptions.ui -o ui_cookiesexceptions.d
+../../tools/duic/duic cookies.ui -o ui_cookies.d
+../../tools/duic/duic downloaditem.ui -o ui_downloaditem.d
+../../tools/duic/duic downloads.ui -o ui_downloads.d
+../../tools/duic/duic history.ui -o ui_history.d
+../../tools/duic/duic passworddialog.ui -o ui_passworddialog.d
+../../tools/duic/duic proxy.ui -o ui_proxy.d
+../../tools/duic/duic settings.ui -o ui_settings.d
+
+ldc *.d -L-L../../lib -L-lqtdgui -L-lqtdcore -I../../ -I../../qt/d1 -L-lQtGui -L-lQtCore -ofbrowser
--- a/demos/browser/chasewidget.d	Fri May 22 10:59:00 2009 +0000
+++ b/demos/browser/chasewidget.d	Fri May 22 23:43:58 2009 +0000
@@ -87,7 +87,7 @@
 		update();
 	}
 
-	void setPixmapEnabled(bool enable);
+	void setPixmapEnabled(bool enable)
 	{
 		m_pixmapEnabled = enable;
 	}
@@ -112,7 +112,7 @@
 		int displ = extent / 4;
 		int ext = extent / 4 - 1;
 
-		p.setRenderHint(QPainter::Antialiasing, true);
+		p.setRenderHint(QPainter.Antialiasing, true);
 
 		if(m_animated)
 			p.setPen(Qt.gray);
@@ -122,7 +122,7 @@
 		p.translate(width() / 2, height() / 2); // center
 
 		for (int segment = 0; segment < segmentCount(); ++segment) {
-			p.rotate(QApplication::isRightToLeft() ? m_step : -m_step);
+			p.rotate(QApplication.isRightToLeft() ? m_step : -m_step);
 			if(m_animated)
 				p.setBrush(colorForSegment(segment));
 			else
@@ -131,9 +131,9 @@
 		}
 	}
 
-	void timerEvent(QTimerEvent *event)
+	void timerEvent(QTimerEvent event)
 	{
-		if (event->timerId() == m_timerId) {
+		if (event.timerId() == m_timerId) {
 			++m_segment;
 			update();
 		}
--- a/demos/browser/cookiejar.d	Fri May 22 10:59:00 2009 +0000
+++ b/demos/browser/cookiejar.d	Fri May 22 23:43:58 2009 +0000
@@ -68,9 +68,9 @@
 import autosaver;
 
 
-static const unsigned int JAR_VERSION = 23;
+static const uint JAR_VERSION = 23;
 
-QDataStream &operator<<(QDataStream stream, QList<QNetworkCookie> list)
+QDataStream operator<<(QDataStream stream, QNetworkCookie[] list)
 {
 	stream << JAR_VERSION;
 	stream << quint32(list.size());
@@ -79,7 +79,7 @@
 	return stream;
 }
 
-QDataStream &operator>>(QDataStream stream, QList<QNetworkCookie> list)
+QDataStream operator>>(QDataStream stream, QNetworkCookie[] list)
 {
 	list.clear();
 
@@ -95,7 +95,7 @@
 	{
 		QByteArray value;
 		stream >> value;
-		QList<QNetworkCookie> newCookies = QNetworkCookie.parseCookies(value);
+		QNetworkCookie[] newCookies = QNetworkCookie.parseCookies(value);
 		if (newCookies.count() == 0 && value.length() != 0) {
 			qWarning() << "CookieJar: Unable to parse saved cookie:" << value;
 		}
@@ -142,7 +142,7 @@
 		m_saveTimer.saveIfNeccessary();
 	}
 
-	QList<QNetworkCookie> cookiesForUrl(QUrl url)
+	QNetworkCookie[] cookiesForUrl(QUrl url)
 	{
 		CookieJar that = const_cast<CookieJar>(this);
 		if (!m_loaded)
@@ -150,14 +150,14 @@
 
 		QWebSettings globalSettings = QWebSettings.globalSettings();
 		if (globalSettings.testAttribute(QWebSettings.PrivateBrowsingEnabled)) {
-			QList<QNetworkCookie> noCookies;
+			QNetworkCookie[] noCookies;
 			return noCookies;
 		}
 
 		return QNetworkCookieJar.cookiesForUrl(url);
 	}
 
-	bool setCookiesFromUrl(QList<QNetworkCookie> cookieList, QUrl url)
+	bool setCookiesFromUrl(QNetworkCookie[] cookieList, QUrl url)
 	{
 		if (!m_loaded)
 			load();
@@ -179,7 +179,7 @@
 			QDateTime soon = QDateTime.currentDateTime();
 			soon = soon.addDays(90);
 			foreach(QNetworkCookie cookie, cookieList) {
-				QList<QNetworkCookie> lst;
+				QNetworkCookie[] lst;
 				if (m_keepCookies == KeepUntilTimeLimit && !cookie.isSessionCookie() && cookie.expirationDate() > soon) {
 					cookie.setExpirationDate(soon);
 				}
@@ -189,7 +189,7 @@
 				} else {
 					// finally force it in if wanted
 					if (m_acceptCookies == AcceptAlways) {
-						QList<QNetworkCookie> cookies = allCookies();
+						QNetworkCookie[] cookies = allCookies();
 						cookies += cookie;
 						setAllCookies(cookies);
 						addedCookies = true;
@@ -296,7 +296,7 @@
 
 	void clear()
 	{
-		setAllCookies(QList<QNetworkCookie>());
+		setAllCookies(QNetworkCookie[]());
 		m_saveTimer.changeOccurred();
 		emit cookiesChanged();
 	}
@@ -319,7 +319,7 @@
 				static_cast<KeepPolicy>(keepPolicyEnum.keyToValue(value));
 
 		if (m_keepCookies == KeepUntilExit)
-		setAllCookies(QList<QNetworkCookie>());
+		setAllCookies(QNetworkCookie[]());
 
 		m_loaded = true;
 		emit cookiesChanged();
@@ -339,12 +339,12 @@
 			dir.mkpath(directory);
 		}
 		QSettings cookieSettings(directory + QLatin1String("/cookies.ini"), QSettings.IniFormat);
-		QList<QNetworkCookie> cookies = allCookies();
+		QNetworkCookie[] cookies = allCookies();
 		for (int i = cookies.count() - 1; i >= 0; --i) {
 			if (cookies.at(i).isSessionCookie())
 			cookies.removeAt(i);
 		}
-		cookieSettings.setValue(QLatin1String("cookies"), qVariantFromValue<QList<QNetworkCookie> >(cookies));
+		cookieSettings.setValue(QLatin1String("cookies"), qVariantFromValue<QNetworkCookie[] >(cookies));
 		cookieSettings.beginGroup(QLatin1String("Exceptions"));
 		cookieSettings.setValue(QLatin1String("block"), m_exceptions_block);
 		cookieSettings.setValue(QLatin1String("allow"), m_exceptions_allow);
@@ -364,7 +364,7 @@
 
 	void purgeOldCookies()
 	{
-		QList<QNetworkCookie> cookies = allCookies();
+		QNetworkCookie[] cookies = allCookies();
 		if (cookies.isEmpty())
 			return;
 		int oldCount = cookies.count();
@@ -384,9 +384,9 @@
 		if (m_loaded)
 			return;
 		// load cookies and exceptions
-		qRegisterMetaTypeStreamOperators<QList<QNetworkCookie> >("QList<QNetworkCookie>");
+		qRegisterMetaTypeStreamOperators<QNetworkCookie[] >("QNetworkCookie[]");
 		auto cookieSettings = new QSettings(QDesktopServices.storageLocation(QDesktopServices.DataLocation) + QLatin1String("/cookies.ini"), QSettings.IniFormat);
-		setAllCookies(qvariant_cast<QList<QNetworkCookie> >(cookieSettings.value(QLatin1String("cookies"))));
+		setAllCookies(qvariant_cast<QNetworkCookie[] >(cookieSettings.value(QLatin1String("cookies"))));
 		cookieSettings.beginGroup(QLatin1String("Exceptions"));
 		m_exceptions_block = cookieSettings.value(QLatin1String("block")).toStringList();
 		m_exceptions_allow = cookieSettings.value(QLatin1String("allow")).toStringList();
@@ -459,7 +459,7 @@
 
 	QVariant data(QModelIndex index, int role = Qt.DisplayRole)
 	{
-		QList<QNetworkCookie> lst;
+		QNetworkCookie[] lst;
 		
 		if (m_cookieJar)
 			lst = m_cookieJar.allCookies();
@@ -507,14 +507,13 @@
 		return (parent.isValid() || !m_cookieJar) ? 0 : m_cookieJar.allCookies().count();
 	}
 
-
 	bool removeRows(int row, int count, QModelIndex parent = QModelIndex())
 	{
 		if (parent.isValid() || !m_cookieJar)
 			return false;
 		int lastRow = row + count - 1;
 		beginRemoveRows(parent, row, lastRow);
-		QList<QNetworkCookie> lst = m_cookieJar.allCookies();
+		QNetworkCookie[] lst = m_cookieJar.allCookies();
 		for (int i = lastRow; i >= row; --i) {
 			lst.removeAt(i);
 		}
--- a/demos/browser/downloadmanager.d	Fri May 22 10:59:00 2009 +0000
+++ b/demos/browser/downloadmanager.d	Fri May 22 23:43:58 2009 +0000
@@ -182,7 +182,7 @@
 		tryAgainButton.setVisible(true);
 	}
 
-	void downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
+	void downloadProgress(ulong bytesReceived, ulong bytesTotal)
 	{
 		m_bytesReceived = bytesReceived;
 		if (bytesTotal == -1) {
@@ -270,12 +270,12 @@
 		if (m_reply.error() == QNetworkReply.NoError)
 			return;
 
-		qint64 bytesTotal = progressBar.maximum();
+		ulong bytesTotal = progressBar.maximum();
 		bool running = !downloadedSuccessfully();
 
 		// update info label
 		double speed = m_bytesReceived * 1000.0 / m_downloadTime.elapsed();
-		double timeRemaining = ((double)(bytesTotal - m_bytesReceived)) / speed;
+		double timeRemaining = (cast(double)(bytesTotal - m_bytesReceived)) / speed;
 		QString timeRemainingString = tr("seconds");
 		if (timeRemaining > 60) {
 			timeRemaining = timeRemaining / 60;
@@ -298,7 +298,7 @@
 			info = QString(tr("%1 of %2 (%3/sec) %4"))
 				.arg(dataString(m_bytesReceived))
 				.arg(bytesTotal == 0 ? tr("?") : dataString(bytesTotal))
-				.arg(dataString((int)speed))
+				.arg(dataString(cast(int) speed))
 				.arg(remaining);
 		} else {
 			if (m_bytesReceived == bytesTotal)
@@ -326,7 +326,7 @@
 		return QString(QLatin1String("%1 %2")).arg(size).arg(unit);
 	}
 
-	QString saveFileName(QString &directory);
+	QString saveFileName(QString directory)
 	{
 		// Move this function into QNetworkReply to also get file name sent from the server
 		QString path = m_url.path();
@@ -350,7 +350,7 @@
 	}
 
 	bool m_requestFileName;
-	qint64 m_bytesReceived;
+	ulong m_bytesReceived;
 	QTime m_downloadTime;
 }
 
@@ -372,7 +372,8 @@
 	It is a basic download manager.  It only downloads the file, doesn't do BitTorrent,
 	extract zipped files or anything fancy.
 	*/
-	this(QWidget parent = null) : QDialog(parent)
+	this(QWidget parent = null)
+	//: QDialog(parent)
 	{
 		m_autoSaver = new AutoSaver(this);
 		m_manager = BrowserApplication.networkAccessManager();
@@ -387,7 +388,7 @@
 		downloadsView.horizontalHeader().setStretchLastSection(true);
 		m_model = new DownloadModel(this);
 		downloadsView.setModel(m_model);
-		connect(cleanupButton, SIGNAL(clicked()), this, SLOT(cleanup()));
+		cleanupButton.clicked.connect(&this.cleanup);
 		load();
 	}
 
@@ -424,20 +425,19 @@
 
 public:
 
-	void download(QNetworkRequest request, bool requestFileName = false);
+	void download(QNetworkRequest request, bool requestFileName = false)
 	{
 		if (request.url().isEmpty())
 			return;
 		handleUnsupportedContent(m_manager.get(request), requestFileName);
 	}
 
-
 	void download(QUrl url, bool requestFileName = false)
         {
 		download(QNetworkRequest(url), requestFileName);
 	}
 	
-	void handleUnsupportedContent(QNetworkReply reply, bool requestFileName = false);
+	void handleUnsupportedContent(QNetworkReply reply, bool requestFileName = false)
 	{
 		if (!reply || reply.url().isEmpty())
 			return;
@@ -495,7 +495,7 @@
 
 	void updateRow()
 	{
-		DownloadItem item = qobject_cast<DownloadItem*>(sender());
+		DownloadItem item = cast(DownloadItem) sender();
 		int row = m_downloads.indexOf(item);
 		if (-1 == row)
 			return;
@@ -556,7 +556,7 @@
 		QByteArray value = settings.value(QLatin1String("removeDownloadsPolicy"), QLatin1String("Never")).toByteArray();
 		QMetaEnum removePolicyEnum = staticMetaObject.enumerator(staticMetaObject.indexOfEnumerator("RemovePolicy"));
 		m_removePolicy = removePolicyEnum.keyToValue(value) == -1 ? Never :
-			static_cast<RemovePolicy>(removePolicyEnum.keyToValue(value));
+			cast(RemovePolicy) removePolicyEnum.keyToValue(value);
 
 		int i = 0;
 		QString key = QString(QLatin1String("download_%1_")).arg(i);
@@ -585,7 +585,7 @@
 	DownloadModel m_model;
 	QNetworkAccessManager m_manager;
 	QFileIconProvider m_iconProvider;
-	QList<DownloadItem> m_downloads;
+	DownloadItem[] m_downloads;
 	RemovePolicy m_removePolicy;
 }
 
--- a/demos/browser/edittreeview.d	Fri May 22 10:59:00 2009 +0000
+++ b/demos/browser/edittreeview.d	Fri May 22 23:43:58 2009 +0000
@@ -60,7 +60,7 @@
 		if ((event.key() == Qt.Key_Delete || event.key() == Qt.Key_Backspace) && model()) {
 			removeOne();
 		} else {
-			QAbstractItemView::keyPressEvent(event);
+			QAbstractItemView.keyPressEvent(event);
 		}
 	}
 
--- a/demos/browser/history.d	Fri May 22 10:59:00 2009 +0000
+++ b/demos/browser/history.d	Fri May 22 23:43:58 2009 +0000
@@ -64,16 +64,16 @@
 import qt.core.QUrl;
 
 import qt.webkit.QWebHistoryInterface;
-import qtWebkit.QWebSettings;
+import qt.webkit.QWebSettings;
 
 import QWebHistoryInterface;
 
-import autosaver
+import autosaver;
 import browserapplication;
 import modelmenu;
 
 
-static const unsigned int HISTORY_VERSION = 23;
+static const uint HISTORY_VERSION = 23;
 
 
 class HistoryItem
@@ -111,9 +111,9 @@
 class HistoryManager : public QWebHistoryInterface
 {
 	mixin Signal!("historyReset");
-	mixin Signal!("entryAdded", HistoryItem item);
-	mixin Signal!("entryRemoved", HistoryItem item);
-	mixin Signal!("entryUpdated", int offset);
+	mixin Signal!("entryAdded", HistoryItem /*item*/);
+	mixin Signal!("entryRemoved", HistoryItem /*item*/);
+	mixin Signal!("entryUpdated", int /*offset*/);
 
 public:
 
@@ -147,12 +147,12 @@
 		m_saveTimer.saveIfNeccessary();
 	}
 
-	bool historyContains(QString &url)
+	bool historyContains(QString url)
 	{
 		return m_historyFilterModel.historyContains(url);
 	}
 
-	void addHistoryEntry(QString &url)
+	void addHistoryEntry(QString url)
 	{
 		QUrl cleanUrl(url);
 		cleanUrl.setPassword(QString());
@@ -161,7 +161,7 @@
 		addHistoryItem(item);
 	}
 
-	void updateHistoryItem(QUrl &url, QString &title)
+	void updateHistoryItem(QUrl url, QString title)
 	{
 		for (int i = 0; i < m_history.count(); ++i) {
 			if (url == m_history.at(i).url) {
@@ -189,12 +189,12 @@
 		m_saveTimer.changeOccurred();
 	}
 
-	QList<HistoryItem> history()
+	HistoryItem[] history()
 	{
 		return m_history;
 	}
 
-	void setHistory(QList<HistoryItem> &history, bool loadedAndSorted = false);
+	void setHistory(HistoryItem[] history, bool loadedAndSorted = false)
 	{
 		m_history = history;
 
@@ -214,7 +214,7 @@
 	}
 
 	// History manager keeps around these models for use by the completer and other classes
-	HistoryModel historyModel();
+	HistoryModel historyModel()
 	{
 		return m_historyModel;
 	}
@@ -279,9 +279,9 @@
 			dir.mkpath(directory);
 		}
 
-		QFile historyFile(directory + QLatin1String("/history"));
+		auto historyFile = new QFile(directory ~ QLatin1String("/history"));
 		// When saving everything use a temporary file to prevent possible data loss.
-		QTemporaryFile tempFile;
+		auto tempFile = new QTemporaryFile;
 		tempFile.setAutoRemove(false);
 		bool open = false;
 		if (saveAll) {
@@ -372,7 +372,7 @@
 			return;
 		}
 
-		QList<HistoryItem> list;
+		HistoryItem[] list;
 		auto in_ = new QDataStream(&historyFile);
 		// Double check that the history file is sorted as it is read in
 		bool needToSort = false;
@@ -426,7 +426,7 @@
 	AutoSaver m_saveTimer;
 	int m_historyLimit;
 	QTimer m_expiredTimer;
-	QList<HistoryItem> m_history;
+	HistoryItem[] m_history;
 	QString m_lastSavedUrl;
 
 	HistoryModel m_historyModel;
@@ -490,7 +490,7 @@
 
 	QVariant data(QModelIndex index, int role = Qt.DisplayRole)
 	{
-		QList<HistoryItem> lst = m_history.history();
+		HistoryItem[] lst = m_history.history();
 		if (index.row() < 0 || index.row() >= lst.size())
 			return QVariant();
 
@@ -544,7 +544,7 @@
 			return false;
 		int lastRow = row + count - 1;
 		beginRemoveRows(parent, row, lastRow);
-		QList<HistoryItem> lst = m_history.history();
+		HistoryItem[] lst = m_history.history();
 		for (int i = lastRow; i >= row; --i)
 			lst.removeAt(i);
 		m_history.historyReset.disconnect(&this.historyReset);
@@ -585,7 +585,7 @@
 		return m_historyHash.contains(url);
 	}
 	
-	int historyLocation(QString url);
+	int historyLocation(QString url)
 	{
 		load();
 		if (!m_historyHash.contains(url))
@@ -646,7 +646,7 @@
 		}
 	}
 
-	QVariant headerData(int section, Qt.Orientation orientation, int role = Qt.DisplayRole);
+	QVariant headerData(int section, Qt.Orientation orientation, int role = Qt.DisplayRole)
 	{
 		return sourceModel().headerData(section, orientation, role);
 	}
@@ -659,7 +659,7 @@
 		return m_historyHash.count();
 	}
 
-	int columnCount(QModelIndex parent = QModelIndex());
+	int columnCount(QModelIndex parent = QModelIndex())
 	{
 		return (parent.isValid()) ? 0 : 2;
 	}
@@ -682,7 +682,7 @@
 	Removing a continuous block of rows will remove filtered rows too as this is
 	the users intention.
 	*/
-	bool removeRows(int row, int count, QModelIndex parent = QModelIndex());
+	bool removeRows(int row, int count, QModelIndex parent = QModelIndex())
 	{
 		if (row < 0 || count <= 0 || row + count > rowCount(parent) || parent.isValid())
 			return false;
@@ -702,7 +702,7 @@
 	}
 
 
-	QVariant data(QModelIndex index, int role = Qt.DisplayRole);
+	QVariant data(QModelIndex index, int role = Qt.DisplayRole)
 	{
 		return QAbstractProxyModel.data(index, role);
 	}
@@ -717,7 +717,7 @@
 
 	void sourceDataChanged(QModelIndex topLeft, QModelIndex bottomRight)
 	{
-		emit dataChanged(mapFromSource(topLeft), mapFromSource(bottomRight));
+		dataChanged.emit(mapFromSource(topLeft), mapFromSource(bottomRight));
 	}
 
 	void sourceRowsRemoved(QModelIndex , int start, int end)
@@ -768,9 +768,8 @@
 		m_loaded = true;
 	}
 
-
-	QList<int> m_sourceRow;
-	QHash<QString, int> m_historyHash;
+	int[] m_sourceRow;
+	int[QString] m_historyHash;
 	bool m_loaded;
 }
 
@@ -790,7 +789,7 @@
 	/*
 	Maps the first bunch of items of the source model to the root
 	*/
-	HistoryMenuModel(HistoryTreeModel sourceModel, QObject parent = null)
+	this(HistoryTreeModel sourceModel, QObject parent = null)
 	{
 		super(parent);
 		m_treeModel = sourceModel;
@@ -802,7 +801,7 @@
 		return m_treeModel.columnCount(mapToSource(parent));
 	}
 
-	int rowCount(QModelIndex parent = QModelIndex());
+	int rowCount(QModelIndex parent = QModelIndex())
 	{
 		if (parent.column() > 0)
 			return 0;
@@ -854,8 +853,7 @@
 		return treeIndex;
 	}
 
-
-	QModelIndex index(int, int, QModelIndex &parent = QModelIndex());
+	QModelIndex index(int row, int column, QModelIndex parent = QModelIndex())
 	{
 		if (row < 0 || column < 0 || column >= columnCount(parent) || parent.column() > 0)
 			return QModelIndex();
@@ -876,7 +874,7 @@
 		return createIndex(row, column, historyRow);
 	}
 
-	QModelIndex parent(QModelIndex index = QModelIndex());
+	QModelIndex parent(QModelIndex index = QModelIndex())
 	{
 		int offset = index.internalId();
 		if (offset == -1 || !index.isValid())
@@ -910,7 +908,7 @@
 // Menu that is dynamically populated from the history
 class HistoryMenu : public ModelMenu
 {
-	mixin Signal!("openUrl", QUrl url);
+	mixin Signal!("openUrl", QUrl /*url*/);
 	
 public:
 
@@ -922,7 +920,7 @@
 		setHoverRole(HistoryModel.UrlStringRole);
 	}
 
-	void setInitialActions(QList<QAction> actions)
+	void setInitialActions(QAction[] actions)
 	{
 		m_initialActions = actions;
 		for (int i = 0; i < m_initialActions.count(); ++i)
@@ -966,7 +964,7 @@
 
 	void activated(QModelIndex index)
 	{
-		emit openUrl(index.data(HistoryModel.UrlRole).toUrl());
+		openUrl.emit(index.data(HistoryModel.UrlRole).toUrl());
 	}
 
 	void showHistoryDialog()
@@ -980,7 +978,7 @@
 
 	HistoryManager m_history;
 	HistoryMenuModel m_historyMenuModel;
-	QList<QAction> m_initialActions;
+	QAction[] m_initialActions;
 }
 
 
@@ -1027,7 +1025,6 @@
 		return index(row, sourceIndex.column());
 	}
 
-
 	QModelIndex mapToSource(QModelIndex proxyIndex)
 	{
 		if (!sourceModel())
@@ -1043,12 +1040,12 @@
 		return createIndex(row, column, 0);
 	}
 
-	QModelIndex parent(QModelIndex index= QModelIndex());
+	QModelIndex parent(QModelIndex index= QModelIndex())
 	{
 		return QModelIndex();
 	}
 
-	void setSourceModel(QAbstractItemModel sourceModel);
+	void setSourceModel(QAbstractItemModel sourceModel)
 	{
 		if (sourceModel()) {
 			sourceModel.modelReset.disconnect(&this.sourceReset);
@@ -1089,7 +1086,7 @@
 		setSourceModel(sourceModel);
 	}
 
-	QVariant data(QModelIndex index, int role = Qt.DisplayRole);
+	QVariant data(QModelIndex index, int role = Qt.DisplayRole)
 	{
 		if ((role == Qt.EditRole || role == Qt.DisplayRole)) {
 			int start = index.internalId();
@@ -1118,8 +1115,7 @@
 		return QAbstractProxyModel.data(index, role);
 	}
 
-
-	int columnCount(QModelIndex parent);
+	int columnCount(QModelIndex parent)
 	{
 		return sourceModel().columnCount(mapToSource(parent));
 	}
@@ -1155,8 +1151,7 @@
 		return (end - start);
 	}
 
-
-	QModelIndex mapFromSource(QModelIndex sourceIndex);
+	QModelIndex mapFromSource(QModelIndex sourceIndex)
 	{
 		if (!sourceIndex.isValid())
 			return QModelIndex();
@@ -1164,7 +1159,7 @@
 		if (m_sourceRowCache.isEmpty())
 			rowCount(QModelIndex());
 
-		QList<int>.iterator it;
+		int[].iterator it;
 		it = qLowerBound(m_sourceRowCache.begin(), m_sourceRowCache.end(), sourceIndex.row());
 		if (*it != sourceIndex.row())
 			--it;
@@ -1173,7 +1168,6 @@
 		return createIndex(row, sourceIndex.column(), dateRow + 1);
 	}
 
-
 	QModelIndex mapToSource(QModelIndex proxyIndex)
 	{
 		int offset = proxyIndex.internalId();
@@ -1183,7 +1177,6 @@
 		return sourceModel().index(startDateRow + proxyIndex.row(), proxyIndex.column());
 	}
 
-
 	QModelIndex index(int row, int column, QModelIndex parent = QModelIndex())
 	{
 		if (row < 0 || column < 0 || column >= columnCount(parent) || parent.column() > 0)
@@ -1194,7 +1187,6 @@
 		return createIndex(row, column, parent.row() + 1);
 	}
 
-
 	QModelIndex parent(QModelIndex index = QModelIndex())
 	{
 		int offset = index.internalId();
@@ -1203,7 +1195,6 @@
 		return createIndex(offset - 1, 0, 0);
 	}
 
-
 	bool hasChildren(QModelIndex parent = QModelIndex())
 	{
 		QModelIndex grandparent = parent.parent();
@@ -1212,7 +1203,6 @@
 		return false;
 	}
 
-
 	Qt.ItemFlags flags(QModelIndex index)
 	{
 		if (!index.isValid())
@@ -1220,7 +1210,7 @@
 		return Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsDragEnabled;
 	}
 
-	bool removeRows(int row, int count, QModelIndex parent = QModelIndex());
+	bool removeRows(int row, int count, QModelIndex parent = QModelIndex())
 	{
 		if (row < 0 || count <= 0 || row + count > rowCount(parent))
 			return false;
@@ -1275,7 +1265,7 @@
 		reset();
 	}
 
-	void sourceRowsInserted(QModelIndex parent, int start, int end);
+	void sourceRowsInserted(QModelIndex parent, int start, int end)
 	{
 		//Q_UNUSED(parent); // Avoid warnings when compiling release
 		assert(!parent.isValid());
@@ -1304,7 +1294,7 @@
 		if (m_sourceRowCache.isEmpty())
 			return;
 		for (int i = end; i >= start;) {
-			QList<int>::iterator it;
+			int[]::iterator it;
 			it = qLowerBound(m_sourceRowCache.begin(), m_sourceRowCache.end(), i);
 			// playing it safe
 			if (it == m_sourceRowCache.end()) {
@@ -1354,7 +1344,7 @@
 		return m_sourceRowCache.at(row);
 	}
 
-	QList<int> m_sourceRowCache;
+	int[] m_sourceRowCache;
 }
 
 
@@ -1386,11 +1376,12 @@
 
 class HistoryDialog : public QDialog, public Ui_HistoryDialog
 {
-	mixin Signal!("openUrl", QUrl url);
+	mixin Signal!("openUrl", QUrl /*url*/);
 
 public:
 
-	this(QWidget parent = null, HistoryManager history = null) : QDialog(parent)
+	this(QWidget parent = null, HistoryManager history = null)
+	//: QDialog(parent)
 	{
 		HistoryManager history = setHistory;
 		if (!history)
--- a/demos/browser/modelmenu.d	Fri May 22 10:59:00 2009 +0000
+++ b/demos/browser/modelmenu.d	Fri May 22 23:43:58 2009 +0000
@@ -52,8 +52,8 @@
 class ModelMenu : public QMenu
 {
 	
-mixin Signal!("activated", QModelIndex index);
-mixin Signal!("hovered", QString text);
+mixin Signal!("activated", QModelIndex /*index*/);
+mixin Signal!("hovered", QString /*text*/);
 
 public:
 
@@ -129,9 +129,9 @@
 		return m_separatorRole;
 	}
 
-	QAction makeAction(QIcon icon, QString text, QObject parent);
+	QAction makeAction(QIcon icon, QString text, QObject parent)
 	{
-		QFontMetrics fm(font());
+		auto fm = new QFontMetrics(font());
 		if (-1 == m_maxWidth)
 			m_maxWidth = fm.width(QLatin1Char('m')) * 30;
 		QString smallText = fm.elidedText(text, Qt.ElideMiddle, m_maxWidth);
@@ -235,9 +235,9 @@
 
 private:
 
-	QAction makeAction(QModelIndex index);
+	QAction makeAction(QModelIndex index)
 	{
-		QIcon icon = qvariant_cast<QIcon>(index.data(Qt.DecorationRole));
+		QIcon icon = cast(QIcon) index.data(Qt.DecorationRole);
 		QAction action = makeAction(icon, index.data().toString(), this);
 		QVariant v;
 		v.setValue(index);
--- a/demos/browser/networkaccessmanager.d	Fri May 22 10:59:00 2009 +0000
+++ b/demos/browser/networkaccessmanager.d	Fri May 22 23:43:58 2009 +0000
@@ -67,6 +67,7 @@
 class NetworkAccessManager : public QNetworkAccessManager
 {
 public:
+
 	this(QObject parent = null)
 	{
 		super(parent);
@@ -85,7 +86,8 @@
 	}
 
 private:
-    QList<QString> sslTrustedHostList;
+
+    QString[] sslTrustedHostList;
 
 public:
 
@@ -157,11 +159,12 @@
 		}
 	}
 
-version(QT_NO_OPENSSL) {
-	void sslErrors(QNetworkReply reply, QList<QSslError> error)
+version(QT_NO_OPENSSL)
+{
+	void sslErrors(QNetworkReply reply, QSslError[] error)
 	{
 		// check if SSL certificate has been trusted already
-		QString replyHost = reply.url().host() + ":" + reply.url().port();
+		QString replyHost = reply.url().host() ~ ":" ~ reply.url().port();
 		if(! sslTrustedHostList.contains(replyHost)) {
 			BrowserMainWindow mainWindow = BrowserApplication.instance().mainWindow();
 
--- a/demos/browser/searchlineedit.d	Fri May 22 10:59:00 2009 +0000
+++ b/demos/browser/searchlineedit.d	Fri May 22 23:43:58 2009 +0000
@@ -71,7 +71,7 @@
 		setFocusPolicy(Qt.NoFocus);
 	}
 	
-	void paintEvent(QPaintEvent *event)
+	void paintEvent(QPaintEvent event)
 	{
 		//Q_UNUSED(event);
 		QPainter painter(this);
@@ -92,7 +92,7 @@
 		painter.drawLine(border, height - border, width() - border, border);
 	}
 
-	void textChanged(QString &text)
+	void textChanged(QString text)
 	{
 		setVisible(!text.isEmpty());
 	}
@@ -171,7 +171,7 @@
 
 class SearchLineEdit : public ExLineEdit
 {
-    mixin Signal!("textChanged", QString &text);
+    mixin Signal!("textChanged", QString /*text*/);
 
 public:
 	
@@ -181,8 +181,9 @@
 	- When there is no text and doesn't have focus an "inactive text" is displayed
 	- When there is text a clear button is displayed on the right hand side
 	*/
-	this(QWidget parent = null) : ExLineEdit(parent)
+	this(QWidget parent = null)
 	{
+		super(parent);
 		m_searchButton = new SearchButton(this);
 		lineEdit.textChanged.connect(&this.textChanged);
 		setLeftWidget(m_searchButton);
@@ -197,7 +198,7 @@
 		return m_inactiveText;
 	}
 
-	void setInactiveText(QString &text)
+	void setInactiveText(QString text)
 	{
 		m_inactiveText = text;
 	}
--- a/demos/browser/settings.d	Fri May 22 10:59:00 2009 +0000
+++ b/demos/browser/settings.d	Fri May 22 23:43:58 2009 +0000
@@ -46,7 +46,7 @@
 import qt.gui.qt.gui;
 import qt.gui.QDialog;
 
-import QtWebKit.QtWebKit;
+import qt.webkit.QtWebKit;
 
 import browserapplication;
 import browsermainwindow;
@@ -61,15 +61,15 @@
 {
 public:
 	
-	this(QWidget parent = null);
-	: QDialog(parent)
+	this(QWidget parent = null)
+	//: QDialog(parent)
 	{
 		setupUi(this);
-		connect(exceptionsButton, SIGNAL(clicked()), this, SLOT(showExceptions()));
-		connect(setHomeToCurrentPageButton, SIGNAL(clicked()), this, SLOT(setHomeToCurrentPage()));
-		connect(cookiesButton, SIGNAL(clicked()), this, SLOT(showCookies()));
-		connect(standardFontButton, SIGNAL(clicked()), this, SLOT(chooseFont()));
-		connect(fixedFontButton, SIGNAL(clicked()), this, SLOT(chooseFixedFont()));
+		exceptionsButton.clicked.connect(&this.showExceptions);
+		setHomeToCurrentPageButton.clicked.connect(&this.setHomeToCurrentPage);
+		cookiesButton.clicked.connect(&this.showCookies()));
+		standardFontButton.clicked.connect(this.chooseFont);
+		fixedFontButton.clicked.connect(&this.chooseFixedFont);
 
 		loadDefaults();
 		loadFromSettings();
--- a/demos/browser/tabwidget.d	Fri May 22 10:59:00 2009 +0000
+++ b/demos/browser/tabwidget.d	Fri May 22 23:43:58 2009 +0000
@@ -67,12 +67,12 @@
 class TabBar : public QTabBar
 {
 	mixin Signal!("newTab");
-	mixin Signal!("cloneTab", int index);
-	mixin Signal!("closeTab", int index);
-	mixin Signal!("closeOtherTabs", int index);
-	mixin Signal!("reloadTab", int index);
+	mixin Signal!("cloneTab", int /*index*);
+	mixin Signal!("closeTab", int index*/);
+	mixin Signal!("closeOtherTabs", int /*index*/);
+	mixin Signal!("reloadTab", int /*index*/);
 	mixin Signal!("reloadAllTabs");
-	mixin Signal!("tabMoveRequested", int fromIndex, int toIndex);
+	mixin Signal!("tabMoveRequested", int /*fromIndex*/, int /*toIndex*/);
 
 public:
 
@@ -141,7 +141,7 @@
 		}
 	}
 
-	void cloneTab();
+	void cloneTab()
 	{
 		if (QAction action = qobject_cast<QAction>(sender())) {
 			int index = action.data().toInt();
@@ -149,7 +149,7 @@
 		}
 	}
 
-	void closeTab();
+	void closeTab()
 	{
 		if (QAction action = qobject_cast<QAction>(sender())) {
 			int index = action.data().toInt();
@@ -201,9 +201,9 @@
 		menu.exec(QCursor.pos());
 	}
 
-	private:
-	QList<QShortcut> m_tabShortcuts;
-	friend class TabWidget;
+private:
+	
+	QShortcut[] m_tabShortcuts;
 
 	QPoint m_dragStartPos;
 	int m_dragCurrentIndex;
@@ -235,7 +235,7 @@
 		root.setEnabled(false);
 	}
 
-	QWebPage.WebAction webAction() const
+	QWebPage.WebAction webAction()
 	{
 		return m_webAction;
 	}
@@ -317,20 +317,20 @@
 class TabWidget : public QTabWidget
 {
 	// tab widget signals
-	mixin Singal!("loadPage", QString url);
+	mixin Singal!("loadPage", QString /*url*/);
 	mixin Singal!("tabsChanged");
 	mixin Singal!("lastTabClosed");
 
 	// current tab signals
-	mixin Singal!("setCurrentTitle", QString url);
-	mixin Singal!("showStatusBarMessage", QString message);
-	mixin Singal!("linkHovered", QString link);
-	mixin Singal!("loadProgress", int progress);
-	mixin Singal!("geometryChangeRequested", QRect geometry);
-	mixin Singal!("menuBarVisibilityChangeRequested", bool visible);
-	mixin Singal!("statusBarVisibilityChangeRequested", bool visible);
-	mixin Singal!("toolBarVisibilityChangeRequested", bool visible);
-	mixin Singal!("printRequested", QWebFrame frame);
+	mixin Singal!("setCurrentTitle", QString /*url*/);
+	mixin Singal!("showStatusBarMessage", QString /*message*/);
+	mixin Singal!("linkHovered", QString /*link*/);
+	mixin Singal!("loadProgress", int /*progress*/);
+	mixin Singal!("geometryChangeRequested", QRect /*geometry*/);
+	mixin Singal!("menuBarVisibilityChangeRequested", bool /*visible*/);
+	mixin Singal!("statusBarVisibilityChangeRequested", bool /*visible*/);
+	mixin Singal!("toolBarVisibilityChangeRequested", bool /*visible*/);
+	mixin Singal!("printRequested", QWebFrame /*frame*/);
 
 public:
 
@@ -418,50 +418,50 @@
 		m_actions.append(new WebActionMapper(action, webAction, this));
 	}
 
-	QAction newTabAction() const;
+	QAction newTabAction()
 	{
 		return m_newTabAction;
 	}
 
-	QAction closeTabAction() const;
+	QAction closeTabAction()
 	{
 		return m_closeTabAction;
 	}
 	
-	QAction recentlyClosedTabsAction() const;
+	QAction recentlyClosedTabsAction()
 	{
 		return m_recentlyClosedTabsAction;
 	}
 
-	QAction nextTabAction() const
+	QAction nextTabAction()
 	{
 		return m_nextTabAction;
 	}
 
-	QAction previousTabAction() const
+	QAction previousTabAction()
 	{
 		return m_previousTabAction;
 	}
 
-	QWidget lineEditStack() const
+	QWidget lineEditStack()
 	{
 		return m_lineEdits;
 	}
 
-	QLineEdit currentLineEdit() const
+	QLineEdit currentLineEdit()
 	{
 		return lineEdit(m_lineEdits.currentIndex());
 	}
 
-	WebView currentWebView() const
+	WebView currentWebView()
 	{
 		return webView(currentIndex());
 	}
 
-	WebView webView(int index) const
+	WebView webView(int index)
 	{
 		QWidget widget = this.widget(index);
-		if (WebView webView = qobject_cast<WebView>(widget)) {
+		if (WebView webView = cast(WebView) widget) {
 			return webView;
 		} else {
 			// optimization to delay creating the first webview
@@ -477,7 +477,7 @@
 		return 0;
 	}
 
-	QLineEdit lineEdit(int index) const
+	QLineEdit lineEdit(int index)
 	{
 		UrlLineEdit urlLineEdit = qobject_cast<UrlLineEdit>(m_lineEdits.widget(index));
 		if (urlLineEdit)
@@ -485,7 +485,7 @@
 		return 0;
 	}
 
-	int webViewIndex(WebView webView) const
+	int webViewIndex(WebView webView)
 	{
 		int index = indexOf(webView);
 		return index;
@@ -494,7 +494,7 @@
     
 static const qint32 TabWidgetMagic = 0xaa;
 
-	QByteArray saveState() const;
+	QByteArray saveState()
 	{
 		int version = 1;
 		QByteArray data;
@@ -505,7 +505,7 @@
 
 		QStringList tabs;
 		for (int i = 0; i < count(); ++i) {
-			if (WebView tab = qobject_cast<WebView>(widget(i))) {
+			if (WebView tab = cast(WebView) widget(i))) {
 				tabs.append(tab.url().toString());
 			} else {
 				tabs.append(QString.null);
@@ -549,7 +549,7 @@
 
 protected:
 
-	void mouseDoubleClickEvent(QMouseEvent event);
+	void mouseDoubleClickEvent(QMouseEvent event)
 	{
 		if (!childAt(event.pos())
 			// Remove the line below when QTabWidget does not have a one pixel frame
@@ -669,7 +669,7 @@
 	}
 
 	// When index is -1 index chooses the current tab
-	void closeTab(int index = -1);
+	void closeTab(int index = -1)
 	{
 		if (index < 0)
 			index = currentIndex();
@@ -722,7 +722,7 @@
 	}
 
 	// When index is -1 index chooses the current tab
-	void reloadTab(int index = -1);
+	void reloadTab(int index = -1)
 	{
 		if (index < 0)
 			index = currentIndex();
@@ -730,15 +730,15 @@
 			return;
 
 		QWidget widget = this.widget(index);
-		if (WebView tab = qobject_cast<WebView>(widget))
+		if (WebView tab = cast(WebView) widget)
 			tab.reload();
 	}
 
-	void reloadAllTabs();
+	void reloadAllTabs()
 	{
 		for (int i = 0; i < count(); ++i) {
 			QWidget tabWidget = widget(i);
-			if (WebView tab = qobject_cast<WebView>(tabWidget)) {
+			if (WebView tab = cast(WebView) tabWidget) {
 				tab.reload();
 			}
 		}
@@ -816,7 +816,7 @@
 
 	void webViewLoadStarted()
 	{
-		WebView webView = qobject_cast<WebView>(sender());
+		WebView webView = cast(WebView) sender();
 		int index = webViewIndex(webView);
 		if (-1 != index) {
 			QIcon icon(QLatin1String(":loading.gif"));
@@ -826,7 +826,7 @@
 
 	void webViewIconChanged()
 	{
-		WebView webView = qobject_cast<WebView>(sender());
+		WebView webView = cast(WebView) sender();
 		int index = webViewIndex(webView);
 		if (-1 != index) {
 			QIcon icon = BrowserApplication.instance().icon(webView.url());
@@ -836,7 +836,7 @@
 
 	void webViewTitleChanged(QString title)
 	{
-		WebView webView = qobject_cast<WebView>(sender());
+		WebView webView = cast(WebView) sender();
 		int index = webViewIndex(webView);
 		if (-1 != index) {
 			setTabText(index, title);
@@ -848,7 +848,7 @@
 
 	void webViewUrlChanged(QUrl url)
 	{
-		WebView webView = qobject_cast<WebView>(sender());
+		WebView webView = cast(WebView) sender();
 		int index = webViewIndex(webView);
 		if (-1 != index) {
 			m_tabBar.setTabData(index, url);
@@ -858,7 +858,7 @@
 
 	void lineEditReturnPressed()
 	{
-		if (QLineEdit lineEdit = qobject_cast<QLineEdit*>(sender())) {
+		if (QLineEdit lineEdit = cast(QLineEdit) sender()) {
 			emit loadPage(lineEdit.text());
 			if (m_lineEdits.currentWidget() == lineEdit)
 				currentWebView().setFocus();
@@ -867,8 +867,8 @@
 
 	void windowCloseRequested()
 	{
-		WebPage webPage = qobject_cast<WebPage>(sender());
-		WebView webView = qobject_cast<WebView>(webPage.view());
+		WebPage webPage = cast(WebPage) sender();
+		WebView webView = cast(WebView) webPage.view();
 		int index = webViewIndex(webView);
 		if (index >= 0) {
 			if (count() == 1)
@@ -895,8 +895,8 @@
 
 	QMenu m_recentlyClosedTabsMenu;
 	static const int m_recentlyClosedTabsSize = 10;
-	QList<QUrl> m_recentlyClosedTabs;
-	QList<WebActionMapper> m_actions;
+	QUrl[] m_recentlyClosedTabs;
+	WebActionMapper[] m_actions;
 
 	QCompleter m_lineEditCompleter;
 	QStackedWidget m_lineEdits;
--- a/demos/browser/toolbarsearch.d	Fri May 22 10:59:00 2009 +0000
+++ b/demos/browser/toolbarsearch.d	Fri May 22 23:43:58 2009 +0000
@@ -56,9 +56,9 @@
 
 class ToolbarSearch : public SearchLineEdit
 {
-	mixin Signal!("search", QUrl url)
+	mixin Signal!("search", QUrl /*url*/)
 
-	public:
+public:
 
 	/*
 	ToolbarSearch is a very basic search widget that also contains a small history.
--- a/demos/browser/urllineedit.d	Fri May 22 10:59:00 2009 +0000
+++ b/demos/browser/urllineedit.d	Fri May 22 23:43:58 2009 +0000
@@ -326,7 +326,7 @@
 		}
 	}
 
-	void focusOutEvent(QFocusEvent event);
+	void focusOutEvent(QFocusEvent event)
 	{
 		if (m_lineEdit.text().isEmpty() && m_webView)
 			m_lineEdit.setText(QString.fromUtf8(m_webView.url().toEncoded()));
@@ -343,7 +343,7 @@
 
 	void webViewIconChanged()
 	{
-		QUrl url = (m_webView)  ? m_webView.url() : QUrl();
+		QUrl url = (m_webView)  ? m_webView.url() : new QUrl();
 		QIcon icon = BrowserApplication.instance().icon(url);
 		QPixmap pixmap(icon.pixmap(16, 16));
 		m_iconLabel.setPixmap(pixmap);
--- a/demos/browser/webview.d	Fri May 22 10:59:00 2009 +0000
+++ b/demos/browser/webview.d	Fri May 22 23:43:58 2009 +0000
@@ -62,7 +62,7 @@
 
 class WebPage : public QWebPage
 {
-	mixin Signal!("loadingUrl", QUrl url);
+	mixin Signal!("loadingUrl", QUrl /*url*/);
 
 public:
 
@@ -89,7 +89,7 @@
 
 protected:
 
-	bool acceptNavigationRequest(QWebFrame frame, QNetworkRequest request, NavigationType type);
+	bool acceptNavigationRequest(QWebFrame frame, QNetworkRequest request, NavigationType type)
 	{
 		// ctrl open in new tab
 		// ctrl-shift open in new tab and select
@@ -138,7 +138,7 @@
 
 	version(QT_NO_UITOOLS) {} else
 	{
-		QObject createPlugin(const QString &classId, const QUrl &url, const QStringList &paramNames, const QStringList &paramValues);
+		QObject createPlugin(QString classId, QUrl url, QStringList paramNames, QStringList paramValues);
 		{
 			//Q_UNUSED(url);
 			//Q_UNUSED(paramNames);
@@ -159,7 +159,7 @@
 
 		QFile file(QLatin1String(":/notfound.html"));
 		bool isOpened = file.open(QIODevice.ReadOnly);
-		Q_ASSERT(isOpened);
+		assert(isOpened);
 		QString title = tr("Error loading page: %1").arg(reply.url().toString());
 		QString html = QString(QLatin1String(file.readAll()))
 			.arg(title)
@@ -175,7 +175,7 @@
 			QString(QLatin1String(imageBuffer.buffer().toBase64())));
 		}
 
-		QList<QWebFrame*> frames;
+		QWebFrame[] frames;
 		frames.append(mainFrame());
 		while (!frames.isEmpty()) {
 			QWebFrame frame = frames.takeFirst();
@@ -183,8 +183,8 @@
 				frame.setHtml(html, reply.url());
 				return;
 			}
-			QList<QWebFrame > children = frame.childFrames();
-			foreach(QWebFrame frame, children)
+			QWebFrame[] children = frame.childFrames();
+			foreach(QWebFrame frame; children)
 				frames.append(frame);
 		}
 		if (m_loadingUrl == reply.url()) {
@@ -227,7 +227,7 @@
 		load(url);
 	}
 
-	QUrl url() const
+	QUrl url()
 	{
 		QUrl url = QWebView.url();
 		if (!url.isEmpty())
@@ -244,7 +244,7 @@
 
 protected:
 
-	void mousePressEvent(QMouseEvent event);
+	void mousePressEvent(QMouseEvent event)
 	{
 		m_page.m_pressedButtons = event.buttons();
 		m_page.m_keyboardModifiers = event.modifiers();
--- a/demos/browser/xbel.d	Fri May 22 10:59:00 2009 +0000
+++ b/demos/browser/xbel.d	Fri May 22 23:43:58 2009 +0000
@@ -52,10 +52,10 @@
 public:
 
 	enum Type {
-	Root,
-	Folder,
-	Bookmark,
-	Separator
+		Root,
+		Folder,
+		Bookmark,
+		Separator
 	};
 
 	this(Type type = Root, BookmarkNode parent = null)
@@ -89,7 +89,7 @@
 		return true;
 	}
 
-	Type type() const
+	Type type()
 	{
 		return m_type;
 	}
@@ -99,7 +99,7 @@
 		m_type = type;
 	}
 
-	QList<BookmarkNode > children() const
+	BookmarkNode[] children()
 	{
 		return m_children;
 	}
@@ -136,7 +136,7 @@
 
 	BookmarkNode m_parent;
 	Type m_type;
-	QList<BookmarkNode> m_children;
+	BookmarkNode[] m_children;
 }
 
 class XbelReader : public QXmlStreamReader
@@ -149,7 +149,7 @@
 
 	BookmarkNode read(QString fileName)
 	{
-		QFile file(fileName);
+		auto file = new QFile(fileName);
 		if (!file.exists()) {
 			return new BookmarkNode(BookmarkNode.Root);
 		}
@@ -176,6 +176,7 @@
 	}
 
 private:
+
 	void skipUnknownElement()
 	{
 		assert(isStartElement());
@@ -298,7 +299,7 @@
 		setAutoFormatting(true);
 	}
 	
-	bool write(QString fileName, BookmarkNode root);
+	bool write(QString fileName, BookmarkNode root)
 	{
 		QFile file(fileName);
 		if (!root || !file.open(QFile.WriteOnly))
@@ -306,7 +307,7 @@
 		return write(&file, root);
 	}
 
-	bool write(QIODevice device, BookmarkNode root);
+	bool write(QIODevice device, BookmarkNode root)
 	{
 		setDevice(device);