summaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2016-04-24 21:11:18 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-25 12:31:15 -0700
commit9fe0cbaae4542927767233c20afe697cca4c9636 (patch)
tree85d860b35a642f66835063b1eb29a9a47a47f31d /qt-ui/mainwindow.cpp
parent979dee2de76e05f23dee603b52a51585af0cccbf (diff)
downloadsubsurface-9fe0cbaae4542927767233c20afe697cca4c9636.tar.gz
Fix file extension regesp
The original negative lookahead failed in case the file name contains more than 1 dot as it looks for dot that is not followed by the given extensions. And such a match exists in the file name. The new version should look properly if the file ends with any of the given extensions. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 0739e385b..955d7e482 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -1717,7 +1717,7 @@ void MainWindow::on_actionImportDiveLog_triggered()
return;
updateLastUsedDir(QFileInfo(fileNames[0]).dir().path());
- QStringList logFiles = fileNames.filter(QRegExp("^.*\\.(?!(csv|txt|apd|zxu|zxl))", Qt::CaseInsensitive));
+ QStringList logFiles = fileNames.filter(QRegExp("^(?!.*\\.(csv|txt|apd|zxu|zxl))", Qt::CaseInsensitive));
QStringList csvFiles = fileNames.filter(".csv", Qt::CaseInsensitive);
csvFiles += fileNames.filter(".apd", Qt::CaseInsensitive);
csvFiles += fileNames.filter(".zxu", Qt::CaseInsensitive);