* fixed Mail startup, it would not open a window because of an uninitialized

variable (#1459)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22200 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2007-09-08 15:15:32 +00:00
parent 53d9356e96
commit 13310304ea
+9 -13
View File
@@ -116,6 +116,7 @@ TMailApp::TMailApp()
fSigWindow(NULL), fSigWindow(NULL),
fPrintSettings(NULL), fPrintSettings(NULL),
fPrintHelpAndExit(false),
fWrapMode(true), fWrapMode(true),
fShowHeader(false), fShowHeader(false),
@@ -504,11 +505,10 @@ TMailApp::ReadyToRun()
dataPath.Append("words"); dataPath.Append("words");
// Only Load if Words Dictionary // Only Load if Words Dictionary
if (BEntry(kWordsPath).Exists() || BEntry(dataPath.Path()).Exists()) if (BEntry(kWordsPath).Exists() || BEntry(dataPath.Path()).Exists()) {
{ // If "/boot/optional/goodies/words" exists but there is no
// If "/boot/optional/goodies/words" exists but there is no system dictionary, copy words // system dictionary, copy words
if (!BEntry(dataPath.Path()).Exists() && BEntry(kWordsPath).Exists()) if (!BEntry(dataPath.Path()).Exists() && BEntry(kWordsPath).Exists()) {
{
BFile words(kWordsPath, B_READ_ONLY); BFile words(kWordsPath, B_READ_ONLY);
BFile copy(dataPath.Path(), B_WRITE_ONLY | B_CREATE_FILE); BFile copy(dataPath.Path(), B_WRITE_ONLY | B_CREATE_FILE);
char buffer[4096]; char buffer[4096];
@@ -522,8 +522,7 @@ TMailApp::ReadyToRun()
// Create user dictionary if it does not exist // Create user dictionary if it does not exist
dataPath = dictionaryDir; dataPath = dictionaryDir;
dataPath.Append("user"); dataPath.Append("user");
if (!BEntry(dataPath.Path()).Exists()) if (!BEntry(dataPath.Path()).Exists()) {
{
BFile user(dataPath.Path(), B_WRITE_ONLY | B_CREATE_FILE); BFile user(dataPath.Path(), B_WRITE_ONLY | B_CREATE_FILE);
BNodeInfo(&user).SetType("text/plain"); BNodeInfo(&user).SetType("text/plain");
} }
@@ -535,13 +534,11 @@ TMailApp::ReadyToRun()
gUserDict = -1; gUserDict = -1;
while (gDictCount < MAX_DICTIONARIES while (gDictCount < MAX_DICTIONARIES
&& directory.GetNextEntry(&entry) != B_ENTRY_NOT_FOUND) && directory.GetNextEntry(&entry) != B_ENTRY_NOT_FOUND) {
{
dataPath.SetTo(&entry); dataPath.SetTo(&entry);
// Identify the user dictionary // Identify the user dictionary
if (strcmp("user", dataPath.Leaf()) == 0) if (strcmp("user", dataPath.Leaf()) == 0) {
{
gUserDictFile = new BFile(dataPath.Path(), B_WRITE_ONLY | B_OPEN_AT_END); gUserDictFile = new BFile(dataPath.Path(), B_WRITE_ONLY | B_OPEN_AT_END);
gUserDict = gDictCount; gUserDict = gDictCount;
} }
@@ -563,8 +560,7 @@ TMailApp::ReadyToRun()
// Create a new window if starting up without any extra arguments. // Create a new window if starting up without any extra arguments.
if (!fPrintHelpAndExit && !fWindowCount) if (!fPrintHelpAndExit && !fWindowCount) {
{
TMailWindow *window; TMailWindow *window;
window = NewWindow(); window = NewWindow();
window->Show(); window->Show();