"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/backend/datasources/filters/AbstractFileFilter.cpp" between
labplot-2.8.1.tar.gz and labplot-2.8.2.tar.gz

About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.

AbstractFileFilter.cpp  (labplot-2.8.1):AbstractFileFilter.cpp  (labplot-2.8.2)
skipping to change at line 150 skipping to change at line 150
fileInfo = proc.readLine(); fileInfo = proc.readLine();
#endif #endif
FileType fileType; FileType fileType;
QByteArray imageFormat = QImageReader::imageFormat(fileName); QByteArray imageFormat = QImageReader::imageFormat(fileName);
if (fileInfo.contains(QLatin1String("JSON")) || fileName.endsWith(QLatin1 String("json"), Qt::CaseInsensitive) if (fileInfo.contains(QLatin1String("JSON")) || fileName.endsWith(QLatin1 String("json"), Qt::CaseInsensitive)
//json file can be compressed. add all formats supported by KFilt erDev, \sa KCompressionDevice::CompressionType //json file can be compressed. add all formats supported by KFilt erDev, \sa KCompressionDevice::CompressionType
|| fileName.endsWith(QLatin1String("json.gz"), Qt::CaseInsensitiv e) || fileName.endsWith(QLatin1String("json.gz"), Qt::CaseInsensitiv e)
|| fileName.endsWith(QLatin1String("json.bz2"), Qt::CaseInsensiti ve) || fileName.endsWith(QLatin1String("json.bz2"), Qt::CaseInsensiti ve)
|| fileName.endsWith(QLatin1String("json.lzma"), Qt::CaseInsensit ive) || fileName.endsWith(QLatin1String("json.lzma"), Qt::CaseInsensit ive)
|| fileName.endsWith(QLatin1String("json.xz"), Qt::CaseInsensitiv || fileName.endsWith(QLatin1String("json.xz"), Qt::CaseInsensitiv
e) ) { e)
|| fileName.endsWith(QLatin1String("har"), Qt::CaseInsensitive) )
{
//*.json files can be recognized as ASCII. so, do the check for t he json-extension as first. //*.json files can be recognized as ASCII. so, do the check for t he json-extension as first.
fileType = FileType::JSON; fileType = FileType::JSON;
} else if (fileInfo.contains(QLatin1String("ASCII")) } else if (fileInfo.contains(QLatin1String("ASCII"))
|| fileName.endsWith(QLatin1String("txt"), Qt::CaseInsensitive) || fileName.endsWith(QLatin1String("txt"), Qt::CaseInsensitive)
|| fileName.endsWith(QLatin1String("csv"), Qt::CaseInsensitive) || fileName.endsWith(QLatin1String("csv"), Qt::CaseInsensitive)
|| fileName.endsWith(QLatin1String("dat"), Qt::CaseInsensitive) || fileName.endsWith(QLatin1String("dat"), Qt::CaseInsensitive)
|| fileInfo.contains(QLatin1String("compressed data"))/* for gzip ped ascii data */ ) { || fileInfo.contains(QLatin1String("compressed data"))/* for gzip ped ascii data */ ) {
if (NgspiceRawAsciiFilter::isNgspiceAsciiFile(fileName)) if (NgspiceRawAsciiFilter::isNgspiceAsciiFile(fileName))
fileType = FileType::NgspiceRawAscii; fileType = FileType::NgspiceRawAscii;
else //probably ascii data else //probably ascii data
fileType = FileType::Ascii; fileType = FileType::Ascii;
} else if (fileInfo.contains(QLatin1String("Hierarchical Data Format")) }
#ifdef HAVE_HDF5
else if (fileInfo.contains(QLatin1String("Hierarchical Data Format"))
|| fileName.endsWith(QLatin1String("h5"), Qt::CaseInsensitive) || fileName.endsWith(QLatin1String("h5"), Qt::CaseInsensitive)
|| fileName.endsWith(QLatin1String("hdf"), Qt::CaseInsensitive) || fileName.endsWith(QLatin1String("hdf"), Qt::CaseInsensitive)
|| fileName.endsWith(QLatin1String("hdf5"), Qt::CaseInsensitive) ) || fileName.endsWith(QLatin1String("hdf5"), Qt::CaseInsensitive) )
fileType = FileType::HDF5; fileType = FileType::HDF5;
#endif
#ifdef HAVE_NETCDF
else if (fileInfo.contains(QLatin1String("NetCDF Data Format")) else if (fileInfo.contains(QLatin1String("NetCDF Data Format"))
|| fileName.endsWith(QLatin1String("nc"), Qt::CaseInsensitive) || fileName.endsWith(QLatin1String("nc"), Qt::CaseInsensitive)
|| fileName.endsWith(QLatin1String("netcdf"), Qt::CaseInsensitive ) || fileName.endsWith(QLatin1String("netcdf"), Qt::CaseInsensitive )
|| fileName.endsWith(QLatin1String("cdf"), Qt::CaseInsensitive)) || fileName.endsWith(QLatin1String("cdf"), Qt::CaseInsensitive))
fileType = FileType::NETCDF; fileType = FileType::NETCDF;
#endif
#ifdef HAVE_FITS
else if (fileInfo.contains(QLatin1String("FITS image data")) else if (fileInfo.contains(QLatin1String("FITS image data"))
|| fileName.endsWith(QLatin1String("fits"), Qt::CaseInsensitive) || fileName.endsWith(QLatin1String("fits"), Qt::CaseInsensitive)
|| fileName.endsWith(QLatin1String("fit"), Qt::CaseInsensitive) || fileName.endsWith(QLatin1String("fit"), Qt::CaseInsensitive)
|| fileName.endsWith(QLatin1String("fts"), Qt::CaseInsensitive)) || fileName.endsWith(QLatin1String("fts"), Qt::CaseInsensitive))
fileType = FileType::FITS; fileType = FileType::FITS;
#endif
#ifdef HAVE_ZIP
else if (fileInfo.contains(QLatin1String("ROOT")) //can be "ROOT Data For mat" or "ROOT file Version ??? (Compression: 1)" else if (fileInfo.contains(QLatin1String("ROOT")) //can be "ROOT Data For mat" or "ROOT file Version ??? (Compression: 1)"
|| fileName.endsWith(QLatin1String("root"), Qt::CaseInsensitive) ) // TODO find out file description || fileName.endsWith(QLatin1String("root"), Qt::CaseInsensitive) ) // TODO find out file description
fileType = FileType::ROOT; fileType = FileType::ROOT;
#endif
else if (fileInfo.contains("image") || fileInfo.contains("bitmap") || !im ageFormat.isEmpty()) else if (fileInfo.contains("image") || fileInfo.contains("bitmap") || !im ageFormat.isEmpty())
fileType = FileType::Image; fileType = FileType::Image;
else if (NgspiceRawBinaryFilter::isNgspiceBinaryFile(fileName)) else if (NgspiceRawBinaryFilter::isNgspiceBinaryFile(fileName))
fileType = FileType::NgspiceRawBinary; fileType = FileType::NgspiceRawBinary;
else else
fileType = FileType::Binary; fileType = FileType::Binary;
return fileType; return fileType;
} }
 End of changes. 6 change blocks. 
3 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)