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 <fatzer2@gmail.com>
(cherry picked from commit d4548234b9)
pull/34/head
Alexander Golubev 9 months ago committed by Michele Calgaro
parent 801c90b6c2
commit ad01a7f1f9
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -388,6 +388,7 @@ void FileThumbnailView::doStartThumbnailUpdate(const KFileItemList* list) {
void FileThumbnailView::stopThumbnailUpdate() { void FileThumbnailView::stopThumbnailUpdate() {
if (!d->mThumbnailLoadJob.isNull()) { if (!d->mThumbnailLoadJob.isNull()) {
d->mThumbnailLoadJob->kill(false); d->mThumbnailLoadJob->kill(false);
d->mThumbnailLoadJob=NULL;
} }
} }

@ -105,7 +105,7 @@ protected:
virtual void keyPressEvent( TQKeyEvent* ); virtual void keyPressEvent( TQKeyEvent* );
private: private:
class Private; struct Private;
Private* d; Private* d;
void updateGrid(); void updateGrid();

@ -283,8 +283,11 @@ void FileThumbnailViewItem::calcRect(const TQString&) {
itemTextRect.moveLeft(PADDING); itemTextRect.moveLeft(PADDING);
itemTextRect.moveTop(thumbnailSize + PADDING * 2); itemTextRect.moveTop(thumbnailSize + PADDING * 2);
} }
// Update rects // 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() ) { if ( itemPixmapRect != pixmapRect() ) {
setPixmapRect( itemPixmapRect ); setPixmapRect( itemPixmapRect );
} }

@ -172,8 +172,7 @@ private:
// FileViewController::Private // FileViewController::Private
// //
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
class FileViewController::Private { struct FileViewController::Private {
public:
~Private() { ~Private() {
delete mSliderTracker; delete mSliderTracker;
} }

@ -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) { void inmem_skip_input_data(j_decompress_ptr cinfo, long num_bytes) {
if (num_bytes<=0) return; 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->next_input_byte+=num_bytes;
cinfo->src->bytes_in_buffer-=num_bytes; cinfo->src->bytes_in_buffer-=num_bytes;
} }

Loading…
Cancel
Save