svnno****@sourc*****
svnno****@sourc*****
Thu Feb 28 12:58:41 JST 2008
Revision: 3410 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3410 Author: ikezoe Date: 2008-02-28 12:58:41 +0900 (Thu, 28 Feb 2008) Log Message: ----------- 2008-02-28 Hiroyuki Ikezoe <poinc****@ikezo*****> * module/embed/gecko/kz-mozlauncher.cpp: The directory which is already used stores as nsEmbedCString instead of char*. Modified Paths: -------------- kazehakase/trunk/ChangeLog kazehakase/trunk/module/embed/gecko/kz-mozlauncher.cpp Modified: kazehakase/trunk/ChangeLog =================================================================== --- kazehakase/trunk/ChangeLog 2008-02-27 11:18:53 UTC (rev 3409) +++ kazehakase/trunk/ChangeLog 2008-02-28 03:58:41 UTC (rev 3410) @@ -1,3 +1,8 @@ +2008-02-28 Hiroyuki Ikezoe <poinc****@ikezo*****> + + * module/embed/gecko/kz-mozlauncher.cpp: The directory which is + already used stores as nsEmbedCString instead of char*. + 2008-02-27 Hiroyuki Ikezoe <poinc****@ikezo*****> * module/embed/gecko/mozilla.cpp: return TRUE! Modified: kazehakase/trunk/module/embed/gecko/kz-mozlauncher.cpp =================================================================== --- kazehakase/trunk/module/embed/gecko/kz-mozlauncher.cpp 2008-02-27 11:18:53 UTC (rev 3409) +++ kazehakase/trunk/module/embed/gecko/kz-mozlauncher.cpp 2008-02-28 03:58:41 UTC (rev 3410) @@ -98,13 +98,13 @@ do_QueryInterface(aWindowContext); nsCOMPtr<nsILocalFile> saveDir; - static char *dirName = NULL; + static nsEmbedCString dirName; - if (!dirName) - dirName = g_strdup(g_get_home_dir()); + if (dirName.IsEmpty()) + dirName.Assign(g_get_home_dir()); saveDir = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID); - saveDir->InitWithNativePath(nsEmbedCString(dirName)); + saveDir->InitWithNativePath(dirName); nsCOMPtr <nsILocalFile> saveFile(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID)); @@ -139,16 +139,8 @@ { filePicker->GetFile(getter_AddRefs(saveFile)); - nsEmbedString uFileName; - saveFile->GetPath(uFileName); - nsEmbedCString cFileName; + saveFile->GetNativePath(dirName); - NS_UTF16ToCString(uFileName, - NS_CSTRING_ENCODING_UTF8, cFileName); - - g_free(dirName); - dirName = g_path_get_dirname(cFileName.get()); - nsCOMPtr<nsIFile> directory; rv = saveFile->GetParent(getter_AddRefs(directory));