[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [vidalia/alpha] always create settings access object in VidaliaTab class



commit 5e1d466438e32b8310aebe8d06796555b1046ed1
Author: Sebastian Baginski <sebthestampede@xxxxxxxxx>
Date:   Thu Mar 29 15:09:27 2012 +0200

    always create settings access object in VidaliaTab class
---
 changes/bug5522            |    3 +++
 src/vidalia/VidaliaTab.cpp |   12 +++++++-----
 src/vidalia/VidaliaTab.h   |    2 +-
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/changes/bug5522 b/changes/bug5522
new file mode 100644
index 0000000..091756b
--- /dev/null
+++ b/changes/bug5522
@@ -0,0 +1,3 @@
+  Internal cleanups and improvements:
+  o Always create settings access object, with default section name
+    set to General. Fixes bug 5522.
\ No newline at end of file
diff --git a/src/vidalia/VidaliaTab.cpp b/src/vidalia/VidaliaTab.cpp
index 67bbf0e..959ce07 100644
--- a/src/vidalia/VidaliaTab.cpp
+++ b/src/vidalia/VidaliaTab.cpp
@@ -1,18 +1,20 @@
 #include "VidaliaTab.h"
 #include "Vidalia.h"
 
+/** Default constructor.
+ * \param title Tab title.
+ * \param name Optional group name for settings accessed by this tab.
+ * \param parent Parent widget.
+ */
 VidaliaTab::VidaliaTab(const QString &title, const QString &name, QWidget *parent)
   : QWidget(parent), _title(title)
 {
-  _settings = NULL;
-  if(!name.isEmpty())
-    _settings = new VSettings(name);
+  _settings = new VSettings(name);
 }
 
 VidaliaTab::~VidaliaTab()
 {
-  if(_settings)
-    delete _settings;
+  delete _settings;
 }
 
 /** Gets the saved value of a property associated with this window object.
diff --git a/src/vidalia/VidaliaTab.h b/src/vidalia/VidaliaTab.h
index 8a053dc..8bf151b 100644
--- a/src/vidalia/VidaliaTab.h
+++ b/src/vidalia/VidaliaTab.h
@@ -26,7 +26,7 @@ class VidaliaTab : public QWidget
 
 public:
   /** Default constructor. */
-  VidaliaTab(const QString &title, const QString &name = "", QWidget *parent = 0);
+  VidaliaTab(const QString &title, const QString &name = "General", QWidget *parent = 0);
   /** Destructor. */
   ~VidaliaTab();
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits