summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2017-05-02 16:25:23 +0200
committerKai Koehne <kai.koehne@qt.io>2017-05-02 14:54:29 +0000
commitfa0aa60a9a7da656dad351e89e0a4612e889c7db (patch)
tree44c5a26d9c9b64eb3c94df17692ba39b60612d41 /examples
parent9265be9445ebd3bcd404dcca9186a1abc5c454cd (diff)
QuickNanoBrowser: Unify use of semicolons in JS
See also http://lists.qt-project.org/pipermail/development/2016-October/027441.html Change-Id: Id0f3e5e994e2160f7f199c02d5e79d0ad86a0d70 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/webengine/quicknanobrowser/ApplicationRoot.qml18
-rw-r--r--examples/webengine/quicknanobrowser/BrowserWindow.qml126
-rw-r--r--examples/webengine/quicknanobrowser/DownloadView.qml12
-rw-r--r--examples/webengine/quicknanobrowser/FullScreenNotification.qml12
4 files changed, 84 insertions, 84 deletions
diff --git a/examples/webengine/quicknanobrowser/ApplicationRoot.qml b/examples/webengine/quicknanobrowser/ApplicationRoot.qml
index 6735be932..78defab80 100644
--- a/examples/webengine/quicknanobrowser/ApplicationRoot.qml
+++ b/examples/webengine/quicknanobrowser/ApplicationRoot.qml
@@ -70,18 +70,18 @@ QtObject {
onClosing: destroy()
}
function createWindow(profile) {
- var newWindow = browserWindowComponent.createObject(root)
- newWindow.currentWebView.profile = profile
- profile.downloadRequested.connect(newWindow.onDownloadRequested)
- return newWindow
+ var newWindow = browserWindowComponent.createObject(root);
+ newWindow.currentWebView.profile = profile;
+ profile.downloadRequested.connect(newWindow.onDownloadRequested);
+ return newWindow;
}
function createDialog(profile) {
- var newDialog = browserDialogComponent.createObject(root)
- newDialog.currentWebView.profile = profile
- return newDialog
+ var newDialog = browserDialogComponent.createObject(root);
+ newDialog.currentWebView.profile = profile;
+ return newDialog;
}
function load(url) {
- var browserWindow = createWindow(defaultProfile)
- browserWindow.currentWebView.url = url
+ var browserWindow = createWindow(defaultProfile);
+ browserWindow.currentWebView.url = url;
}
}
diff --git a/examples/webengine/quicknanobrowser/BrowserWindow.qml b/examples/webengine/quicknanobrowser/BrowserWindow.qml
index b53db9bdb..596e4a76e 100644
--- a/examples/webengine/quicknanobrowser/BrowserWindow.qml
+++ b/examples/webengine/quicknanobrowser/BrowserWindow.qml
@@ -80,19 +80,19 @@ ApplicationWindow {
Settings {
id : appSettings
- property alias autoLoadImages: loadImages.checked;
- property alias javaScriptEnabled: javaScriptEnabled.checked;
- property alias errorPageEnabled: errorPageEnabled.checked;
- property alias pluginsEnabled: pluginsEnabled.checked;
- property alias fullScreenSupportEnabled: fullScreenSupportEnabled.checked;
- property alias autoLoadIconsForPage: autoLoadIconsForPage.checked;
- property alias touchIconsEnabled: touchIconsEnabled.checked;
+ property alias autoLoadImages: loadImages.checked
+ property alias javaScriptEnabled: javaScriptEnabled.checked
+ property alias errorPageEnabled: errorPageEnabled.checked
+ property alias pluginsEnabled: pluginsEnabled.checked
+ property alias fullScreenSupportEnabled: fullScreenSupportEnabled.checked
+ property alias autoLoadIconsForPage: autoLoadIconsForPage.checked
+ property alias touchIconsEnabled: touchIconsEnabled.checked
}
Action {
shortcut: "Ctrl+D"
onTriggered: {
- downloadView.visible = !downloadView.visible
+ downloadView.visible = !downloadView.visible;
}
}
Action {
@@ -107,14 +107,14 @@ ApplicationWindow {
shortcut: StandardKey.Refresh
onTriggered: {
if (currentWebView)
- currentWebView.reload()
+ currentWebView.reload();
}
}
Action {
shortcut: StandardKey.AddTab
onTriggered: {
- tabs.createEmptyTab(currentWebView.profile)
- tabs.currentIndex = tabs.count - 1
+ tabs.createEmptyTab(currentWebView.profile);
+ tabs.currentIndex = tabs.count - 1;
addressBar.forceActiveFocus();
addressBar.selectAll();
}
@@ -129,23 +129,23 @@ ApplicationWindow {
shortcut: "Escape"
onTriggered: {
if (currentWebView.state == "FullScreen") {
- browserWindow.visibility = browserWindow.previousVisibility
- fullScreenNotification.hide()
+ browserWindow.visibility = browserWindow.previousVisibility;
+ fullScreenNotification.hide();
currentWebView.triggerWebAction(WebEngineView.ExitFullScreen);
}
}
}
Action {
shortcut: "Ctrl+0"
- onTriggered: currentWebView.zoomFactor = 1.0;
+ onTriggered: currentWebView.zoomFactor = 1.0
}
Action {
shortcut: StandardKey.ZoomOut
- onTriggered: currentWebView.zoomFactor -= 0.1;
+ onTriggered: currentWebView.zoomFactor -= 0.1
}
Action {
shortcut: StandardKey.ZoomIn
- onTriggered: currentWebView.zoomFactor += 0.1;
+ onTriggered: currentWebView.zoomFactor += 0.1
}
Action {
@@ -188,7 +188,7 @@ ApplicationWindow {
toolBar: ToolBar {
id: navigationBar
RowLayout {
- anchors.fill: parent;
+ anchors.fill: parent
ToolButton {
enabled: currentWebView && (currentWebView.canGoBack || currentWebView.canGoForward)
menu:Menu {
@@ -337,12 +337,12 @@ ApplicationWindow {
TabView {
id: tabs
function createEmptyTab(profile) {
- var tab = addTab("", tabComponent)
+ var tab = addTab("", tabComponent);
// We must do this first to make sure that tab.active gets set so that tab.item gets instantiated immediately.
- tab.active = true
- tab.title = Qt.binding(function() { return tab.item.title })
- tab.item.profile = profile
- return tab
+ tab.active = true;
+ tab.title = Qt.binding(function() { return tab.item.title });
+ tab.item.profile = profile;
+ return tab;
}
anchors.fill: parent
@@ -356,10 +356,10 @@ ApplicationWindow {
onLinkHovered: {
if (hoveredUrl == "")
- resetStatusText.start()
+ resetStatusText.start();
else {
- resetStatusText.stop()
- statusText.text = hoveredUrl
+ resetStatusText.stop();
+ statusText.text = hoveredUrl;
}
}
@@ -386,69 +386,69 @@ ApplicationWindow {
settings.touchIconsEnabled: appSettings.touchIconsEnabled
onCertificateError: {
- error.defer()
- sslDialog.enqueue(error)
+ error.defer();
+ sslDialog.enqueue(error);
}
onNewViewRequested: {
if (!request.userInitiated)
- print("Warning: Blocked a popup window.")
+ print("Warning: Blocked a popup window.");
else if (request.destination == WebEngineView.NewViewInTab) {
- var tab = tabs.createEmptyTab(currentWebView.profile)
- tabs.currentIndex = tabs.count - 1
- request.openIn(tab.item)
+ var tab = tabs.createEmptyTab(currentWebView.profile);
+ tabs.currentIndex = tabs.count - 1;
+ request.openIn(tab.item);
} else if (request.destination == WebEngineView.NewViewInBackgroundTab) {
- var backgroundTab = tabs.createEmptyTab(currentWebView.profile)
- request.openIn(backgroundTab.item)
+ var backgroundTab = tabs.createEmptyTab(currentWebView.profile);
+ request.openIn(backgroundTab.item);
} else if (request.destination == WebEngineView.NewViewInDialog) {
- var dialog = applicationRoot.createDialog(currentWebView.profile)
- request.openIn(dialog.currentWebView)
+ var dialog = applicationRoot.createDialog(currentWebView.profile);
+ request.openIn(dialog.currentWebView);
} else {
- var window = applicationRoot.createWindow(currentWebView.profile)
- request.openIn(window.currentWebView)
+ var window = applicationRoot.createWindow(currentWebView.profile);
+ request.openIn(window.currentWebView);
}
}
onFullScreenRequested: {
if (request.toggleOn) {
- webEngineView.state = "FullScreen"
- browserWindow.previousVisibility = browserWindow.visibility
- browserWindow.showFullScreen()
- fullScreenNotification.show()
+ webEngineView.state = "FullScreen";
+ browserWindow.previousVisibility = browserWindow.visibility;
+ browserWindow.showFullScreen();
+ fullScreenNotification.show();
} else {
- webEngineView.state = ""
- browserWindow.visibility = browserWindow.previousVisibility
- fullScreenNotification.hide()
+ webEngineView.state = "";
+ browserWindow.visibility = browserWindow.previousVisibility;
+ fullScreenNotification.hide();
}
- request.accept()
+ request.accept();
}
onRenderProcessTerminated: {
- var status = ""
+ var status = "";
switch (terminationStatus) {
case WebEngineView.NormalTerminationStatus:
- status = "(normal exit)"
+ status = "(normal exit)";
break;
case WebEngineView.AbnormalTerminationStatus:
- status = "(abnormal exit)"
+ status = "(abnormal exit)";
break;
case WebEngineView.CrashedTerminationStatus:
- status = "(crashed)"
+ status = "(crashed)";
break;
case WebEngineView.KilledTerminationStatus:
- status = "(killed)"
+ status = "(killed)";
break;
}
- print("Render process exited with code " + exitCode + " " + status)
- reloadTimer.running = true
+ print("Render process exited with code " + exitCode + " " + status);
+ reloadTimer.running = true;
}
onWindowCloseRequested: {
if (tabs.count == 1)
- browserWindow.close()
+ browserWindow.close();
else
- tabs.removeTab(tabs.currentIndex)
+ tabs.removeTab(tabs.currentIndex);
}
Timer {
@@ -474,19 +474,19 @@ ApplicationWindow {
"you may not be connected with the host you tried to connect to.\n" +
"Do you wish to override the security check and continue?"
onYes: {
- certErrors.shift().ignoreCertificateError()
- presentError()
+ certErrors.shift().ignoreCertificateError();
+ presentError();
}
onNo: reject()
onRejected: reject()
function reject(){
- certErrors.shift().rejectCertificate()
- presentError()
+ certErrors.shift().rejectCertificate();
+ presentError();
}
function enqueue(error){
- certErrors.push(error)
- presentError()
+ certErrors.push(error);
+ presentError();
}
function presentError(){
visible = certErrors.length > 0
@@ -504,9 +504,9 @@ ApplicationWindow {
}
function onDownloadRequested(download) {
- downloadView.visible = true
- downloadView.append(download)
- download.accept()
+ downloadView.visible = true;
+ downloadView.append(download);
+ download.accept();
}
Rectangle {
diff --git a/examples/webengine/quicknanobrowser/DownloadView.qml b/examples/webengine/quicknanobrowser/DownloadView.qml
index 13be4bd78..ed28c761c 100644
--- a/examples/webengine/quicknanobrowser/DownloadView.qml
+++ b/examples/webengine/quicknanobrowser/DownloadView.qml
@@ -64,8 +64,8 @@ Rectangle {
}
function append(download) {
- downloadModel.append(download)
- downloadModel.downloads.push(download)
+ downloadModel.append(download);
+ downloadModel.downloads.push(download);
}
Component {
@@ -113,14 +113,14 @@ Rectangle {
anchors.right: parent.right
iconSource: "icons/process-stop.png"
onClicked: {
- var download = downloadModel.downloads[index]
+ var download = downloadModel.downloads[index];
- download.cancel()
+ download.cancel();
downloadModel.downloads = downloadModel.downloads.filter(function (el) {
return el.id !== download.id;
});
- downloadModel.remove(index)
+ downloadModel.remove(index);
}
}
}
@@ -167,7 +167,7 @@ Rectangle {
text: "OK"
anchors.centerIn: parent
onClicked: {
- downloadView.visible = false
+ downloadView.visible = false;
}
}
}
diff --git a/examples/webengine/quicknanobrowser/FullScreenNotification.qml b/examples/webengine/quicknanobrowser/FullScreenNotification.qml
index 80a63d479..f0487e868 100644
--- a/examples/webengine/quicknanobrowser/FullScreenNotification.qml
+++ b/examples/webengine/quicknanobrowser/FullScreenNotification.qml
@@ -51,14 +51,14 @@ Rectangle {
opacity: 0
function show() {
- visible = true
- opacity = 1
- reset.start()
+ visible = true;
+ opacity = 1;
+ reset.start();
}
function hide() {
- reset.stop()
- opacity = 0
+ reset.stop();
+ opacity = 0;
}
Behavior on opacity {
@@ -66,7 +66,7 @@ Rectangle {
duration: 750
onStopped: {
if (opacity == 0)
- visible = false
+ visible = false;
}
}
}