MCPcopy Create free account
hub / github.com/OpenBoard-org/OpenBoard / deleteThumbnail

Method deleteThumbnail

src/gui/UBThumbnailScene.cpp:272–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270}
271
272void UBThumbnailScene::deleteThumbnail(int pageIndex, bool rearrange)
273{
274 if (pageIndex < mThumbnailItems.size())
275 {
276 auto thumbnail = mThumbnailItems.at(pageIndex);
277
278 if (thumbnail)
279 {
280 if (thumbnail == mLastSelectedThumbnail)
281 {
282 mLastSelectedThumbnail = nullptr;
283 }
284
285 removeItem(thumbnail);
286 delete thumbnail;
287 }
288
289 mThumbnailItems.removeAt(pageIndex);
290
291 if (rearrange)
292 {
293 renumberThumbnails(pageIndex);
294 arrangeThumbnails(pageIndex);
295 }
296 }
297
298 if (mLoader)
299 {
300 // restart loading remaining thumbnails
301 createThumbnails(pageIndex);
302 }
303
304 if (mThumbnailItems.size() == 1)
305 {
306 thumbnailAt(0)->setDeletable(false);
307 }
308}
309
310void UBThumbnailScene::moveThumbnail(int fromIndex, int toIndex)
311{

Callers 1

deletePagesMethod · 0.80

Calls 2

setDeletableMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected