diff --git a/CHANGELOG b/CHANGELOG index 06bfd1f..79cc040 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,15 @@ -libfm-qt-0.13.0 / 2018-05-21 +libfm-qt-0.13.1 / 2018-06-02 ============================ + * Bump patch version to 1 + * It's supposedly fixed in Qt-5.11.1 + * Disconnect old source model + +0.13.0 / 2018-05-21 +=================== + + * Release 0.13.0: Update changelog * Bumped minor version to 13 * Fixed shortcut detection * Delete CachedFolderModel immediately on unreffing it diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f2b822..b1aff79 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ set(LIBFM_QT_LIBRARY_NAME "fm-qt" CACHE STRING "fm-qt") set(LIBFM_QT_VERSION_MAJOR 0) set(LIBFM_QT_VERSION_MINOR 13) -set(LIBFM_QT_VERSION_PATCH 0) +set(LIBFM_QT_VERSION_PATCH 1) set(LIBFM_QT_VERSION ${LIBFM_QT_VERSION_MAJOR}.${LIBFM_QT_VERSION_MINOR}.${LIBFM_QT_VERSION_PATCH}) list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") diff --git a/src/proxyfoldermodel.cpp b/src/proxyfoldermodel.cpp index 21fba56..f66b3a8 100644 --- a/src/proxyfoldermodel.cpp +++ b/src/proxyfoldermodel.cpp @@ -52,17 +52,23 @@ ProxyFolderModel::~ProxyFolderModel() { void ProxyFolderModel::setSourceModel(QAbstractItemModel* model) { if(model == sourceModel()) // avoid setting the same model twice return; + FolderModel* oldSrcModel = static_cast(sourceModel()); +#if (QT_VERSION == QT_VERSION_CHECK(5,11,0)) + // workaround for Qt-5.11 bug https://bugreports.qt.io/browse/QTBUG-68581 + if(oldSrcModel) { + disconnect(oldSrcModel, SIGNAL(destroyed()), this, SLOT(_q_sourceModelDestroyed())); + } +#endif if(model) { // we only support Fm::FolderModel Q_ASSERT(model->inherits("Fm::FolderModel")); if(showThumbnails_ && thumbnailSize_ != 0) { // if we're showing thumbnails - FolderModel* oldSrcModel = static_cast(sourceModel()); - FolderModel* newSrcModel = static_cast(model); if(oldSrcModel) { // we need to release cached thumbnails for the old source model oldSrcModel->releaseThumbnails(thumbnailSize_); disconnect(oldSrcModel, SIGNAL(thumbnailLoaded(QModelIndex, int))); } + FolderModel* newSrcModel = static_cast(model); if(newSrcModel) { // tell the new source model that we want thumbnails of this size newSrcModel->cacheThumbnails(thumbnailSize_); connect(newSrcModel, &FolderModel::thumbnailLoaded, this, &ProxyFolderModel::onThumbnailLoaded);