Merge branch 'master' into qmake
[mdictionary] / src / plugins / xdxf / XdxfSettingsDialog.cpp
index 9f2a3d6..7afb707 100644 (file)
@@ -30,7 +30,7 @@ XdxfSettingsDialog::XdxfSettingsDialog(XdxfPlugin *plugin, QWidget *parent) :
     QDialog(parent)
 {
     this->plugin = plugin;
-    verticalLayout = new QVBoxLayout(this);
+    verticalLayout = new QVBoxLayout();
        setLayout(verticalLayout);
 
     setWindowTitle(tr("XDXF Settings"));
@@ -45,18 +45,18 @@ XdxfSettingsDialog::XdxfSettingsDialog(XdxfPlugin *plugin, QWidget *parent) :
 
     verticalLayout->addWidget(infoLabel);
 
-    browseLayout = new QHBoxLayout(this);
+    browseLayout = new QHBoxLayout();
     verticalLayout->addLayout(browseLayout);
 
-    browseButton =  new QPushButton(tr("Browse"),this);
+    browseButton =  new QPushButton(tr("Browse"));
     browseLabel = new QLabel(tr("Dictionary file: ") +
-                             plugin->settings()->value("path"),this);
+                             plugin->settings()->value("path"));
 
     browseLayout->addWidget(browseLabel);
     browseLayout->addWidget(browseButton,0, Qt::AlignRight);
 
 
-    cacheLayout = new QHBoxLayout(this);
+    cacheLayout = new QHBoxLayout();
     verticalLayout->insertLayout(-1,cacheLayout,0);
     accentsCheckBox = new QCheckBox(tr("Strip accents \n(searching takes more time, "
                  "but spelling don't have to be exact)"));
@@ -79,7 +79,7 @@ XdxfSettingsDialog::XdxfSettingsDialog(XdxfPlugin *plugin, QWidget *parent) :
 
     cacheLayout->addWidget(cacheCheckBox);
 
-    saveButton = new QPushButton(tr("Save settings"),this);
+    saveButton = new QPushButton(tr("Save settings"));
 
     verticalLayout->addWidget(saveButton);
 
@@ -146,6 +146,7 @@ Settings* XdxfSettingsDialog::getSettings(XdxfPlugin *plugin,
             settings->setValue("strip_accents", "false");
 
         plugin->setSettings(settings);
+        delete settings;
         return 0;
     }