davidedmundson added inline comments.

INLINE COMMENTS

> foldermodel.cpp:170
>      connect(this, &QAbstractItemModel::rowsInserted,
>              this, [this](const QModelIndex &parent, int first, int last) {
>          for (int i = first; i <= last; ++i) {

I'm a bit worried about queuing something with indexes. Indexes are only valid 
at that exact moment.

If the source model does the following:
beginInsertRows(AA);
endInsertRows()
beginInsertRows(BB);
endInsertRows()
then exits back to the event loop

When you process the delayed connection for the first insertion the old 
first/last could be pointing anywhere.

We could maybe get round this by converting to QPeristentModelIndexes 
immediately, then queue up the operation that uses them.

REPOSITORY
  R119 Plasma Desktop

REVISION DETAIL
  https://phabricator.kde.org/D18182

To: hein, #plasma, McPain
Cc: davidedmundson, fvogt, plasma-devel, jraleigh, GB_2, ragreen, Pitel, 
ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart

Reply via email to