From: Jordan Lee Date: Mon, 8 Oct 2012 04:23:39 +0000 (+0000) Subject: (trunk qt) #5059 'Memory leak in the TrMainWindow :: openTorrent' -- fixed. X-Git-Tag: 2.72~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=792215c5e9f3e271f79e55e4ee43d75c5f26267b;p=transmission (trunk qt) #5059 'Memory leak in the TrMainWindow :: openTorrent' -- fixed. --- diff --git a/qt/mainwin.cc b/qt/mainwin.cc index 71ab29056..c0e1faefa 100644 --- a/qt/mainwin.cc +++ b/qt/mainwin.cc @@ -1146,6 +1146,7 @@ TrMainWindow :: openTorrent( ) myPrefs.getString( Prefs::OPEN_DIALOG_FOLDER ), tr( "Torrent Files (*.torrent);;All Files (*.*)" ) ); myFileDialog->setFileMode( QFileDialog::ExistingFiles ); + myFileDialog->setAttribute( Qt::WA_DeleteOnClose ); QCheckBox * button = new QCheckBox( tr( "Show &options dialog" ) ); button->setChecked( myPrefs.getBool( Prefs::OPTIONS_PROMPT ) ); diff --git a/qt/make-dialog.cc b/qt/make-dialog.cc index 7305a3cc7..fc56cc568 100644 --- a/qt/make-dialog.cc +++ b/qt/make-dialog.cc @@ -175,6 +175,7 @@ MakeDialog :: onFileClicked( ) { QFileDialog * d = new QFileDialog( this, tr( "Select File" ) ); d->setFileMode( QFileDialog::ExistingFile ); + d->setAttribute( Qt::WA_DeleteOnClose ); connect( d, SIGNAL(filesSelected(const QStringList&)), this, SLOT(onFileSelected(const QStringList&)) ); d->show( ); @@ -197,7 +198,9 @@ void MakeDialog :: onFolderClicked( ) { QFileDialog * d = new QFileDialog( this, tr( "Select Folder" ) ); - d->setFileMode( QFileDialog::DirectoryOnly ); + d->setFileMode( QFileDialog::Directory ); + d->setOption( QFileDialog::ShowDirsOnly ); + d->setAttribute( Qt::WA_DeleteOnClose ); connect( d, SIGNAL(filesSelected(const QStringList&)), this, SLOT(onFolderSelected(const QStringList&)) ); d->show( ); @@ -220,7 +223,9 @@ void MakeDialog :: onDestinationClicked( ) { QFileDialog * d = new QFileDialog( this, tr( "Select Folder" ) ); - d->setFileMode( QFileDialog::DirectoryOnly ); + d->setFileMode( QFileDialog::Directory ); + d->setOption( QFileDialog::ShowDirsOnly ); + d->setAttribute( Qt::WA_DeleteOnClose ); connect( d, SIGNAL(filesSelected(const QStringList&)), this, SLOT(onDestinationSelected(const QStringList&)) ); d->show( ); diff --git a/qt/options.cc b/qt/options.cc index 40d6b3b56..803fe087b 100644 --- a/qt/options.cc +++ b/qt/options.cc @@ -420,6 +420,7 @@ Options :: onFilenameClicked( ) QFileInfo(myAdd.filename).absolutePath(), tr( "Torrent Files (*.torrent);;All Files (*.*)" ) ); d->setFileMode( QFileDialog::ExistingFile ); + d->setAttribute( Qt::WA_DeleteOnClose ); connect( d, SIGNAL(filesSelected(const QStringList&)), this, SLOT(onFilesSelected(const QStringList&)) ); d->show( ); } @@ -443,6 +444,7 @@ Options :: onDestinationClicked( ) tr( "Select Destination" ), myDestination.absolutePath( ) ); d->setFileMode( QFileDialog::Directory ); + d->setAttribute( Qt::WA_DeleteOnClose ); connect( d, SIGNAL(filesSelected(const QStringList&)), this, SLOT(onDestinationsSelected(const QStringList&)) ); d->show( ); }