author | wimpie <wimpie> | 2004-04-09 18:04:30 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-04-09 18:04:30 (UTC) |
commit | 028717962deec0c2ff0e382221cbc2242393b79e (patch) (unidiff) | |
tree | a5f00a3b3d229f838b6e40e34ca12f248b317813 /inputmethods/dasher/DasherInterface.cpp | |
parent | d17b9f7b64e004dcc301866f8122171218553b42 (diff) | |
download | opie-028717962deec0c2ff0e382221cbc2242393b79e.zip opie-028717962deec0c2ff0e382221cbc2242393b79e.tar.gz opie-028717962deec0c2ff0e382221cbc2242393b79e.tar.bz2 |
Removed warnings about initialization sequence in constructores
and unused variables and arguments
Diffstat (limited to 'inputmethods/dasher/DasherInterface.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/dasher/DasherInterface.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/inputmethods/dasher/DasherInterface.cpp b/inputmethods/dasher/DasherInterface.cpp index bb5b85e..4699687 100644 --- a/inputmethods/dasher/DasherInterface.cpp +++ b/inputmethods/dasher/DasherInterface.cpp | |||
@@ -1,80 +1,97 @@ | |||
1 | // DasherInterface.cpp | 1 | // DasherInterface.cpp |
2 | // | 2 | // |
3 | ///////////////////////////////////////////////////////////////////////////// | 3 | ///////////////////////////////////////////////////////////////////////////// |
4 | // | 4 | // |
5 | // Copyright (c) 2002 Iain Murray | 5 | // Copyright (c) 2002 Iain Murray |
6 | // | 6 | // |
7 | ///////////////////////////////////////////////////////////////////////////// | 7 | ///////////////////////////////////////////////////////////////////////////// |
8 | 8 | ||
9 | 9 | ||
10 | 10 | ||
11 | #include "DasherInterface.h" | 11 | #include "DasherInterface.h" |
12 | //#include "EnglishAlphabet.h" | 12 | //#include "EnglishAlphabet.h" |
13 | #include "CustomAlphabet.h" | 13 | #include "CustomAlphabet.h" |
14 | #include "DasherViewSquare.h" | 14 | #include "DasherViewSquare.h" |
15 | #include "PPMLanguageModel.h" | 15 | #include "PPMLanguageModel.h" |
16 | #include <iostream> | 16 | #include <iostream> |
17 | namespace { | 17 | namespace { |
18 | #include "stdio.h" | 18 | #include "stdio.h" |
19 | } | 19 | } |
20 | using namespace Dasher; | 20 | using namespace Dasher; |
21 | using namespace std; | 21 | using namespace std; |
22 | 22 | ||
23 | 23 | ||
24 | const string CDasherInterface::EmptyString = ""; | 24 | const string CDasherInterface::EmptyString = ""; |
25 | 25 | ||
26 | 26 | ||
27 | CDasherInterface::CDasherInterface() | 27 | CDasherInterface::CDasherInterface() |
28 | : m_DashEditbox(0), m_DasherScreen(0), m_LanguageModel(0), TrainContext(0), m_Alphabet(0), | 28 | : m_Alphabet(0), |
29 | m_DasherModel(0), m_DasherView(0), AlphabetID(""), LanguageModelID(-1), ViewID(-1), | 29 | m_LanguageModel(0), |
30 | m_MaxBitRate(-1), m_Orientation(Opts::LeftToRight), m_SettingsStore(0), m_SettingsUI(0), | 30 | m_DasherModel(0), |
31 | m_UserLocation("usr_"), m_SystemLocation("sys_"), m_AlphIO(0), m_TrainFile(""), | 31 | m_DashEditbox(0), |
32 | m_DasherFont(""), m_EditFont(""), m_EditFontSize(0), m_DrawKeyboard(false) | 32 | m_DasherScreen(0), |
33 | m_DasherView(0), | ||
34 | m_SettingsStore(0), | ||
35 | m_SettingsUI(0), | ||
36 | m_AlphIO(0), | ||
37 | TrainContext(0), | ||
38 | AlphabetID(""), | ||
39 | LanguageModelID(-1), | ||
40 | ViewID(-1), | ||
41 | m_MaxBitRate(-1), | ||
42 | m_DrawKeyboard(false), | ||
43 | m_Orientation(Opts::LeftToRight), | ||
44 | m_UserLocation("usr_"), | ||
45 | m_SystemLocation("sys_"), | ||
46 | m_TrainFile(""), | ||
47 | m_DasherFont(""), | ||
48 | m_EditFont(""), | ||
49 | m_EditFontSize(0) | ||
33 | { | 50 | { |
34 | } | 51 | } |
35 | 52 | ||
36 | 53 | ||
37 | CDasherInterface::~CDasherInterface() | 54 | CDasherInterface::~CDasherInterface() |
38 | { | 55 | { |
39 | if (m_LanguageModel) | 56 | if (m_LanguageModel) |
40 | m_LanguageModel->ReleaseNodeContext(TrainContext); | 57 | m_LanguageModel->ReleaseNodeContext(TrainContext); |
41 | delete m_DasherModel; // The order of some of these deletions matters | 58 | delete m_DasherModel; // The order of some of these deletions matters |
42 | delete m_LanguageModel; // eg DasherModel has a pointer to LanguageModel. | 59 | delete m_LanguageModel; // eg DasherModel has a pointer to LanguageModel. |
43 | delete m_Alphabet; // DM baulks if LM is deleted before it is. | 60 | delete m_Alphabet; // DM baulks if LM is deleted before it is. |
44 | delete m_DasherView; | 61 | delete m_DasherView; |
45 | // Do NOT delete Edit box or Screen. This class did not create them. | 62 | // Do NOT delete Edit box or Screen. This class did not create them. |
46 | } | 63 | } |
47 | 64 | ||
48 | 65 | ||
49 | void CDasherInterface::SetSettingsStore(CSettingsStore* SettingsStore) | 66 | void CDasherInterface::SetSettingsStore(CSettingsStore* SettingsStore) |
50 | { | 67 | { |
51 | delete m_SettingsStore; | 68 | delete m_SettingsStore; |
52 | m_SettingsStore = SettingsStore; | 69 | m_SettingsStore = SettingsStore; |
53 | this->SettingsDefaults(m_SettingsStore); | 70 | this->SettingsDefaults(m_SettingsStore); |
54 | } | 71 | } |
55 | 72 | ||
56 | 73 | ||
57 | void CDasherInterface::SetSettingsUI(CDasherSettingsInterface* SettingsUI) | 74 | void CDasherInterface::SetSettingsUI(CDasherSettingsInterface* SettingsUI) |
58 | { | 75 | { |
59 | delete m_SettingsUI; | 76 | delete m_SettingsUI; |
60 | m_SettingsUI = SettingsUI; | 77 | m_SettingsUI = SettingsUI; |
61 | //this->SettingsDefaults(m_SettingsStore); | 78 | //this->SettingsDefaults(m_SettingsStore); |
62 | m_SettingsUI->SettingsDefaults(m_SettingsStore); | 79 | m_SettingsUI->SettingsDefaults(m_SettingsStore); |
63 | } | 80 | } |
64 | 81 | ||
65 | 82 | ||
66 | void CDasherInterface::SetUserLocation(std::string UserLocation) | 83 | void CDasherInterface::SetUserLocation(std::string UserLocation) |
67 | { | 84 | { |
68 | // Nothing clever updates. (At the moment) it is assumed that | 85 | // Nothing clever updates. (At the moment) it is assumed that |
69 | // this is set before anything much happens and that it does | 86 | // this is set before anything much happens and that it does |
70 | // not require changing. | 87 | // not require changing. |
71 | m_UserLocation = UserLocation; | 88 | m_UserLocation = UserLocation; |
72 | if (m_Alphabet!=0) | 89 | if (m_Alphabet!=0) |
73 | m_TrainFile = m_UserLocation + m_Alphabet->GetTrainingFile(); | 90 | m_TrainFile = m_UserLocation + m_Alphabet->GetTrainingFile(); |
74 | } | 91 | } |
75 | 92 | ||
76 | 93 | ||
77 | void CDasherInterface::SetSystemLocation(std::string SystemLocation) | 94 | void CDasherInterface::SetSystemLocation(std::string SystemLocation) |
78 | { | 95 | { |
79 | // Nothing clever updates. (At the moment) it is assumed that | 96 | // Nothing clever updates. (At the moment) it is assumed that |
80 | // this is set before anything much happens and that it does | 97 | // this is set before anything much happens and that it does |