[Digikam-devel] [Bug 121242] New: takes over MIME type for TIFF images

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 121242] New: takes over MIME type for TIFF images

Jonathan Marten
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         
           Summary: takes over MIME type for TIFF images
           Product: digikam
           Version: 0.8.1
          Platform: Compiled Sources
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: digikam-devel kde org
        ReportedBy: jjm keelhaul demon co uk


Version:           0.8.1 (using KDE KDE 3.5.0)
Installed from:    Compiled From Sources
OS:                Linux

The application installs the MIME type image/x-raw which, among the long list of file extensions recognised, defines: *.tif, *.TIFF and *.TIF (twice).  Depending on the order in which the types are scanned, this can override the standard MIME type for TIFF files (image/tiff).  If this happens, opening a TIFF image will ask for an application (since image/x-raw is not in showfoto's MIME type list, probably this is another bug) instead of opening in the user's standard image viewer.

Suggest that the TIFF extensions should be removed from this MIME type.

There are also other possibly clashing file types in this list:
*.PBM, *.PCX, *.PGM, *.XBM, *.XCF, *.TGA, *.PPM, *.PSD, *.XPM, *.EPS, *.EXR, *.JP2.  None of these should be assumed to be RAW images.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 121242] takes over MIME type for TIFF images

Rex Dieter
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         
rdieter math unl edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      everconfirmed|0                           |1



------- Additional Comments From rdieter math unl edu  2006-02-02 18:20 -------
Agreed, confirmed.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 121242] takes over MIME type for TIFF images

Rex Dieter
In reply to this post by Jonathan Marten
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         
rdieter math unl edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rdieter math unl edu
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 121242] takes over MIME type for TIFF images

Rex Dieter
In reply to this post by Jonathan Marten
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         
rdieter math unl edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME



------- Additional Comments From rdieter math unl edu  2006-02-02 18:27 -------
Nevermind, just checked my digikam-0.8.1 install, no image/x-raw mimetype to be found (here).  As a matter of fact,
rpm -q -f /usr/share/mimelink/image/x-image-raw.desktop
kdegraphics-3.5.1
and it contains:
Patterns=*.crw;*.CRW;*.cr2,*.CR2;*.nef;*.NEF;*.mrw;*.MRW;

So, it appears your mimetypes are biffed and vary from factory-defaults.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 121242] takes over MIME type for TIFF images

Jonathan Marten
In reply to this post by Jonathan Marten
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         




------- Additional Comments From jjm keelhaul demon co uk  2006-02-02 18:29 -------
Created an attachment (id=14497)
 --> (http://bugs.kde.org/attachment.cgi?id=14497&action=view)
File patterns fix

Also sets default application for RAW files (AFAIK the Exec= is not allowed in
a MIME type file) and adds the MIME type to those supported by showfoto.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 121242] takes over MIME type for TIFF images

Jonathan Marten
In reply to this post by Jonathan Marten
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         
jjm keelhaul demon co uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |



------- Additional Comments From jjm keelhaul demon co uk  2006-02-02 18:35 -------
Strange (comment #2)... my 0.8.1 source seems to have digikam-0.8.1/digikam/showfoto/mimetypes/x-raw.desktop which installs as $KDEDIR/share/mimelnk/image/x-raw.desktop.  I haven't modified anything from the downloaded source.  I have a full install of kdegraphics (KDE 3.5.0), and there is no /usr/share/mimelink/image/x-image-raw.desktop
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 121242] takes over MIME type for TIFF images

Jonathan Marten
In reply to this post by Jonathan Marten
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         




------- Additional Comments From jjm keelhaul demon co uk  2006-02-02 18:41 -------
Sorry, my mistake, there is indeed an x-image-raw which comes from kdegraphics.  However, in this case there is still duplication and a file pattern clash between x-raw (from digikam) and x-image-raw (from kdegraphics).
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 121242] takes over MIME type for TIFF images

Rex Dieter
In reply to this post by Jonathan Marten
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         




------- Additional Comments From rdieter math unl edu  2006-02-02 18:44 -------
I've come to the same conclusion.  Sorry for the confusion.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 121242] mimelnk/x-image-raw.desktop conflicts with kdegraphics-3.5.x

