From fdb6b63a3a7810a52ac9c03465b02b96eb782f96 Mon Sep 17 00:00:00 2001 From: "dougt%meer.net" Date: Tue, 18 Apr 2006 21:06:51 +0000 Subject: [PATCH] Fixing crash when no profile directory exists. --- minimo/base/Makefile.in | 1 + minimo/base/Minimo.cpp | 12 ++++++++++++ minimo/base/MinimoPrivate.h | 1 + minimo/base/WindowCreator.cpp | 2 +- minimo/base/wince/Makefile.in | 3 +++ 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/minimo/base/Makefile.in b/minimo/base/Makefile.in index 9289763c9ef0..fa283fd3ba57 100755 --- a/minimo/base/Makefile.in +++ b/minimo/base/Makefile.in @@ -83,6 +83,7 @@ REQUIRES = xpcom \ phone \ js \ imglib2 \ + toolkitcomps \ $(NULL) CPPSRCS = Minimo.cpp \ diff --git a/minimo/base/Minimo.cpp b/minimo/base/Minimo.cpp index c7f20735f876..ab1641eac8b0 100755 --- a/minimo/base/Minimo.cpp +++ b/minimo/base/Minimo.cpp @@ -470,10 +470,14 @@ nsresult StartupProfile() if (NS_FAILED(rv)) return rv; + appDataDir->Create(nsIFile::DIRECTORY_TYPE, 0700); + rv = appDataDir->Append(NS_LITERAL_STRING("minimo")); if (NS_FAILED(rv)) return rv; + appDataDir->Create(nsIFile::DIRECTORY_TYPE, 0700); + nsCOMPtr localAppDataDir(do_QueryInterface(appDataDir)); nsCOMPtr locProvider; @@ -704,6 +708,14 @@ int main(int argc, char *argv[]) return 1; } + nsCOMPtr cmdLine = do_CreateInstance("@mozilla.org/toolkit/command-line;1"); + + nsCOMPtr workingDir; + NS_GetSpecialDirectory(NS_OS_CURRENT_WORKING_DIR, getter_AddRefs(workingDir)); + + if (cmdLine) + cmdLine->Init(argc, argv, workingDir, nsICommandLine::STATE_INITIAL_LAUNCH); + appShell->Create(nsnull, nsnull); ApplicationObserver *appObserver = new ApplicationObserver(appShell); diff --git a/minimo/base/MinimoPrivate.h b/minimo/base/MinimoPrivate.h index 789dd8559c20..c79f06a00051 100755 --- a/minimo/base/MinimoPrivate.h +++ b/minimo/base/MinimoPrivate.h @@ -61,6 +61,7 @@ #include "nsIAppStartupNotifier.h" #include "nsIBadCertListener.h" #include "nsIClipboardCommands.h" +#include "nsICommandLineRunner.h" #include "nsIComponentRegistrar.h" #include "nsIDOMWindow.h" #include "nsIEventQueueService.h" diff --git a/minimo/base/WindowCreator.cpp b/minimo/base/WindowCreator.cpp index a5edd6260afb..2edc58df7a9b 100755 --- a/minimo/base/WindowCreator.cpp +++ b/minimo/base/WindowCreator.cpp @@ -83,7 +83,7 @@ WindowCreator::CreateChromeWindow2(nsIWebBrowserChrome *aParent, nsCOMPtr xulParent(do_GetInterface(aParent)); - appShell->CreateTopLevelWindow(xulParent, // get rid of if you undef above + appShell->CreateTopLevelWindow(xulParent, 0, aChromeFlags, x, diff --git a/minimo/base/wince/Makefile.in b/minimo/base/wince/Makefile.in index 51e19d8cff0d..9534521e137e 100755 --- a/minimo/base/wince/Makefile.in +++ b/minimo/base/wince/Makefile.in @@ -56,5 +56,8 @@ include $(topsrcdir)/config/config.mk LOCAL_INCLUDES += -I$(srcdir)/. OS_LIBS += $(call EXPAND_LIBNAME, aygshell cellcore uuid ole32 oleaut32) +# default size is 1mb which is way to much for this app. +LDFLAGS += -STACK:65536 + include $(topsrcdir)/config/rules.mk