[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-usability
Subject: Re: [PATCH] disable previews when icons are small
From: David Hugh-Jones <hughjonesd () yahoo ! co ! uk>
Date: 2003-06-22 12:07:25
[Download RAW message or body]
--- David Faure <faure@kde.org> wrote:
> Hmm, although....... when you go to a directory
> containing 16x16 PNGs,
> what's wrong with being able to see them as 16x16
> icons in a "small icons"
> view? I agree that it's kind of a special case
> though.
>
Well, the problem is that for most cases you actually
get less information. The icon informs you about the
file type, but a preview that small won't actually
tell you anything. This is slightly less true for
images, but it's completely true for text files.
(Sound files still get previewed, of course.)
> You don't really need a "debugging version" (as in
> --enable-debug)
> for this stuff. kdDebug debugging is enabled even
> without --enable-debug,
> and if you need to use gdb on a given app, use
> "adddebug" in the right
> directory only.
ah ok - but my kdebase apps don't seem to emit
debugging information? Do I need to set an environment
variable or something?
>
> Now about your patch:
> Comparing size with SizeSmall looks wrong to me -
> size could be 0,
> which means "the default size for Desktop icons",
> otherwise it's a size
> in pixels. See gridXValue() for instance.
> I just saw the code at line 857, and it does look
> wrong too.
> That method should calculate the real size like
> gridXValue does,
> and then compare to SizeSmall.
Both fixed. Patch attached.
Dave
________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://uk.messenger.yahoo.com/
["libkonq.diff" (text/x-diff)]
Index: kfileivi.cc
===================================================================
RCS file: /home/kde/kdebase/libkonq/kfileivi.cc,v
retrieving revision 1.78
diff -b -u -r1.78 kfileivi.cc
Index: konq_iconviewwidget.cc
===================================================================
RCS file: /home/kde/kdebase/libkonq/konq_iconviewwidget.cc,v
retrieving revision 1.241
diff -b -u -r1.241 konq_iconviewwidget.cc
--- konq_iconviewwidget.cc 2 Jun 2003 20:22:28 -0000 1.241
+++ konq_iconviewwidget.cc 22 Jun 2003 12:03:40 -0000
@@ -768,6 +768,7 @@
KIconView::takeItem( item );
}
+// does this ever get called??
void KonqIconViewWidget::setThumbnailPixmap( KFileIVI * item, const QPixmap & pixmap )
{
if ( item )
@@ -850,9 +851,11 @@
int oldGridX = gridX();
m_size = size;
+ int realSize = size? size : KGlobal::iconLoader()->currentSize( KIcon::Desktop );
+
if ( sizeChanged )
{
- setSpacing( (size > KIcon::SizeSmall) ? 5 : 0 );
+ setSpacing( (realSize > KIcon::SizeSmall) ? 5 : 0 );
}
if ( sizeChanged || !stopImagePreviewFor.isEmpty() )
@@ -860,6 +863,11 @@
calculateGridX();
}
bool stopAll = !stopImagePreviewFor.isEmpty() && stopImagePreviewFor.first() == "*";
+ if (realSize <= KIcon::SizeSmall) {
+ kdDebug(1203) << "size small in KIVW::setIcons:" <<
+ " setting stopAll to true" << endl;
+ stopAll = true;
+ }
// Do this even if size didn't change, since this is used by refreshMimeTypes...
for ( QIconViewItem *it = firstItem(); it; it = it->nextItem() ) {
KFileIVI * ivi = static_cast<KFileIVI *>( it );
@@ -868,11 +876,10 @@
if ( !ivi->isThumbnail() ||
stopAll ||
mimeTypeMatch( ivi->item()->mimetype(), stopImagePreviewFor ) )
- {
ivi->setIcon( size, ivi->state(), true, false );
- }
else
ivi->invalidateThumb( ivi->state(), false );
+
}
if ( autoArrange() && (oldGridX != gridX() || !stopImagePreviewFor.isEmpty()) )
@@ -988,6 +995,12 @@
int iconSize = m_size ? m_size : KGlobal::iconLoader()->currentSize( KIcon::Desktop );
int size;
+
+ if (iconSize <= KIcon::SizeSmall) {
+ kdDebug(1203) << "Not starting preview job, icons are small" << endl;
+ emit imagePreviewFinished();
+ return;
+ }
if ( group.readBoolEntry("BoostSize", false) ) {
if (iconSize < 28)
_______________________________________________
kde-usability mailing list
kde-usability@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-usability
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic