aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets
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 09:08:11 -0700
commit8a4f2f998a0fbfd6c0fe44b8f8578be8245d3946 (patch)
tree921dd62b2312ee7ec3da42868ed8a6dc76fb5da1 /desktop-widgets
parent4955f858bf14491ecd8d87fd2c8950dd94989694 (diff)
downloadsubsurface-8a4f2f998a0fbfd6c0fe44b8f8578be8245d3946.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 'desktop-widgets')
-rw-r--r--desktop-widgets/mainwindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 0859ecb52..c6624df5a 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -1814,7 +1814,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);