~belohoub/owncloud-sync/UBsync

« back to all changes in this revision

Viewing changes to UBsync-ui/ui/TargetsPage.qml

  • Committer: Jan Belohoubek
  • Date: 2021-11-16 19:09:11 UTC
  • Revision ID: belohoub@fel.zcu.cz-20211116190911-79742lh0bx9r0kl0
minor fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
        targetsPage.db = LocalStorage.openDatabaseSync("UBsync", "1.0", "UBsync", 1000000);
21
21
 
22
 
        console.log("Loading targetsPage data")
 
22
        console.log("TargetsPage :: Loading targetsPage data")
23
23
 
24
24
        targetsPage.db.transaction(
25
25
                    function(tx) {
27
27
                        var rs = tx.executeSql('SELECT * FROM SyncTargets');
28
28
 
29
29
                        for(var i = 0; i < rs.rows.length; i++) {
30
 
                            console.log("Loading targetsPage: " + rs.rows.item(i).targetName + "; Active: " + rs.rows.item(i).active)
 
30
                            console.log("TargetsPage :: Loading targetsPage: " + rs.rows.item(i).targetName + "; Active: " + rs.rows.item(i).active)
31
31
 
32
32
                            var color = "orange" // expect, that the account is disabled in online accounts
33
33
                            var j = 0
34
34
                            for (j = 0; j < accounts.count; j++) {
35
 
                                //console.log("  - accountID: " + accounts.get(j, "account").accountId)
 
35
                                //console.log("TargetsPage ::   - accountID: " + accounts.get(j, "account").accountId)
36
36
                                if (accounts.get(j, "account").accountId === rs.rows.item(i).accountID) {
37
37
                                    // account is enabled!
38
38
                                    if (rs.rows.item(i).active === 1) {
61
61
 
62
62
        targetsPage.db = LocalStorage.openDatabaseSync("UBsync", "1.0", "UBsync", 1000000);
63
63
 
64
 
        console.log("Removing target " + targetID)
 
64
        console.log("TargetsPage :: Removing target " + targetID)
65
65
 
66
66
        targetsPage.db.transaction(
67
67
                    function(tx) {
84
84
 
85
85
            onActiveChanged: {
86
86
                /* re-render anytime page is shown */
87
 
                console.log("targetsPage activated")
 
87
                console.log("TargetsPage :: targetsPage activated")
88
88
                targetsPage.loadDB()
89
89
            }
90
90
        }
91
91
 
92
92
    ListModel {
93
93
        id: targetListModel
 
94
 
 
95
        ListElement {
 
96
            targetID: 0
 
97
            targetName: "Unknown"
 
98
            targeActive: false
 
99
            color: "silver"
 
100
        }
 
101
 
94
102
        Component.onCompleted: {
95
 
            console.log("targetsPage created")
 
103
            console.log("TargetsPage :: targetsPage created")
96
104
 
97
105
            targetsPage.loadDB()
98
106
        }