Commit ba0dbcee authored by Mario Hlawitschka's avatar Mario Hlawitschka
Browse files

[FIX #202] Filenames with dots in the basename that broke the suffix parsing should work now.

parent fa498b7c
...@@ -1198,12 +1198,12 @@ void WMainWindow::handleDrop( QDropEvent* event ) ...@@ -1198,12 +1198,12 @@ void WMainWindow::handleDrop( QDropEvent* event )
QString path = url.toLocalFile(); QString path = url.toLocalFile();
QFileInfo info( path ); QFileInfo info( path );
QString suffix = info.completeSuffix(); QString suffix = info.completeSuffix();
if( suffix == "cnt" if( suffix.endsWith( "cnt" )
|| suffix == "edf" || suffix.endsWith( "edf" )
|| suffix == "asc" || suffix.endsWith( "asc" )
|| suffix == "nii" || suffix.endsWith( "nii" )
|| suffix == "nii.gz" || suffix.endsWith( "nii.gz" )
|| suffix == "fib" ) || suffix.endsWith( "fib" ) )
{ {
filenames.push_back( path.toStdString() ); filenames.push_back( path.toStdString() );
} }
...@@ -1264,16 +1264,15 @@ bool WMainWindow::isDropAcceptable( const QMimeData* mimeData ) ...@@ -1264,16 +1264,15 @@ bool WMainWindow::isDropAcceptable( const QMimeData* mimeData )
{ {
QString path = url.toLocalFile(); QString path = url.toLocalFile();
QFileInfo info( path ); QFileInfo info( path );
// TODO(mario): check when this fails, I assume we have problems with files with multiple dots such as session.1.nii
QString suffix = info.completeSuffix(); QString suffix = info.completeSuffix();
if( suffix == "cnt" if( suffix.endsWith( "cnt" )
|| suffix == "edf" || suffix.endsWith( "edf" )
|| suffix == "asc" || suffix.endsWith( "asc" )
|| suffix == "nii" || suffix.endsWith( "nii" )
|| suffix == "nii.gz" || suffix.endsWith( "nii.gz" )
|| suffix == "fib" || suffix.endsWith( "fib" )
|| suffix == "owp" || suffix.endsWith("owp" )
|| suffix == "owproj" ) || suffix.endsWith( "owproj" ) )
{ {
return true; return true;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment