~danielholm/account-plugin-owncloud/account-plugin-owncloud

« back to all changes in this revision

Viewing changes to qml/owncloud/NewAccount.qml

  • Committer: DanielHolm
  • Date: 2014-11-09 02:24:46 UTC
  • Revision ID: d.holmen@gmail.com-20141109022446-mkn8ua8dyif0d5ja
Instead adding the http:// to the url automatically.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    TextField {
24
24
        id: urlField
25
25
        objectName: "urlField"
26
 
        placeholderText: i18n.tr("ownCloud installation URL")
 
26
        placeholderText: i18n.tr("http://example.org")
27
27
        width: root.width - (2 * root.anchors.margins)
28
28
        anchors.left: parent.left
29
29
        anchors.margins: parent.anchors.margins
97
97
                account.updateDisplayName(usernameField.text)
98
98
 
99
99
                // check the url
100
 
                if (checkURL(urlField.text)) {
101
 
                    creds.userName = usernameField.text
102
 
                    creds.secret = passwordField.text
103
 
                    creds.sync()
104
 
                }
105
 
                else {
106
 
                    // issue an error message
107
 
                    urlField.focus = true;
108
 
                }
 
100
                checkURL(urlField.text)
 
101
                creds.userName = usernameField.text
 
102
                creds.secret = passwordField.text
 
103
                creds.sync()
109
104
 
110
105
                // credentialsStored() //shouldn't this be here?
111
106
            }
138
133
    function checkURL(url) {
139
134
        // if the URL doesn't contain HTTP(S) then add it!
140
135
        if (url.indexOf('http') >= 0) {
141
 
            creds.urlOC = urlField.text
142
 
            return true;
 
136
            creds.urlOC = 'http://'+urlField.text
143
137
        }
144
138
        else {
145
 
            return false;
 
139
             creds.urlOC = urlField.text
146
140
        }
147
141
    }
148
142