UNNAMED_READER/corelibrary
fileFormats.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "fileFormats.h"
00023 #include "UNNAMED_READER_debug.h"
00024
00025 #define UNNAMED_READER_DEBUG 0
00026
00027
00028 namespace UNNAMED_READER {
00029
00030
00031
00032
00033 char *supportedMimeTypes_strings[] =
00034 {
00035 "image/tiff", "UNNAMED_READER_TIFF_plugin",
00036 "application/pdf", "UNNAMED_READER_PDF_plugin",
00037 0
00038 };
00039
00040
00041
00042 bool fileFormats::UrlQuickCheckForSupportedFormat(KUrl url)
00043 {
00044 kDebug(UNNAMED_READER_DEBUG, shell) << "fileFormats::UrlQuickCheckForSupportedFormat(" << url << ")" << endl;
00045
00046
00047 if (!url.isValid() || url.isEmpty())
00048 return false;
00049
00050
00051 if (!url.isLocalFile())
00052 return true;
00053
00054
00055
00056 if (url.fileName().endsWith(".gz"))
00057 return true;
00058 if (url.fileName().endsWith(".bz2"))
00059 return true;
00060
00061 if (url.fileName().endsWith(".pdf"))
00062 return true;
00063
00064 return false;
00065 }
00066
00067
00068 QStringList fileFormats::supportedMimeTypes()
00069 {
00070 QStringList types;
00071 for(int i=0; supportedMimeTypes_strings[i] != 0; i++)
00072 if (i%2 == 0)
00073 types << supportedMimeTypes_strings[i];
00074 return types;
00075 }
00076
00077 }
00078