diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2021-01-02 19:12:15 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2021-01-02 19:12:15 +0000 |
| commit | 48c7312f4ba78ccf2947a9b4b0e6fd2bcdcb3066 (patch) | |
| tree | 8ab83d262aee3e16298c431608ed7ff8873dfb59 /src/plugins/Ui/qsui/filesystembrowser.cpp | |
| parent | 7596bcb971e27330e089a7067b024e476b2ce15e (diff) | |
| download | qmmp-48c7312f4ba78ccf2947a9b4b0e6fd2bcdcb3066.tar.gz qmmp-48c7312f4ba78ccf2947a9b4b0e6fd2bcdcb3066.tar.bz2 qmmp-48c7312f4ba78ccf2947a9b4b0e6fd2bcdcb3066.zip | |
improved coding style
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9614 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Ui/qsui/filesystembrowser.cpp')
| -rw-r--r-- | src/plugins/Ui/qsui/filesystembrowser.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/plugins/Ui/qsui/filesystembrowser.cpp b/src/plugins/Ui/qsui/filesystembrowser.cpp index cbc23a9f0..9fd4059aa 100644 --- a/src/plugins/Ui/qsui/filesystembrowser.cpp +++ b/src/plugins/Ui/qsui/filesystembrowser.cpp @@ -40,12 +40,12 @@ public: explicit FileSystemFilterProxyModel(QObject *parent) : QSortFilterProxyModel(parent) {} protected: - virtual bool filterAcceptsRow( - int source_row, const QModelIndex &source_parent) const override { + virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override + { QFileSystemModel *sm = qobject_cast<QFileSystemModel*>(sourceModel()); - if (source_parent == sm->index(sm->rootPath())) { + if (source_parent == sm->index(sm->rootPath())) return QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent); - } + return true; } }; @@ -53,8 +53,6 @@ protected: FileSystemBrowser::FileSystemBrowser(QWidget *parent) : QWidget(parent) { - m_update = false; - m_listView = new QListView(this); m_listView->setFrameStyle(QFrame::NoFrame); m_listView->setDragEnabled(true); @@ -81,7 +79,7 @@ FileSystemBrowser::FileSystemBrowser(QWidget *parent) : m_fileSystemModel->setNameFilterDisables(false); m_fileSystemModel->setFilter(QDir::AllDirs | QDir::Files | QDir::NoDot); - m_proxyModel = new FileSystemFilterProxyModel(this); + m_proxyModel = new FileSystemFilterProxyModel(this); m_proxyModel->setDynamicSortFilter(true); m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); m_proxyModel->setSourceModel(m_fileSystemModel); |
