aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2016-01-24 03:19:59 +0100
committerJohannes Schickel2016-01-24 03:19:59 +0100
commitc72d95cbcc81d4a9f2a51f7147e1d805c46e0d82 (patch)
treefc322668f3b93c6d030e38fe816f370bcea82965
parent144765827fdfe459bd82be34661a51ffec415944 (diff)
downloadscummvm-rg350-c72d95cbcc81d4a9f2a51f7147e1d805c46e0d82.tar.gz
scummvm-rg350-c72d95cbcc81d4a9f2a51f7147e1d805c46e0d82.tar.bz2
scummvm-rg350-c72d95cbcc81d4a9f2a51f7147e1d805c46e0d82.zip
GUI: Add constructor instead of duplicating initialization.
-rw-r--r--gui/predictivedialog.cpp17
-rw-r--r--gui/predictivedialog.h2
2 files changed, 2 insertions, 17 deletions
diff --git a/gui/predictivedialog.cpp b/gui/predictivedialog.cpp
index 06dcd6750b..627e6c1b96 100644
--- a/gui/predictivedialog.cpp
+++ b/gui/predictivedialog.cpp
@@ -105,18 +105,9 @@ PredictiveDialog::PredictiveDialog() : Dialog("Predictive") {
_predictiveDict.nameDict = "predictive_dictionary";
_predictiveDict.defaultFilename = "pred.dic";
- _predictiveDict.dictActLine = NULL;
_userDict.nameDict = "user_dictionary";
_userDict.defaultFilename = "user.dic";
- _userDict.dictActLine = NULL;
-
- _unitedDict.nameDict = "";
- _unitedDict.defaultFilename = "";
-
- _predictiveDict.dictLine = NULL;
- _predictiveDict.dictText = NULL;
- _predictiveDict.dictLineCount = 0;
if (!_predictiveDict.dictText) {
loadAllDictionary(_predictiveDict);
@@ -124,11 +115,6 @@ PredictiveDialog::PredictiveDialog() : Dialog("Predictive") {
debug(5, "Predictive Dialog: pred.dic not loaded");
}
- _userDict.dictLine = NULL;
- _userDict.dictText = NULL;
- _userDict.dictTextSize = 0;
- _userDict.dictLineCount = 0;
-
if (!_userDict.dictText) {
loadAllDictionary(_userDict);
if (!_userDict.dictText)
@@ -137,9 +123,6 @@ PredictiveDialog::PredictiveDialog() : Dialog("Predictive") {
mergeDicts();
- _unitedDict.dictActLine = NULL;
- _unitedDict.dictText = NULL;
-
memset(_repeatcount, 0, sizeof(_repeatcount));
_prefix.clear();
diff --git a/gui/predictivedialog.h b/gui/predictivedialog.h
index 9074089f1f..a7b7b993cc 100644
--- a/gui/predictivedialog.h
+++ b/gui/predictivedialog.h
@@ -78,6 +78,8 @@ public:
const char *getResult() const { return _predictiveResult; }
private:
struct Dict {
+ Dict() : dictLine(nullptr), dictText(nullptr), dictActLine(nullptr),
+ dictLineCount(0), dictTextSize(0) {}
char **dictLine;
char *dictText;
char *dictActLine; // using only for united dict...