diff --git a/src/base/bittorrent/dbresumedatastorage.cpp b/src/base/bittorrent/dbresumedatastorage.cpp index ba4857411..5ac322021 100644 --- a/src/base/bittorrent/dbresumedatastorage.cpp +++ b/src/base/bittorrent/dbresumedatastorage.cpp @@ -389,7 +389,7 @@ void BitTorrent::DBResumeDataStorage::createDB() const catch (const RuntimeError &err) { db.rollback(); - throw err; + throw; } } @@ -566,7 +566,7 @@ void BitTorrent::DBResumeDataStorage::Worker::storeQueue(const QVectorpalette().color(QPalette::Active, QPalette::Highlight)}; highlightColor.setAlphaF(0.35); - QRect targetHighlightRect {m_highlitedRegion.adjusted(borderWidth, borderWidth, borderWidth, height() - 2 * borderWidth)}; + QRect targetHighlightRect {m_highlightedRegion.adjusted(borderWidth, borderWidth, borderWidth, height() - 2 * borderWidth)}; painter.fillRect(targetHighlightRect, highlightColor); } @@ -318,15 +316,15 @@ void PiecesBar::highlightFile(int imagePos) ImageRange imageRange = transform.imagePos(filePieces); QRect newHighlitedRegion {imageRange.first(), 0, imageRange.size(), m_image.height()}; - if (newHighlitedRegion != m_highlitedRegion) + if (newHighlitedRegion != m_highlightedRegion) { - m_highlitedRegion = newHighlitedRegion; + m_highlightedRegion = newHighlitedRegion; update(); } } - else if (!m_highlitedRegion.isEmpty()) + else if (!m_highlightedRegion.isEmpty()) { - m_highlitedRegion = QRect(); + m_highlightedRegion = {}; update(); } } diff --git a/src/gui/properties/piecesbar.h b/src/gui/properties/piecesbar.h index ec70aab6c..c505253e3 100644 --- a/src/gui/properties/piecesbar.h +++ b/src/gui/properties/piecesbar.h @@ -91,10 +91,10 @@ private: virtual bool updateImage(QImage &image) = 0; void updatePieceColors(); - const BitTorrent::Torrent *m_torrent; + const BitTorrent::Torrent *m_torrent = nullptr; QImage m_image; // buffered 256 levels gradient from bg_color to piece_color QVector m_pieceColors; - bool m_hovered; - QRect m_highlitedRegion; //!< part of the bar can be highlighted; this rectangle is in the same frame as m_image + bool m_hovered = false; + QRect m_highlightedRegion; // part of the bar can be highlighted; this rectangle is in the same frame as m_image };