Use new QFileDialog::DontUseCustomDirectoryIcons flag for faster file dialogs
In Qt 4.8.6 there's a new option QFileDialog::DontUseCustomDirectoryIcons promising much better performance when there are many folders. Closes #511.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* sample_buffer.cpp - container-class sampleBuffer
|
||||
*
|
||||
* Copyright (c) 2005-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2013 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -742,6 +742,9 @@ void sampleBuffer::visualize( QPainter & _p, const QRect & _dr,
|
||||
QString sampleBuffer::openAudioFile() const
|
||||
{
|
||||
QFileDialog ofd( NULL, tr( "Open audio file" ) );
|
||||
#if QT_VERSION >= 0x040806
|
||||
ofd.setOption( QFileDialog::DontUseCustomDirectoryIcons );
|
||||
#endif
|
||||
|
||||
QString dir;
|
||||
if( !m_audioFile.isEmpty() )
|
||||
|
||||
@@ -1241,6 +1241,9 @@ void song::importProject()
|
||||
" (*.h2song);;" +
|
||||
tr("All file types") +
|
||||
" (*.*)");
|
||||
#if QT_VERSION >= 0x040806
|
||||
ofd.setOption( QFileDialog::DontUseCustomDirectoryIcons );
|
||||
#endif
|
||||
|
||||
ofd.setFileMode( QFileDialog::ExistingFiles );
|
||||
if( ofd.exec () == QDialog::Accepted && !ofd.selectedFiles().isEmpty() )
|
||||
@@ -1296,6 +1299,9 @@ void song::exportProject(bool multiExport)
|
||||
}
|
||||
|
||||
QFileDialog efd( engine::mainWindow() );
|
||||
#if QT_VERSION >= 0x040806
|
||||
efd.setOption( QFileDialog::DontUseCustomDirectoryIcons );
|
||||
#endif
|
||||
if (multiExport)
|
||||
{
|
||||
efd.setFileMode( QFileDialog::Directory);
|
||||
|
||||
@@ -688,6 +688,9 @@ void MainWindow::openProject( void )
|
||||
{
|
||||
QFileDialog ofd( this, tr( "Open project" ), "",
|
||||
tr( "MultiMedia Project (*.mmp *.mmpz *.xml)" ) );
|
||||
#if QT_VERSION >= 0x040806
|
||||
ofd.setOption( QFileDialog::DontUseCustomDirectoryIcons );
|
||||
#endif
|
||||
ofd.setDirectory( configManager::inst()->userProjectsDir() );
|
||||
ofd.setFileMode( QFileDialog::ExistingFiles );
|
||||
if( ofd.exec () == QDialog::Accepted &&
|
||||
@@ -751,6 +754,9 @@ bool MainWindow::saveProjectAs( void )
|
||||
QFileDialog sfd( this, tr( "Save project" ), "",
|
||||
tr( "MultiMedia Project (*.mmp *.mmpz);;"
|
||||
"MultiMedia Project Template (*.mpt)" ) );
|
||||
#if QT_VERSION >= 0x040806
|
||||
sfd.setOption( QFileDialog::DontUseCustomDirectoryIcons );
|
||||
#endif
|
||||
sfd.setAcceptMode( QFileDialog::AcceptSave );
|
||||
sfd.setFileMode( QFileDialog::AnyFile );
|
||||
QString f = engine::getSong()->projectFileName();
|
||||
|
||||
@@ -1010,7 +1010,11 @@ void setupDialog::openWorkingDir()
|
||||
{
|
||||
QString new_dir = QFileDialog::getExistingDirectory( this,
|
||||
tr( "Choose LMMS working directory" ),
|
||||
m_workingDir );
|
||||
m_workingDir
|
||||
#if QT_VERSION >= 0x040806
|
||||
, QFileDialog::DontUseCustomDirectoryIcons
|
||||
#endif
|
||||
);
|
||||
if( new_dir != QString::null )
|
||||
{
|
||||
m_wdLineEdit->setText( new_dir );
|
||||
|
||||
Reference in New Issue
Block a user