~mterry/unity8/oobe-revert-geonames

« back to all changes in this revision

Viewing changes to plugins/IntegratedLightDM/liblightdm/UsersModel.cpp

  • Committer: Michael Terry
  • Date: 2016-03-11 17:51:18 UTC
  • mfrom: (1821.227.75 unity8)
  • Revision ID: michael.terry@canonical.com-20160311175118-6za2cj41c21d88ha
Merge silo 64 (soon to be trunk)

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
    roles[ImagePathRole] = "imagePath";
55
55
    setRoleNames(roles);
56
56
 
57
 
    // Now modify our mock user backgrounds
58
 
    QDir bgdir = QDir(QStringLiteral("/usr/share/demo-assets/shell/backgrounds/"));
59
 
    QStringList backgrounds = bgdir.entryList(QDir::Files | QDir::NoDotAndDotDot);
60
 
 
61
 
    for (int i = 0, j = 0; i < d->entries.size(); i++) {
62
 
        Entry &entry = d->entries[i];
63
 
        if (entry.background.isNull() && !backgrounds.isEmpty()) {
64
 
            entry.background = bgdir.filePath(backgrounds[j++]);
65
 
            if (j >= backgrounds.length()) {
66
 
                j = 0;
67
 
            }
68
 
        }
69
 
    }
70
 
}
71
 
 
72
 
UsersModel::~UsersModel()
73
 
{
74
 
    delete d_ptr;
 
57
    connect(d_ptr, &UsersModelPrivate::dataChanged, this, [this](int i) {
 
58
        QModelIndex index = createIndex(i, 0);
 
59
        Q_EMIT dataChanged(index, index);
 
60
    });
75
61
}
76
62
 
77
63
int UsersModel::rowCount(const QModelIndex &parent) const