diff --git a/CMakeLists.txt b/CMakeLists.txt index ba05567..0f0f803 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ set(META_APP_DESCRIPTION "Tray application for Syncthing") set(META_APP_CATEGORIES "System;Utility;Network;FileTransfer") set(META_VERSION_MAJOR 0) set(META_VERSION_MINOR 6) -set(META_VERSION_PATCH 2) +set(META_VERSION_PATCH 3) set(META_VERSION_EXACT_SONAME ON) project(${META_PROJECT_NAME}) diff --git a/connector/syncthingconnection.cpp b/connector/syncthingconnection.cpp index b113e95..3540b8b 100644 --- a/connector/syncthingconnection.cpp +++ b/connector/syncthingconnection.cpp @@ -350,12 +350,17 @@ void SyncthingConnection::rescan(const QString &dirId, const QString &relpath) /*! * \brief Requests rescanning all directories. * + * Note that rescan is only requested for unpaused directories because requesting rescan for + * paused directories only leads to an error. + * * The signal error() is emitted when the request was not successful. */ void SyncthingConnection::rescanAllDirs() { for (const SyncthingDir &dir : m_dirs) { - rescan(dir.id); + if (!dir.paused) { + rescan(dir.id); + } } } diff --git a/tray/gui/dirbuttonsitemdelegate.cpp b/tray/gui/dirbuttonsitemdelegate.cpp index dcaa279..3f18f74 100644 --- a/tray/gui/dirbuttonsitemdelegate.cpp +++ b/tray/gui/dirbuttonsitemdelegate.cpp @@ -59,9 +59,11 @@ void DirButtonsItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem // draw buttons const int buttonY = option.rect.y() + centerObj(option.rect.height(), 16); - painter->drawPixmap(option.rect.right() - 52, buttonY, 16, 16, m_refreshIcon); - painter->drawPixmap( - option.rect.right() - 34, buttonY, 16, 16, index.data(SyncthingDirectoryModel::DirectoryPaused).toBool() ? m_resumeIcon : m_pauseIcon); + const bool dirPaused = index.data(SyncthingDirectoryModel::DirectoryPaused).toBool(); + if (!dirPaused) { + painter->drawPixmap(option.rect.right() - 52, buttonY, 16, 16, m_refreshIcon); + } + painter->drawPixmap(option.rect.right() - 34, buttonY, 16, 16, dirPaused ? m_resumeIcon : m_pauseIcon); painter->drawPixmap(option.rect.right() - 16, buttonY, 16, 16, m_folderIcon); } } diff --git a/tray/gui/dirview.cpp b/tray/gui/dirview.cpp index 5fd47b2..38618f5 100644 --- a/tray/gui/dirview.cpp +++ b/tray/gui/dirview.cpp @@ -41,7 +41,9 @@ void DirView::mouseReleaseEvent(QMouseEvent *event) const QRect itemRect(visualRect(clickedIndex)); if (pos.x() > itemRect.right() - 58) { if (pos.x() < itemRect.right() - 34) { - emit scanDir(*dir); + if (!dir->paused) { + emit scanDir(*dir); + } } else if (pos.x() < itemRect.right() - 17) { emit pauseResumeDir(*dir); } else {