[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: thumbnails: images vs picture
From: Malte Starostik <malte () kde ! org>
Date: 2002-10-19 17:49:44
[Download RAW message or body]
On Saturday 19 October 2002 10:49, Aaron J. Seigo wrote:
> On Friday 18 October 2002 07:36, Malte Starostik wrote:
> > handle the rest. This is theoretical, I didn't try if it works (multiple
> > .desktop files with the same "Name" key), I'll give it a try.
>
> hmm... i just assumed (the fatal mistake) that that would fail. at best
> show two "Image" entries.
>
> what you propose would be the optimal solution though as it would keep the
> code clean while not bothering the user with unecessary and inscrutable
> detail. even if it doesn't work that way right now, perhaps we could make
> it do so...
>
> let me know how it goes ...
Try this one - took me a while to debug until I found out the SVG thumbnail I
still got was from KSVG's creator not the QPicture one ;-)
picturethumbnail.desktop Name[*] fields copied from imagethumbnail.desktop to
make them the same in all translations.
-Malte
["kdebase-kioslave.diff" (text/x-diff)]
Index: picturethumbnail.desktop
===================================================================
RCS file: /home/kde/kdebase/kioslave/thumbnail/picturethumbnail.desktop,v
retrieving revision 1.35
diff -u -3 -d -p -r1.35 picturethumbnail.desktop
--- picturethumbnail.desktop 2002/09/30 10:25:27 1.35
+++ picturethumbnail.desktop 2002/10/19 17:46:02
@@ -1,36 +1,58 @@
[Desktop Entry]
+Encoding=UTF-8
Type=Service
-Name=Pictures
-Name[af]=Prentjies
+Name=Images
+Name[af]=Beelde
+Name[ar]=الصور
+Name[az]=Rəsmlər
Name[be]=Малюнкі
+Name[bg]=Картини
Name[bs]=Slike
-Name[ca]=Fotografies
+Name[ca]=Imatges
Name[cs]=Obrázky
Name[da]=Billeder
Name[de]=Bilder
Name[el]=Εικόνες
-Name[eo]=Bildoj (pic)
-Name[es]=Imagenes
-Name[fa]=عکسها
+Name[eo]=Bildoj (im)
+Name[es]=Imágenes
+Name[et]=Pildid
+Name[eu]=Irudiak
+Name[fa]=تصاویر
Name[fi]=Kuvat
-Name[fr]=Images
Name[he]=תמו ות
Name[hr]=Slike
Name[hu]=Képek
-Name[ja]=画像
+Name[id]=Gambar
+Name[is]=Myndir
+Name[it]=Immagini
+Name[ja]=イメージ
+Name[ko]=그림
+Name[lt]=Paveiksliukai
+Name[lv]=Attēli
Name[mt]=Stampi
Name[nb]=Bilder
-Name[nl]=Illustraties
+Name[nl]=Afbeeldingen
Name[nn]=Bilete
-Name[nso]=Diswantsho
+Name[nso]=Diponagalo
+Name[pl]=Obrazki
Name[pt]=Imagens
-Name[pt_BR]=Figuras
+Name[pt_BR]=Imagens
Name[ro]=Imagini
+Name[ru]=Изображения
Name[sk]=Obrázky
+Name[sl]=Slike
+Name[sr]=Slike
Name[sv]=Bilder
+Name[ta]= Õì û
+Name[th]=แฟ้ม าพ
Name[tr]=Resimler
+Name[uk]=Зображення
+Name[ven]=Zwifanyiso
+Name[vi]=A?nh
Name[xh]=Imifanekiso
-Name[zh_TW]=圖片
+Name[zh_CN]=图像
+Name[zh_TW]=影像
+Name[zu]=Imifanekiso
ServiceTypes=ThumbCreator
MimeTypes=image/svg+xml
X-KDE-Library=picturethumbnail
["kdebase-konqueror-iconview.diff" (text/x-diff)]
Index: konq_iconview.cc
===================================================================
RCS file: /home/kde/kdebase/konqueror/iconview/konq_iconview.cc,v
retrieving revision 1.419
diff -u -3 -d -p -r1.419 konq_iconview.cc
--- konq_iconview.cc 2002/10/08 05:04:38 1.419
+++ konq_iconview.cc 2002/10/19 17:46:18
@@ -207,12 +207,18 @@ KonqKfmIconView::KonqKfmIconView( QWidge
m_pamPreview->insert( new KActionSeparator );
KTrader::OfferList plugins = KTrader::self()->query( "ThumbCreator" );
+ QMap< QString, KToggleAction* > previewActions;
for ( KTrader::OfferList::ConstIterator it = plugins.begin(); it != \
plugins.end(); ++it ) {
- KToggleAction *preview = new KToggleAction( (*it)->name(), 0, \
actionCollection(), (*it)->desktopEntryName().latin1() );
- connect( preview, SIGNAL( toggled( bool ) ), this, SLOT( slotPreview( bool ) \
) );
- m_pamPreview->insert( preview );
- m_paPreviewPlugins.append( preview );
+ if ( KToggleAction*& preview = previewActions[ ( *it )->name() ] )
+ preview->setName( QCString( preview->name() ) + ',' + ( *it \
)->desktopEntryName().latin1() ); + else
+ {
+ preview = new KToggleAction( (*it)->name(), 0, actionCollection(), \
(*it)->desktopEntryName().latin1() ); + connect( preview, SIGNAL( toggled( \
bool ) ), this, SLOT( slotPreview( bool ) ) ); + m_pamPreview->insert( \
preview ); + m_paPreviewPlugins.append( preview );
+ }
}
KToggleAction *soundPreview = new KToggleAction( i18n("Sound Files"), 0, \
actionCollection(), "audio/" );
connect( soundPreview, SIGNAL( toggled( bool ) ), this, SLOT( slotPreview( bool \
) ) ); @@ -388,31 +394,35 @@ void KonqKfmIconView::slotPreview( bool
}
else
{
- m_pProps->setShowingPreview( name, toggle );
- m_pIconView->setPreviewSettings( m_pProps->previewSettings() );
- if ( !toggle )
+ QStringList types = QStringList::split( ',', name );
+ for ( QStringList::ConstIterator it = types.begin(); it != types.end(); ++it \
) {
- kdDebug() << "KonqKfmIconView::slotPreview stopping image preview for " \
<< name << endl;
- if ( name == "audio/" )
- m_pIconView->disableSoundPreviews();
- else
+ m_pProps->setShowingPreview( *it, toggle );
+ m_pIconView->setPreviewSettings( m_pProps->previewSettings() );
+ if ( !toggle )
{
- KService::Ptr serv = KService::serviceByDesktopName( name );
- Q_ASSERT( serv != 0L );
- if ( serv ) {
- bool previewRunning = m_pIconView->isPreviewRunning();
- if ( previewRunning )
- m_pIconView->stopImagePreview();
- QStringList mimeTypes = \
serv->property("MimeTypes").toStringList();
- m_pIconView->setIcons( m_pIconView->iconSize(), mimeTypes );
- if ( previewRunning )
- m_pIconView->startImagePreview( m_pProps->previewSettings(), \
false ); + kdDebug() << "KonqKfmIconView::slotPreview stopping image \
preview for " << *it << endl; + if ( *it == "audio/" )
+ m_pIconView->disableSoundPreviews();
+ else
+ {
+ KService::Ptr serv = KService::serviceByDesktopName( *it );
+ Q_ASSERT( serv != 0L );
+ if ( serv ) {
+ bool previewRunning = m_pIconView->isPreviewRunning();
+ if ( previewRunning )
+ m_pIconView->stopImagePreview();
+ QStringList mimeTypes = \
serv->property("MimeTypes").toStringList(); + \
m_pIconView->setIcons( m_pIconView->iconSize(), mimeTypes ); + \
if ( previewRunning ) + m_pIconView->startImagePreview( \
m_pProps->previewSettings(), false ); + }
}
}
- }
- else
- {
- m_pIconView->startImagePreview( m_pProps->previewSettings(), true );
+ else
+ {
+ m_pIconView->startImagePreview( m_pProps->previewSettings(), true );
+ }
}
}
}
@@ -972,7 +982,15 @@ bool KonqKfmIconView::doOpenURL( const K
m_paEnablePreviews->setChecked( m_pProps->isShowingPreview() );
for ( m_paPreviewPlugins.first(); m_paPreviewPlugins.current(); \
m_paPreviewPlugins.next() ) {
- m_paPreviewPlugins.current()->setChecked( m_pProps->isShowingPreview( \
m_paPreviewPlugins.current()->name() ) ); + QStringList types = \
QStringList::split( ',', m_paPreviewPlugins.current()->name() ); + bool \
enabled = false; + for ( QStringList::ConstIterator it = types.begin(); it \
!= types.end(); ++it ) + if ( m_pProps->isShowingPreview( *it ) )
+ {
+ enabled = true;
+ break;
+ }
+ m_paPreviewPlugins.current()->setChecked( enabled );
m_paPreviewPlugins.current()->setEnabled( m_pProps->isShowingPreview() );
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic