1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-02-13 19:42:36 +02:00

Reverted to regular slot connections now that cache is readonly. Fixed issue with folder deletion

This commit is contained in:
Laurent Cozic 2017-01-21 11:53:28 +00:00
parent 2298c8fb5c
commit c8ce21f020
2 changed files with 6 additions and 5 deletions

View File

@ -34,7 +34,8 @@ Item {
function handleItemListAction(list, action) {
if (action === "delete") {
list.model.deleteData(list.index)
if (list.currentIndex === undefined) return;
list.model.deleteData(list.currentIndex)
}
}

View File

@ -14,10 +14,10 @@ FolderModel::FolderModel() : AbstractListModel(), orderBy_("title") {
// 5. the model is now an invalid pointer and the rest of the code in save() crashes
// This is solved using QueuedConnection, as it means the cache will be cleared only once model is no longer in use.
connect(&dispatcher(), SIGNAL(folderCreated(QString)), this, SLOT(dispatcher_folderCreated(QString)), Qt::QueuedConnection);
connect(&dispatcher(), SIGNAL(folderUpdated(QString)), this, SLOT(dispatcher_folderUpdated(QString)), Qt::QueuedConnection);
connect(&dispatcher(), SIGNAL(folderDeleted(QString)), this, SLOT(dispatcher_folderDeleted(QString)), Qt::QueuedConnection);
connect(&dispatcher(), SIGNAL(allFoldersDeleted()), this, SLOT(dispatcher_allFoldersDeleted()), Qt::QueuedConnection);
connect(&dispatcher(), SIGNAL(folderCreated(QString)), this, SLOT(dispatcher_folderCreated(QString)));
connect(&dispatcher(), SIGNAL(folderUpdated(QString)), this, SLOT(dispatcher_folderUpdated(QString)));
connect(&dispatcher(), SIGNAL(folderDeleted(QString)), this, SLOT(dispatcher_folderDeleted(QString)));
connect(&dispatcher(), SIGNAL(allFoldersDeleted()), this, SLOT(dispatcher_allFoldersDeleted()));
}
const BaseModel *FolderModel::atIndex(int index) const {