]> granicus.if.org Git - transmission/commitdiff
(trunk qt) #5059 'Memory leak in the TrMainWindow :: openTorrent' -- fixed.
authorJordan Lee <jordan@transmissionbt.com>
Mon, 8 Oct 2012 04:23:39 +0000 (04:23 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Mon, 8 Oct 2012 04:23:39 +0000 (04:23 +0000)
qt/mainwin.cc
qt/make-dialog.cc
qt/options.cc

index 71ab2905697926e172e7b6eabf4c88311784839a..c0e1faefa4dbafbf7dde5e9f8010827822b1c9f2 100644 (file)
@@ -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 ) );
index 7305a3cc7a2c7a14c8ceca405d5752815f983d87..fc56cc5683c6466d0ac2d8facfa9515eb52b02f8 100644 (file)
@@ -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( );
index 40d6b3b564d17b13a72b8130cfdfd94939f2b652..803fe087be59a55cb526f35126a52db925e11e95 100644 (file)
@@ -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( );
 }