~uriboni/webbrowser-app/tab-context-menu

« back to all changes in this revision

Viewing changes to src/app/webbrowser/bookmarks-folder-model.cpp

  • Committer: CI Train Bot
  • Author(s): Arthur Mello, Ugo Riboni, Olivier Tilloy
  • Date: 2015-08-12 19:53:13 UTC
  • mfrom: (1126.1.5 wide-views-newtab-history)
  • Revision ID: ci-train-bot@canonical.com-20150812195313-u5v7kzrj8hfiacsj
Wide screen versions of the history view and new tab view, per design specification.
This adds a build dependency on qml-module-qt-labs-settings (for unit tests). Fixes: #1351157, #1481647

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
    with the same name that the filter folder name (case-sensitive
35
35
    comparison).
36
36
 
37
 
    When no folder name is set (null or empty string), all entries that 
 
37
    When no folder name is set (null or empty string), all entries that
38
38
    are not stored in any folder match.
39
39
*/
40
40
BookmarksFolderModel::BookmarksFolderModel(QObject* parent)
76
76
    return rowCount();
77
77
}
78
78
 
 
79
QVariantMap BookmarksFolderModel::get(int row) const
 
80
{
 
81
    if (row < 0 || row >= rowCount()) {
 
82
        return QVariantMap();
 
83
    }
 
84
 
 
85
    QVariantMap res;
 
86
    QHash<int,QByteArray> names = roleNames();
 
87
    QHashIterator<int, QByteArray> i(names);
 
88
 
 
89
    while (i.hasNext()) {
 
90
        i.next();
 
91
        QModelIndex idx = index(row, 0);
 
92
        QVariant data = idx.data(i.key());
 
93
        res[i.value()] = data;
 
94
    }
 
95
 
 
96
    return res;
 
97
}
 
98
 
79
99
bool BookmarksFolderModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const
80
100
{
81
101
    QModelIndex index = sourceModel()->index(source_row, 0, source_parent);