Added some more debug flags to stop spewing the console.

This commit is contained in:
Mark Washeim 2022-12-01 11:00:18 +01:00
parent 8d8abed078
commit c485cedb3d
16 changed files with 76 additions and 18 deletions

View file

@ -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"])

View file

@ -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;

View file

@ -375,6 +375,10 @@
<source>to help with app translation to your language.</source>
<translation>um bei den Übersetzungen mitzuhelfen.</translation>
</message>
<message>
<source>Development</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VisualContainer</name>

View file

@ -375,6 +375,10 @@
<source>to help with app translation to your language.</source>
<translation>για να βοηθήσετε την μετάφραση της εφαρμογής στην γλώσσα σας.</translation>
</message>
<message>
<source>Development</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VisualContainer</name>

View file

@ -375,6 +375,10 @@
<source>to help with app translation to your language.</source>
<translation>para ayudar con traducciones.</translation>
</message>
<message>
<source>Development</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VisualContainer</name>

View file

@ -375,6 +375,10 @@
<source>to help with app translation to your language.</source>
<translation>pour aider à traduire cette application.</translation>
</message>
<message>
<source>Development</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VisualContainer</name>

View file

@ -375,6 +375,10 @@
<source>to help with app translation to your language.</source>
<translation>per aiutare nella traduzione dell&apos;app.</translation>
</message>
<message>
<source>Development</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VisualContainer</name>

View file

@ -375,6 +375,10 @@
<source>to help with app translation to your language.</source>
<translation>om deze app te helpen vertalen in jouw taal.</translation>
</message>
<message>
<source>Development</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VisualContainer</name>

View file

@ -375,6 +375,10 @@
<source>to help with app translation to your language.</source>
<translation>voor te helpen met dezen app in uw taal te vertalen.</translation>
</message>
<message>
<source>Development</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VisualContainer</name>

View file

@ -375,6 +375,10 @@
<source>to help with app translation to your language.</source>
<translation>per ajudar a traduire laplicacion dins vòstra lenga.</translation>
</message>
<message>
<source>Development</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VisualContainer</name>

View file

@ -375,6 +375,10 @@
<source>to help with app translation to your language.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Development</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VisualContainer</name>

View file

@ -375,6 +375,10 @@
<source>to help with app translation to your language.</source>
<translation>чтобы помочь с переводом приложения на ваш язык.</translation>
</message>
<message>
<source>Development</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VisualContainer</name>

View file

@ -375,6 +375,10 @@
<source>to help with app translation to your language.</source>
<translation>и помозите у преводу апликације на други језик.</translation>
</message>
<message>
<source>Development</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VisualContainer</name>

View file

@ -375,6 +375,10 @@
<source>to help with app translation to your language.</source>
<translation>för att hjälpa till med app-översättning till ditt språk.</translation>
</message>
<message>
<source>Development</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VisualContainer</name>

View file

@ -375,6 +375,10 @@
<source>to help with app translation to your language.</source>
<translation>使.</translation>
</message>
<message>
<source>Development</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VisualContainer</name>

View file

@ -375,6 +375,10 @@
<source>to help with app translation to your language.</source>
<translation>to help with app translation to your language.</translation>
</message>
<message>
<source>Development</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VisualContainer</name>