~rpadovani/webbrowser-app/settings-page

« back to all changes in this revision

Viewing changes to src/app/webbrowser/SettingsPage.qml

  • Committer: Riccardo Padovani
  • Date: 2015-03-25 18:01:23 UTC
  • Revision ID: rpadovani@ubuntu.com-20150325180123-myua4s3q8cjbl0ac
Improve management of historyModel in SettingsPage, expose count property of historyModel

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
Item {
27
27
    id: settings
28
28
 
29
 
    signal historyRemoved()
 
29
    property QtObject historyModel
 
30
 
30
31
    signal restoreDefaults()
31
32
    signal done()
32
33
 
232
233
 
233
234
            ListItem.Standard {
234
235
                text: i18n.tr("Clear Browsing History")
235
 
                onClicked: {
236
 
                    settings.historyRemoved();
237
 
                    opacity = 0.5
238
 
                }
 
236
                onClicked: historyModel.clearAll();
 
237
                opacity: historyModel.count > 0 ? 1 : 0.5
239
238
            }
240
239
        }
241
240
    }