From c485cedb3d55c7e2314a8a7b1908af7973049812 Mon Sep 17 00:00:00 2001 From: Mark Washeim Date: Thu, 1 Dec 2022 11:00:18 +0100 Subject: [PATCH] Added some more debug flags to stop spewing the console. --- qml/pages/LoginPage.qml | 27 ++++++++++++++------------- qml/pages/ProfilePage.qml | 11 ++++++----- translations/harbour-tooterb-de.ts | 4 ++++ translations/harbour-tooterb-el.ts | 4 ++++ translations/harbour-tooterb-es.ts | 4 ++++ translations/harbour-tooterb-fr.ts | 4 ++++ translations/harbour-tooterb-it.ts | 4 ++++ translations/harbour-tooterb-nl.ts | 4 ++++ translations/harbour-tooterb-nl_BE.ts | 4 ++++ translations/harbour-tooterb-oc.ts | 4 ++++ translations/harbour-tooterb-pl.ts | 4 ++++ translations/harbour-tooterb-ru.ts | 4 ++++ translations/harbour-tooterb-sr.ts | 4 ++++ translations/harbour-tooterb-sv.ts | 4 ++++ translations/harbour-tooterb-zh_CN.ts | 4 ++++ translations/harbour-tooterb.ts | 4 ++++ 16 files changed, 76 insertions(+), 18 deletions(-) diff --git a/qml/pages/LoginPage.qml b/qml/pages/LoginPage.qml index b5f12b9..8526528 100644 --- a/qml/pages/LoginPage.qml +++ b/qml/pages/LoginPage.qml @@ -7,6 +7,7 @@ import "../lib/API.js" as Logic Page { + property bool debug: false // Python connections and signals, callable from QML side // This is not ideal but keeps the page from erroring out on redirect @@ -17,13 +18,13 @@ Page { importModule('server', function () {}); setHandler('finished', function(newvalue) { - console.debug(newvalue) + if(debug) console.debug(newvalue) }); startDownload(); } function startDownload() { call('server.downloader.serve', function() {}); - console.debug("called") + if (debug) console.debug("called") } } @@ -67,7 +68,7 @@ Page { "https://github.com/poetaster/harbour-tooter#readme", //website on the login screen function(data) { - console.log(data) + if (debug) console.log(data) var conf = JSON.parse(data) conf.instance = instance.text; conf.login = false; @@ -78,8 +79,8 @@ Page { conf['mastodon_client_redirect_uri'] = data['mastodon_client_redirect_uri']; delete Logic.conf;*/ Logic.conf = conf; - console.log(JSON.stringify(conf)) - console.log(JSON.stringify(Logic.conf)) + if(debug) console.log(JSON.stringify(conf)) + if(debug) console.log(JSON.stringify(Logic.conf)) // we got our application // our user to it! @@ -88,7 +89,7 @@ Page { "code", // oauth method ["read", "write", "follow"] //scopes ); - console.log(url) + if(debug) console.log(url) webView.url = url webView.visible = true } @@ -128,8 +129,8 @@ Page { } onRecvAsyncMessage: { - console.log('async changed: ' + url) - console.debug(message) + if(debug) console.log('async changed: ' + url) + if(debug) console.debug(message) switch (message) { case "embed:contentOrientationChanged": break @@ -153,7 +154,7 @@ Page { } onLoadingChanged: { - console.log('loading changed: ' + url) + if(debug) console.log('loading changed: ' + url) if ( (url+"").substr(0, 38) === 'http://localhost:8000/index.html?code=' || (url+"").substr(0, 39) === 'https://localhost:8000/index.html?code=' @@ -165,7 +166,7 @@ Page { var authCode = vars["code"]; - console.log(authCode) + if(debug) console.log(authCode) Logic.api.getAccessTokenFromAuthCode( Logic.conf["client_id"], @@ -174,10 +175,10 @@ Page { authCode, function(data) { // AAAND DATA CONTAINS OUR TOKEN! - console.log(data) + if(debug) console.log(data) data = JSON.parse(data) - console.log(JSON.stringify(data)) - console.log(JSON.stringify(data.access_token)) + if(debug) console.log(JSON.stringify(data)) + if(debug) console.log(JSON.stringify(data.access_token)) Logic.conf["api_user_token"] = data.access_token Logic.conf["login"] = true; Logic.api.setConfig("api_user_token", Logic.conf["api_user_token"]) diff --git a/qml/pages/ProfilePage.qml b/qml/pages/ProfilePage.qml index efb5b21..96268da 100644 --- a/qml/pages/ProfilePage.qml +++ b/qml/pages/ProfilePage.qml @@ -29,12 +29,13 @@ Page { property bool muting: false property bool domain_blocking: false property date created_at + property bool debug: false WorkerScript { id: worker source: "../lib/Worker.js" onMessage: { - console.log(JSON.stringify(messageObject)) + if (debug) console.log(JSON.stringify(messageObject)) if(messageObject.action.indexOf("accounts/search") > -1 ){ user_id = messageObject.data.id followers_count = messageObject.data.followers_count @@ -54,7 +55,7 @@ Page { } if(messageObject.action === "accounts/relationships/"){ - console.log(JSON.stringify(messageObject)) + if (debug) console.log(JSON.stringify(messageObject)) following = messageObject.data.following requested = messageObject.data.requested followed_by = messageObject.data.followed_by @@ -190,9 +191,9 @@ Page { anchors.horizontalCenter: parent.horizontalCenter onLinkActivated: { var test = link.split("/") - console.log(link) - console.log(JSON.stringify(test)) - console.log(JSON.stringify(test.length)) + if (debug) console.log(link) + if (debug) console.log(JSON.stringify(test)) + if (debug) console.log(JSON.stringify(test.length)) if (test.length === 5 && (test[3] === "tags" || test[3] === "tag") ) { pageStack.pop(pageStack.find(function(page) { var check = page.isFirstPage === true; diff --git a/translations/harbour-tooterb-de.ts b/translations/harbour-tooterb-de.ts index a98e776..607e9a4 100644 --- a/translations/harbour-tooterb-de.ts +++ b/translations/harbour-tooterb-de.ts @@ -375,6 +375,10 @@ to help with app translation to your language. um bei den Übersetzungen mitzuhelfen. + + Development + + VisualContainer diff --git a/translations/harbour-tooterb-el.ts b/translations/harbour-tooterb-el.ts index de29ec0..c397e1d 100644 --- a/translations/harbour-tooterb-el.ts +++ b/translations/harbour-tooterb-el.ts @@ -375,6 +375,10 @@ to help with app translation to your language. για να βοηθήσετε την μετάφραση της εφαρμογής στην γλώσσα σας. + + Development + + VisualContainer diff --git a/translations/harbour-tooterb-es.ts b/translations/harbour-tooterb-es.ts index df2b7a8..9d96657 100644 --- a/translations/harbour-tooterb-es.ts +++ b/translations/harbour-tooterb-es.ts @@ -375,6 +375,10 @@ to help with app translation to your language. para ayudar con traducciones. + + Development + + VisualContainer diff --git a/translations/harbour-tooterb-fr.ts b/translations/harbour-tooterb-fr.ts index c4487cf..8e4ad82 100644 --- a/translations/harbour-tooterb-fr.ts +++ b/translations/harbour-tooterb-fr.ts @@ -375,6 +375,10 @@ to help with app translation to your language. pour aider à traduire cette application. + + Development + + VisualContainer diff --git a/translations/harbour-tooterb-it.ts b/translations/harbour-tooterb-it.ts index 1f76a2c..30ac17f 100644 --- a/translations/harbour-tooterb-it.ts +++ b/translations/harbour-tooterb-it.ts @@ -375,6 +375,10 @@ to help with app translation to your language. per aiutare nella traduzione dell'app. + + Development + + VisualContainer diff --git a/translations/harbour-tooterb-nl.ts b/translations/harbour-tooterb-nl.ts index 10ce180..a5b6f76 100644 --- a/translations/harbour-tooterb-nl.ts +++ b/translations/harbour-tooterb-nl.ts @@ -375,6 +375,10 @@ to help with app translation to your language. om deze app te helpen vertalen in jouw taal. + + Development + + VisualContainer diff --git a/translations/harbour-tooterb-nl_BE.ts b/translations/harbour-tooterb-nl_BE.ts index febdf3f..7792bf9 100644 --- a/translations/harbour-tooterb-nl_BE.ts +++ b/translations/harbour-tooterb-nl_BE.ts @@ -375,6 +375,10 @@ to help with app translation to your language. voor te helpen met dezen app in uw taal te vertalen. + + Development + + VisualContainer diff --git a/translations/harbour-tooterb-oc.ts b/translations/harbour-tooterb-oc.ts index 37895d9..ee636dc 100644 --- a/translations/harbour-tooterb-oc.ts +++ b/translations/harbour-tooterb-oc.ts @@ -375,6 +375,10 @@ to help with app translation to your language. per ajudar a traduire l’aplicacion dins vòstra lenga. + + Development + + VisualContainer diff --git a/translations/harbour-tooterb-pl.ts b/translations/harbour-tooterb-pl.ts index 7206219..c1dda8f 100644 --- a/translations/harbour-tooterb-pl.ts +++ b/translations/harbour-tooterb-pl.ts @@ -375,6 +375,10 @@ to help with app translation to your language. + + Development + + VisualContainer diff --git a/translations/harbour-tooterb-ru.ts b/translations/harbour-tooterb-ru.ts index 7733981..c082582 100644 --- a/translations/harbour-tooterb-ru.ts +++ b/translations/harbour-tooterb-ru.ts @@ -375,6 +375,10 @@ to help with app translation to your language. чтобы помочь с переводом приложения на ваш язык. + + Development + + VisualContainer diff --git a/translations/harbour-tooterb-sr.ts b/translations/harbour-tooterb-sr.ts index 143797c..39bd8b0 100644 --- a/translations/harbour-tooterb-sr.ts +++ b/translations/harbour-tooterb-sr.ts @@ -375,6 +375,10 @@ to help with app translation to your language. и помозите у преводу апликације на други језик. + + Development + + VisualContainer diff --git a/translations/harbour-tooterb-sv.ts b/translations/harbour-tooterb-sv.ts index 57672e9..890521c 100644 --- a/translations/harbour-tooterb-sv.ts +++ b/translations/harbour-tooterb-sv.ts @@ -375,6 +375,10 @@ to help with app translation to your language. för att hjälpa till med app-översättning till ditt språk. + + Development + + VisualContainer diff --git a/translations/harbour-tooterb-zh_CN.ts b/translations/harbour-tooterb-zh_CN.ts index 5e9f72b..fa6d895 100644 --- a/translations/harbour-tooterb-zh_CN.ts +++ b/translations/harbour-tooterb-zh_CN.ts @@ -375,6 +375,10 @@ to help with app translation to your language. 以帮助翻译软件为你使用的语言. + + Development + + VisualContainer diff --git a/translations/harbour-tooterb.ts b/translations/harbour-tooterb.ts index 92daad6..42f8869 100644 --- a/translations/harbour-tooterb.ts +++ b/translations/harbour-tooterb.ts @@ -375,6 +375,10 @@ to help with app translation to your language. to help with app translation to your language. + + Development + + VisualContainer