~osomon/webbrowser-app/fix-deleting-multiple-domains

« back to all changes in this revision

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

  • Committer: CI Train Bot
  • Date: 2015-12-10 15:31:37 UTC
  • mfrom: (1292.1.7 webbrowser-app)
  • Revision ID: ci-train-bot@canonical.com-20151210153137-xi93xu5wgxcuyyae
Resync trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
    Keys.onPressed: {
46
46
        if (event.modifiers === Qt.ControlModifier && event.key === Qt.Key_F) {
47
47
            if (searchMode) searchQuery.focus = true
48
 
            else {
49
 
                if (!selectMode) searchMode = true
50
 
                else event.accepted = true
51
 
            }
 
48
            else if (!selectMode) searchMode = true
 
49
            event.accepted = true
52
50
        }
53
51
    }
54
52
    Keys.onDeletePressed: {
123
121
                currentIndex: 0
124
122
                onCurrentIndexChanged: {
125
123
                    if (currentItem) {
126
 
                        historyLastVisitDateModel.setLastVisitDate(currentItem.lastVisitDate)
 
124
                        historyLastVisitDateModel.lastVisitDate = currentItem.lastVisitDate
127
125
                    }
128
126
                    urlsListView.ViewItems.selectedIndices = []
129
127
                }
163
161
                }
164
162
 
165
163
                model: HistoryLastVisitDateListModel {
166
 
                    sourceModel: historyLastVisitDateModel.sourceModel
 
164
                    sourceModel: historyLastVisitDateModel.model
167
165
                }
168
166
 
169
167
                delegate: ListItem {
244
242
                Keys.onReturnPressed: historyEntrySelected()
245
243
                Keys.onEnterPressed: historyEntrySelected()
246
244
 
247
 
                model: HistoryLastVisitDateModel {
 
245
                model: SortFilterModel {
248
246
                    id: historyLastVisitDateModel
 
247
                    property date lastVisitDate
 
248
                    filter {
 
249
                        property: "lastVisitDateString"
 
250
                        pattern: new RegExp(lastVisitDate.isValid() ? "^%1$".arg(Qt.formatDate(lastVisitDate, "yyyy-MM-dd")) : "")
 
251
                    }
249
252
                    // Until a valid HistoryModel is assigned the TextSearchFilterModel
250
 
                    // will not report role names, and the HistoryLastVisit*Models will emit warnings
251
 
                    // since they need a dateLastVisit role to be present.
252
 
                    // We avoid this by delaying assigning the source model until it is ready.
253
 
                    sourceModel: historySearchModel.sourceModel ? historySearchModel : undefined
 
253
                    // will not report role names, and the HistoryLastVisitDateListModel
 
254
                    // will emit warnings since it needs a dateLastVisit role to be
 
255
                    // present.
 
256
                    model: historySearchModel.sourceModel ? historySearchModel : null
254
257
                }
255
258
 
256
259
                clip: true