aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/folderlistmodel/fileinfothread.cpp
diff options
context:
space:
mode:
authorJoni Poikelin <joni.poikelin@theqtcompany.com>2015-10-09 12:45:43 +0300
committerJoni Poikelin <joni.poikelin@theqtcompany.com>2015-10-12 09:53:54 +0000
commit60866c99bc908a5c5a2a9cdfa74b00d692233f2f (patch)
treeb2a362c54f9f3f47fc336f8056f4cb8946095ffc /src/imports/folderlistmodel/fileinfothread.cpp
parentff1264cd6f48cd2bbf61e04a454c7ccccefa40d9 (diff)
Add caseSensitive property to FolderListModel
Allows controlling case sensitivity of nameFilters Task-number: QTBUG-45566 Change-Id: Iab3bdd4cbaee59e16fafb9d153f51b35b22a822a Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/imports/folderlistmodel/fileinfothread.cpp')
-rw-r--r--src/imports/folderlistmodel/fileinfothread.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/imports/folderlistmodel/fileinfothread.cpp b/src/imports/folderlistmodel/fileinfothread.cpp
index ebdfba42a8..731eb45460 100644
--- a/src/imports/folderlistmodel/fileinfothread.cpp
+++ b/src/imports/folderlistmodel/fileinfothread.cpp
@@ -52,7 +52,8 @@ FileInfoThread::FileInfoThread(QObject *parent)
showDirsFirst(false),
showDotAndDotDot(false),
showHidden(false),
- showOnlyReadable(false)
+ showOnlyReadable(false),
+ caseSensitive(true)
{
#ifndef QT_NO_FILESYSTEMWATCHER
watcher = new QFileSystemWatcher(this);
@@ -190,6 +191,14 @@ void FileInfoThread::setShowOnlyReadable(bool on)
condition.wakeAll();
}
+void FileInfoThread::setCaseSensitive(bool on)
+{
+ QMutexLocker locker(&mutex);
+ caseSensitive = on;
+ folderUpdate = true;
+ condition.wakeAll();
+}
+
#ifndef QT_NO_FILESYSTEMWATCHER
void FileInfoThread::updateFile(const QString &path)
{
@@ -228,7 +237,8 @@ void FileInfoThread::run()
void FileInfoThread::getFileInfos(const QString &path)
{
QDir::Filters filter;
- filter = QDir::CaseSensitive;
+ if (caseSensitive)
+ filter = QDir::CaseSensitive;
if (showFiles)
filter = filter | QDir::Files;
if (showDirs)