|
|
|
@ -255,8 +255,6 @@ public:
|
|
|
|
|
|
|
|
|
|
bool singleSelect;
|
|
|
|
|
|
|
|
|
|
TQString fileformats;
|
|
|
|
|
|
|
|
|
|
KURL url;
|
|
|
|
|
KURL::List urls;
|
|
|
|
|
};
|
|
|
|
@ -266,38 +264,12 @@ ImageDialog::ImageDialog(TQWidget* parent, const KURL &url, bool singleSelect, c
|
|
|
|
|
d = new ImageDialogPrivate;
|
|
|
|
|
d->singleSelect = singleSelect;
|
|
|
|
|
|
|
|
|
|
TQStringList patternList = TQStringList::split('\n', KImageIO::pattern(KImageIO::Reading));
|
|
|
|
|
|
|
|
|
|
// All Images from list must been always the first entry given by KDE API
|
|
|
|
|
TQString allPictures = patternList[0];
|
|
|
|
|
TQStringList mimeTypes = KImageIO::mimeTypes(KImageIO::Reading);
|
|
|
|
|
mimeTypes.append("image/x-raw");
|
|
|
|
|
|
|
|
|
|
#if KDCRAW_VERSION < 0x000106
|
|
|
|
|
// Add other files format witch are missing to All Images" type mime provided by KDE and remplace current.
|
|
|
|
|
if (KDcrawIface::DcrawBinary::instance()->versionIsRight())
|
|
|
|
|
{
|
|
|
|
|
allPictures.insert(allPictures.find("|"), TQString(KDcrawIface::DcrawBinary::instance()->rawFiles()) + TQString(" *.JPE *.TIF"));
|
|
|
|
|
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 uncomplete
|
|
|
|
|
// or unavailable (see file #121242 in B.K.O).
|
|
|
|
|
patternList.append(i18n("\n%1|Camera RAW files").arg(TQString(KDcrawIface::DcrawBinary::instance()->rawFiles())));
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
allPictures.insert(allPictures.find("|"), TQString(KDcrawIface::KDcraw::rawFiles()) + TQString(" *.JPE *.TIF"));
|
|
|
|
|
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 uncomplete
|
|
|
|
|
// or unavailable (see file #121242 in B.K.O).
|
|
|
|
|
patternList.append(i18n("\n%1|Camera RAW files").arg(TQString(KDcrawIface::KDcraw::rawFiles())));
|
|
|
|
|
#endif
|
|
|
|
|
DDebug() << "mimeTypes=" << mimeTypes.join(" ") << endl;
|
|
|
|
|
|
|
|
|
|
d->fileformats = patternList.join("\n");
|
|
|
|
|
|
|
|
|
|
DDebug() << "fileformats=" << d->fileformats << endl;
|
|
|
|
|
|
|
|
|
|
KFileDialog dlg(url.path(), d->fileformats, parent, "imageFileOpenDialog", false);
|
|
|
|
|
KFileDialog dlg(url.path(), mimeTypes.join(" "), parent, "imageFileOpenDialog", false);
|
|
|
|
|
ImageDialogPreview *preview = new ImageDialogPreview(&dlg);
|
|
|
|
|
dlg.setPreviewWidget(preview);
|
|
|
|
|
dlg.setOperationMode(KFileDialog::Opening);
|
|
|
|
@ -330,11 +302,6 @@ bool ImageDialog::singleSelect() const
|
|
|
|
|
return d->singleSelect;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQString ImageDialog::fileformats() const
|
|
|
|
|
{
|
|
|
|
|
return d->fileformats;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
KURL ImageDialog::url() const
|
|
|
|
|
{
|
|
|
|
|
return d->url;
|
|
|
|
|