Rex Dieter
In reply to this post by Jonathan Marten
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         
rdieter math unl edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|takes over MIME type for    |mimelnk/x-image-raw.desktop
                   |TIFF images                 |conflicts with kdegraphics-
                   |                            |3.5.x



------- Additional Comments From rdieter math unl edu  2006-02-02 18:54 -------
Since mimelnk/x-image-raw.desktop conflicts with kdegraphics-3.5.x, the easiest fix would be to simply remove it from digikam.

Alternatively, if you don't want to require use of kde(graphics) >= 3.5, only install the mimelnk file if not already present.  If kept, as originally suggested,
Patterns=
should be cleaned up.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 121242] mimelnk/x-image-raw.desktop conflicts with kdegraphics-3.5.x

Rex Dieter
In reply to this post by Jonathan Marten
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         




------- Additional Comments From rdieter math unl edu  2006-02-07 14:05 -------
FYI, looks like koffice-1.4.90 includes an x-image-raw.desktop too (bug #121536).

Looks like it should be moved to kdelibs.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 121242] mimelnk/x-image-raw.desktop conflicts with kdegraphics-3.5.x

Nicolas Goutte
In reply to this post by Jonathan Marten
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         




------- Additional Comments From nicolasg snafu de  2006-02-08 01:44 -------
SVN commit 506967 by goutte:

image/x-raw is now defined in kdelibs
CCBUG:121536
CCBUG:121242


 M  +1 -4      Makefile.am  
 D             x-image-raw.desktop  


--- trunk/KDE/kdegraphics/kfile-plugins/raw/Makefile.am #506966:506967
 @ -18,10 +18,7  @
 services_DATA = kfile_raw.desktop
 servicesdir = $(kde_servicesdir)
 
-mimetypeimagedatadir = $(kde_mimedir)/image
-mimetypeimagedata_DATA = x-image-raw.desktop
-
 magicdir = $(kde_confdir)/magic
 magic_DATA = x-image-raw.magic
 
-EXTRA_DIST = $(mimetypeimagedata_DATA) $(magic_DATA)
+EXTRA_DIST = $(magic_DATA)
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 121242] mimelnk/x-image-raw.desktop conflicts with kdegraphics-3.5.x

Nicolas Goutte
In reply to this post by Jonathan Marten
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         
nicolasg snafu de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nicolasg snafu de



------- Additional Comments From nicolasg snafu de  2006-02-08 02:10 -------
To comment #7: to avoid mimetype conflicts, you can check the KDE version on which the application is built and install the mimetypes if KDE is too old.

You can look at what I had done in KOffice: trunk/koffice/configure.in.in (everythign having kde32 kde33 kde34 ) and trunk/koffice/mimetypes/Makefile.am where it selects subdirectories of mimetypes depending on the KDE version.

For the image/x-raw mimetype, it is now defined in kdelibs.

Have a nice day!
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 121242] mimelnk/x-image-raw.desktop conflicts with kdegraphics-3.5.x

Bugzilla from ach@mpe.mpg.de
In reply to this post by Jonathan Marten
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         




------- Additional Comments From ach mpe mpg de  2006-02-09 01:20 -------
Hi Nicolas,

so AFAICS, xraw.magic and x-image-raw.desktop are moved from kdegrahics
to kdelibs in trunk and 3_5_stable, right?

Can you add the additional extentions (all supported by dcraw which
is used by kio plugins, krita and digikam).   You'll find them at

https://ach svn kde org/home/kde/trunk/extragear/graphics/digikam/showfoto/mimetypes/x-raw desktop

with kde 3.5 there is one conflict:  x-hdr.desktop and x-raw.desktop both
use .hdr in patterns.   Too late tonight to check for pattern conflicts in
trunk and 3_5_stable.  Maybe this weekend.

FWIW, testing magic:  Gilles has some test raw files at http://digikam3rdparty.free.fr/Images_2_Test_DImg/RAW/

Achim
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 121242] mimelnk/x-image-raw.desktop conflicts with kdegraphics-3.5.x

Nicolas Goutte
In reply to this post by Jonathan Marten
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         




