~dandrader/qtmir/removeHotspot

« back to all changes in this revision

Viewing changes to src/modules/Unity/Application/mirsurfacelistmodel.cpp

  • Committer: CI Train Bot
  • Author(s): Daniel d'Andrada, Michał Sawicz
  • Date: 2016-05-18 11:18:29 UTC
  • mfrom: (486.1.5 origin/detachPromptSurfaces)
  • Revision ID: ci-train-bot@canonical.com-20160518111829-j8ma5fzus8z2l72h
Move prompt surfaces from MirSurface to Application and emit firstChanged signal

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
    Q_EMIT countChanged();
69
69
    if (count() == 1) {
70
70
        Q_EMIT emptyChanged();
 
71
        Q_EMIT firstChanged();
71
72
    }
72
73
}
73
74
 
88
89
        if (count() == 0) {
89
90
            Q_EMIT emptyChanged();
90
91
        }
 
92
        if (i == 0) {
 
93
            Q_EMIT firstChanged();
 
94
        }
91
95
    }
92
96
}
93
97
 
105
109
        m_surfaceList.move(from, to);
106
110
        endMoveRows();
107
111
    }
 
112
 
 
113
    if ((from == 0 || to == 0) && m_surfaceList.count() > 1) {
 
114
        Q_EMIT firstChanged();
 
115
    }
108
116
}
109
117
 
110
118
unityapp::MirSurfaceInterface *MirSurfaceListModel::get(int index)
143
151
    if (wasEmpty) {
144
152
        Q_EMIT emptyChanged();
145
153
    }
 
154
    Q_EMIT firstChanged();
146
155
}
147
156
 
148
157
void MirSurfaceListModel::addSurfaceList(MirSurfaceListModel *surfaceListModel)
233
242
        connect(m_sourceList, &QObject::destroyed, this, [this]() { this->setSourceList(nullptr); });
234
243
        connect(m_sourceList, &unityapp::MirSurfaceListInterface::countChanged,
235
244
                this, &unityapp::MirSurfaceListInterface::countChanged);
 
245
        connect(m_sourceList, &unityapp::MirSurfaceListInterface::firstChanged,
 
246
                this, &unityapp::MirSurfaceListInterface::firstChanged);
236
247
    }
237
248
 
238
249
    endResetModel();