diff options
author | Alexander Golubev <[email protected]> | 2024-02-17 22:29:31 +0300 |
---|---|---|
committer | Alexander Golubev <[email protected]> | 2024-02-17 22:36:27 +0300 |
commit | d4548234b93404404e8807ac6fe5c671faad68f2 (patch) | |
tree | 1602ceaabc07e31cc988c5e39e962e14c8aae055 /src | |
parent | 8c522cac3456c10c5937c98bb6866323639aff51 (diff) | |
download | gwenview-d4548234b93404404e8807ac6fe5c671faad68f2.tar.gz gwenview-d4548234b93404404e8807ac6fe5c671faad68f2.zip |
Various small improvements
- fix some warnings about struct/class deslaration/definition mismatch
- fix incorrect assert in jpegcontent.cpp
- add a note
- null a pointer after deleting a job
Signed-off-by: Alexander Golubev <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gvcore/filethumbnailview.cpp | 1 | ||||
-rw-r--r-- | src/gvcore/filethumbnailview.h | 2 | ||||
-rw-r--r-- | src/gvcore/filethumbnailviewitem.cpp | 5 | ||||
-rw-r--r-- | src/gvcore/fileviewcontroller.cpp | 3 | ||||
-rw-r--r-- | src/imageutils/jpegcontent.cpp | 2 |
5 files changed, 8 insertions, 5 deletions
diff --git a/src/gvcore/filethumbnailview.cpp b/src/gvcore/filethumbnailview.cpp index b0c47b2..e12f652 100644 --- a/src/gvcore/filethumbnailview.cpp +++ b/src/gvcore/filethumbnailview.cpp @@ -388,6 +388,7 @@ void FileThumbnailView::doStartThumbnailUpdate(const KFileItemList* list) { void FileThumbnailView::stopThumbnailUpdate() { if (!d->mThumbnailLoadJob.isNull()) { d->mThumbnailLoadJob->kill(false); + d->mThumbnailLoadJob=NULL; } } diff --git a/src/gvcore/filethumbnailview.h b/src/gvcore/filethumbnailview.h index 4809501..37788fd 100644 --- a/src/gvcore/filethumbnailview.h +++ b/src/gvcore/filethumbnailview.h @@ -105,7 +105,7 @@ protected: virtual void keyPressEvent( TQKeyEvent* ); private: - class Private; + struct Private; Private* d; void updateGrid(); diff --git a/src/gvcore/filethumbnailviewitem.cpp b/src/gvcore/filethumbnailviewitem.cpp index dae4172..d017140 100644 --- a/src/gvcore/filethumbnailviewitem.cpp +++ b/src/gvcore/filethumbnailviewitem.cpp @@ -283,8 +283,11 @@ void FileThumbnailViewItem::calcRect(const TQString&) { itemTextRect.moveLeft(PADDING); itemTextRect.moveTop(thumbnailSize + PADDING * 2); } - + // Update rects + // NOTE: this results in 3 calls to TQIconViewContainer(), which is costly if + // there are a lot (tens of thousands) of items, unfortunately there + // is no way to workaround this in current (14.1.1, 2024) TQt API if ( itemPixmapRect != pixmapRect() ) { setPixmapRect( itemPixmapRect ); } diff --git a/src/gvcore/fileviewcontroller.cpp b/src/gvcore/fileviewcontroller.cpp index ffcb971..40ec6ea 100644 --- a/src/gvcore/fileviewcontroller.cpp +++ b/src/gvcore/fileviewcontroller.cpp @@ -172,8 +172,7 @@ private: // FileViewController::Private // //----------------------------------------------------------------------- -class FileViewController::Private { -public: +struct FileViewController::Private { ~Private() { delete mSliderTracker; } diff --git a/src/imageutils/jpegcontent.cpp b/src/imageutils/jpegcontent.cpp index b4ad947..0effc16 100644 --- a/src/imageutils/jpegcontent.cpp +++ b/src/imageutils/jpegcontent.cpp @@ -88,7 +88,7 @@ int inmem_fill_input_buffer(j_decompress_ptr cinfo) { void inmem_skip_input_data(j_decompress_ptr cinfo, long num_bytes) { if (num_bytes<=0) return; - Q_ASSERT(num_bytes>=long(cinfo->src->bytes_in_buffer)); + Q_ASSERT(num_bytes<=long(cinfo->src->bytes_in_buffer)); cinfo->src->next_input_byte+=num_bytes; cinfo->src->bytes_in_buffer-=num_bytes; } |