------- Additional Comments From nicolasg snafu de  2006-02-09 19:59 -------
On Thursday 09 February 2006 01:20, Achim Bohnet wrote:
(...)
> Hi Nicolas,
>
> so AFAICS, xraw.magic and x-image-raw.desktop are moved from kdegrahics
> to kdelibs in trunk and 3_5_stable, right?


Yes!

>
> Can you add the additional extentions (all supported by dcraw which
> is used by kio plugins, krita and digikam).   You'll find them at
>
> https://ach svn kde
> org/home/kde/trunk/extragear/graphics/digikam/showfoto/mimetypes/x-raw
> desktop


If you have time, you can add them yourself.

(I have just moved the mimetype before one of the classical reasons of not
moving a mime types happen (nobody to do it, applying the message freeze,
etc.))

>
> with kde 3.5 there is one conflict:  x-hdr.desktop and x-raw.desktop both
> use .hdr in patterns.  


Well, so the conflict has existed before the move too. :-(

Are RAW *.hdr files covered by a pattern? If yes, the perhaps the *.hdr
pattern should be removed there.

> Too late tonight to check for pattern conflicts in
> trunk and 3_5_stable.  Maybe this weekend.


Yes, it would be nice if somebody could double check the pattern rules. I have
only checked that the TIFF-like ones where not like TIFF ones (so for files
starting in II or MM).

If you have time, you (or somebody else) should check the freedesktop.org
mimetype database and chekc if mime type and pattern rules exist there. If
not, create a bug report at freedesktop.org, please.

>
> FWIW, testing magic:  Gilles has some test raw files at
> http://digikam3rdparty.free.fr/Images_2_Test_DImg/RAW/
>
> Achim


Have a nice day!
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 121242] mimelnk/x-image-raw.desktop conflicts with kdegraphics-3.5.x

Nicolas Goutte
In reply to this post by Jonathan Marten
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         




------- Additional Comments From nicolasg snafu de  2006-02-23 03:07 -------
SVN commit 512608 by goutte:

- add file patterns from Krita
- change the comment to show "Image" instead of "File"
  (as other relevant image mime types)
CCMAIL:kde-i18n-doc kde org
CCBUG:121536
CCBUG:121242


 M  +2 -2      x-raw.desktop  


--- branches/KDE/3.5/kdelibs/mimetypes/image/x-raw.desktop #512607:512608
 @ -3,8 +3,8  @
 Type=MimeType
 MimeType=image/x-raw
 Icon=image
-Patterns=*.crw;*.CRW;*.cr2,*.CR2;*.nef;*.NEF;*.mrw;*.MRW;
-Comment=RAW Camera File
+Patterns=*.raw;*.RAW;*.dcr;*.DCR;*.dng;*.DNG;*.crw;*.CRW;*.cr2,*.CR2;*.nef;*.NEF;*.mrw;*.MRW;
+Comment=RAW Camera Image
 Comment[br]=Restr kamera kriz
 Comment[ca]=Fitxer de cĂ mera RAW
 Comment[cs]=RAW soubor z fotoaparátu
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 121242] mimelnk/x-image-raw.desktop conflicts with kdegraphics-3.5.x

Bugzilla from owner@bugs.kde.org
In reply to this post by Jonathan Marten
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         
rdieter math unl edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ddruspam xs4all nl



------- Additional Comments From rdieter math unl edu  2006-03-30 04:48 -------
*** Bug 124428 has been marked as a duplicate of this bug. ***
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 121242] mimelnk/x-image-raw.desktop conflicts with kdegraphics-3.5.x

Rex Dieter
In reply to this post by Jonathan Marten
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         




------- Additional Comments From rdieter math unl edu  2006-05-11 14:28 -------
FYI, digikam-0.8.2-rc1 still installs a x-raw.desktop which conflicts with kdelibs-3.5.2+ (and kdegraphics < 3.5.2 and koffice < 1.5.0).  See koffice bug #121536 comment #6 for an example of the autoconf/automake magic to fix.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 121242] mimelnk/x-image-raw.desktop conflicts with kdegraphics-3.5.x

Bugzilla from ach@mpe.mpg.de
In reply to this post by Jonathan Marten
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         




------- Additional Comments From ach mpe mpg de  2006-05-11 16:14 -------
Yeah, I know that it's still in.  For debian/kubuntu pkgs we
just delete the file before packing the .deb.

