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 )
QString path = url.toLocalFile();
QFileInfo info( path );
QString suffix = info.completeSuffix();
if( suffix == "cnt"
|| suffix == "edf"
|| suffix == "asc"
|| suffix == "nii"
|| suffix == "nii.gz"
|| suffix == "fib" )
if( suffix.endsWith( "cnt" )
|| suffix.endsWith( "edf" )
|| suffix.endsWith( "asc" )
|| suffix.endsWith( "nii" )
|| suffix.endsWith( "nii.gz" )
|| suffix.endsWith( "fib" ) )
{
filenames.push_back( path.toStdString() );
}
......@@ -1264,16 +1264,15 @@ bool WMainWindow::isDropAcceptable( const QMimeData* mimeData )
{
QString path = url.toLocalFile();
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();
if( suffix == "cnt"
|| suffix == "edf"
|| suffix == "asc"
|| suffix == "nii"
|| suffix == "nii.gz"
|| suffix == "fib"
|| suffix == "owp"
|| suffix == "owproj" )
if( suffix.endsWith( "cnt" )
|| suffix.endsWith( "edf" )
|| suffix.endsWith( "asc" )
|| suffix.endsWith( "nii" )
|| suffix.endsWith( "nii.gz" )
|| suffix.endsWith( "fib" )
|| suffix.endsWith("owp" )
|| suffix.endsWith( "owproj" ) )
{
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