From e290c0b9ab4076dfa63807c1dc7a6e6dcfb537ce Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Fri, 29 Oct 2010 17:42:06 +0000 Subject: enabled read-only mode for file dialog git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1961 90c681e8-e032-0410-971d-27865f9a5e38 --- .../FileDialogs/QmmpFileDialog/qmmpfiledialogimpl.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialogimpl.cpp') diff --git a/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialogimpl.cpp b/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialogimpl.cpp index a35387a6e..0e4bd298f 100644 --- a/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialogimpl.cpp +++ b/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialogimpl.cpp @@ -61,14 +61,9 @@ QmmpFileDialogImpl::QmmpFileDialogImpl(QWidget * parent, Qt::WindowFlags f) : QD { setupUi(this); setAttribute(Qt::WA_QuitOnClose, false); -#if QT_VERSION >= 0x040400 m_model = new QFileSystemModel(this); m_model->setNameFilterDisables (false); - m_model->setReadOnly(false); -#else - m_model = new QDirModel(this); - m_model->setSorting(QDir::Type); -#endif + m_model->setReadOnly(true); fileListView->setModel(m_model); treeView->setModel(m_model); @@ -126,9 +121,7 @@ void QmmpFileDialogImpl::on_lookInComboBox_activated(const QString &path) { fileListView->setRootIndex(m_model->index(path)); treeView->setRootIndex(m_model->index(path)); -#if QT_VERSION >= 0x040400 m_model->setRootPath(path); -#endif } } @@ -140,9 +133,7 @@ void QmmpFileDialogImpl::on_upToolButton_clicked() treeView->setRootIndex(fileListView->rootIndex()); lookInComboBox->setEditText(m_model->filePath(fileListView->rootIndex())); fileListView->selectionModel()->clear (); -#if QT_VERSION >= 0x040400 m_model->setRootPath(m_model->filePath(treeView->rootIndex())); -#endif } void QmmpFileDialogImpl::on_treeView_doubleClicked(const QModelIndex& ind) @@ -157,9 +148,7 @@ void QmmpFileDialogImpl::on_treeView_doubleClicked(const QModelIndex& ind) treeView->selectionModel()->clear (); fileListView->setRootIndex(ind); fileListView->selectionModel()->clear (); -#if QT_VERSION >= 0x040400 m_model->setRootPath(m_model->filePath(ind)); -#endif } else { @@ -183,9 +172,7 @@ void QmmpFileDialogImpl::on_fileListView_doubleClicked(const QModelIndex& ind) fileListView->selectionModel()->clear (); treeView->setRootIndex(ind); treeView->selectionModel()->clear (); -#if QT_VERSION >= 0x040400 m_model->setRootPath(m_model->filePath(ind)); -#endif } else { @@ -277,9 +264,7 @@ void QmmpFileDialogImpl::setModeAndMask(const QString& d,FileDialog::Mode m, con { fileListView->setRootIndex(m_model->index(path)); treeView->setRootIndex(m_model->index(path)); -#if QT_VERSION >= 0x040400 m_model->setRootPath(path); -#endif } if (m == FileDialog::AddDirs || m == FileDialog::AddDir) -- cgit v1.2.3-13-gbd6f