Someone knows who to tweak the Makefile magic to make the install
conditional like

if KDE < 3.5.2 then
        XIMAGERAW = x-image-raw.desktop
else
        XIMAGERAW =
fi

desktopfiles = a.desktop b.desktop $(XIMAGERAW)


Achim
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 121242] mimelnk/x-image-raw.desktop conflicts with kdegraphics-3.5.x

Gilles Caulier
In reply to this post by Jonathan Marten
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         




------- Additional Comments From caulier.gilles free fr  2006-05-15 13:31 -------
SVN commit 541016 by cgilles:

digikam from trunk : showfoto and image/x-raw type mime :

- removed x-raw.desktop file in conflict with KDE3.5.2
- add a rule into Showfoto::slotOpenFile() to detect witch KDE release we use :
 * if KDE >= 3.5.2 --> we use image/x-raw pattern from KDE.
 * if KDE < 3.5.2 --> we construct a new pattern from stcrach.

IMPORTANT : this code have been tested under Mandriva 2006.0 official using KDE 3.4.2. It's untested with KDE > 3.4.2. Please give me a feedback if all is ok to close this file !

CCMAIL: digikam-devel kde org
CCBUGS: 121242

 D             mimetypes (directory)  
 M  +28 -7     showfoto.cpp  
 M  +1 -1      showfoto.desktop  


--- trunk/extragear/graphics/digikam/showfoto/showfoto.cpp #541015:541016
 @ -387,16 +387,37  @
     if (m_currentItem && !promptUserSave(m_currentItem->url()))
         return;
 
-    QString mimetypes = KImageIO::mimeTypes(KImageIO::Reading).join(" ");
+    QString fileformats;
     
-    // Added RAW file format type mimes supported by dcraw program.
-    mimetypes.append (" image/x-raw");
+#if KDE_IS_VERSION(3,5,2)
+    //-- With KDE version >= 3.5.2, "image/x-raw" type mime exist ------------------------------
     
-    KURL::List urls =  KFileDialog::getOpenURLs(m_lastOpenedDirectory.path(),
-                                                mimetypes,
-                                                this,
-                                                i18n("Open Images"));
+    fileformats = KImageIO::mimeTypes(KImageIO::Reading).join(" ");
+#else
+    //-- with KDE version < 3.5.2, we need to add all camera RAW file formats ------------------
+    
+    QStringList patternList = QStringList::split('\n', KImageIO::pattern(KImageIO::Reading));
+    
+    // All Pictures from list must been always the first entry given by KDE API
+    QString allPictures = patternList[0];
+    
+    // Add RAW file format to All Pictures" type mime and remplace current.
+    allPictures.insert(allPictures.find("|"), QString(raw_file_extentions));
+    patternList.remove(patternList[0]);
+    patternList.prepend(allPictures);
+    
+    // Added RAW file formats supported by dcraw program like a type mime.
+    // Nota: we cannot use here "image/x-raw" type mime from KDE because it
+    // will be only available for KDE 3.5.2, not before (see file #121242 in B.K.O).
+    patternList.append(QString("\n%1|Camera RAW files").arg(QString(raw_file_extentions)));
+    
+    fileformats = patternList.join("\n");
+#endif
 
+    kdDebug () << "fileformats=" << fileformats << endl;  
+    
+    KURL::List urls =  KFileDialog::getOpenURLs(m_lastOpenedDirectory.path(), fileformats, this, i18n("Open Images"));
+
     if (!urls.isEmpty())
     {
         m_bar->clear();
--- trunk/extragear/graphics/digikam/showfoto/showfoto.desktop #541015:541016
 @ -59,7 +59,7  @
 Exec=showfoto %i %m -caption "%c" %U
 Icon=showfoto
 Type=Application
-MimeType=image/gif;image/x-xpm;image/x-xbm;image/jpeg;image/png;image/tiff;image/x-bmp;image/x-psd;image/x-eim;image/x-portable-bitmap;image/x-portable-pixmap;image/x-portable-greymap
+MimeType=image/gif;image/x-xpm;image/x-xbm;image/jpeg;image/png;image/tiff;image/x-bmp;image/x-psd;image/x-eim;image/x-portable-bitmap;image/x-portable-pixmap;image/x-portable-greymap;image/x-raw
 Terminal=false
 Categories=Qt;KDE;Graphics;
 DocPath=showfoto/index.html
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 121242] mimelnk/x-image-raw.desktop conflicts with kdegraphics-3.5.x

Gilles Caulier
In reply to this post by Jonathan Marten
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121242         




------- Additional Comments From caulier.gilles free fr  2006-05-15 13:38 -------
SVN commit 541017 by cgilles:

digikam from stable : showfoto and image/x-raw type mime :

- removed x-raw.desktop file in conflict with KDE3.5.2
- add a rule into Showfoto::slotOpenFile() to detect witch KDE release we use :
 * if KDE >= 3.5.2 --> we use image/x-raw pattern from KDE.
 * if KDE < 3.5.2 --> we construct a new pattern from sctrach.

IMPORTANT : this code have been tested under Mandriva 2006.0 official using KDE 3.4.2. It's untested with KDE > 3.4.2. Please give me a feedback if all is ok to close this file !

CCMAIL: digikam-devel kde org
CCBUGS: 121242

 D             mimetypes (directory)  
 M  +29 -8     showfoto.cpp  
 M  +1 -1      showfoto.desktop  


--- branches/stable/extragear/graphics/digikam/showfoto/showfoto.cpp #541016:541017
 @ -587,15 +587,36  @
     if (!promptUserSave())
         return;
 
-    QString mimetypes = KImageIO::mimeTypes(KImageIO::Reading).join(" ");
+    QString fileformats;
+    
+#if KDE_IS_VERSION(3,5,2)
+    //-- With KDE version >= 3.5.2, "image/x-raw" type mime exist ------------------------------
+    
+    fileformats = KImageIO::mimeTypes(KImageIO::Reading).join(" ");
+#else
+    //-- with KDE version < 3.5.2, we need to add all camera RAW file formats ------------------
+    
+    QStringList patternList = QStringList::split('\n', KImageIO::pattern(KImageIO::Reading));
+    
+    // All Pictures from list must been always the first entry given by KDE API
+    QString allPictures = patternList[0];
+    
+    // Add RAW file format to All Pictures" type mime and remplace current.
+    allPictures.insert(allPictures.find("|"), QString(raw_file_extentions));
+    patternList.remove(patternList[0]);
+    patternList.prepend(allPictures);
+    
+    // Added RAW file formats supported by dcraw program like a type mime.
+    // Nota: we cannot use here "image/x-raw" type mime from KDE because it
+    // will be only available for KDE 3.5.2, not before (see file #121242 in B.K.O).
+    patternList.append(QString("\n%1|Camera RAW files").arg(QString(raw_file_extentions)));
+    
+    fileformats = patternList.join("\n");
+#endif
 
-    // Added RAW file format type mimes supported by dcraw program.
-    mimetypes.append (" image/x-raw");
-      
-    KURL::List urls =  KFileDialog::getOpenURLs(m_lastOpenedDirectory.path(),
-                                                mimetypes,
-                                                this,
-                                                i18n("Open Images"));
+    kdDebug () << "fileformats=" << fileformats << endl;  
+    
+    KURL::List urls =  KFileDialog::getOpenURLs(m_lastOpenedDirectory.path(), fileformats, this, i18n("Open Images"));
 
     if (!urls.isEmpty())
     {
--- branches/stable/extragear/graphics/digikam/showfoto/showfoto.desktop #541016:541017
 @ -57,7 +57,7  @
 Exec=showfoto %i %m -caption "%c" %U
 Icon=showfoto
 Type=Application
-MimeType=image/gif;image/x-xpm;image/x-xbm;image/jpeg;image/png;image/tiff;image/x-bmp;image/x-psd;image/x-eim;image/x-portable-bitmap;image/x-portable-pixmap;image/x-portable-greymap
+MimeType=image/gif;image/x-xpm;image/x-xbm;image/jpeg;image/png;image/tiff;image/x-bmp;image/x-psd;image/x-eim;image/x-portable-bitmap;image/x-portable-pixmap;image/x-portable-greymap;image/x-raw
 Terminal=false
 Categories=Qt;KDE;Graphics;
 DocPath=showfoto/index.html
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
12