From: sirakaba Date: Sun, 31 Jul 2011 13:45:50 +0000 (+0000) Subject: wxStandardPathsを自前で確保するのではなく、wx側で用意されたものを用いるよう変更。 X-Git-Tag: 0.01beta14~58 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=1a36b285795e8725d49a1c622488e3723af75615;p=tpi%2Flychee.git wxStandardPathsを自前で確保するのではなく、wx側で用意されたものを用いるよう変更。 git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/tpi/tpi@551 9df91469-1e22-0410-86e7-ea8537beb833 --- diff --git a/src/common/library/xmldoc.h b/src/common/library/xmldoc.h index 95f4d67..f6ed5a4 100644 --- a/src/common/library/xmldoc.h +++ b/src/common/library/xmldoc.h @@ -45,6 +45,5 @@ void MakeFormatInfo(wxXmlNode * n, const wxString & szTPIName, TPI_FORMATINFO * wxString inline myMakeXMLName(const wxString & szFile) { - wxStandardPaths p; - return wxPathOnly(p.GetExecutablePath()) + wxT("/lib/") + szFile + wxT(".xml"); + return wxPathOnly(wxStandardPaths::Get().GetExecutablePath()) + wxT("/lib/") + szFile + wxT(".xml"); } diff --git a/src/lychee/frm_main.cpp b/src/lychee/frm_main.cpp index 1bbe967..6cb4230 100644 --- a/src/lychee/frm_main.cpp +++ b/src/lychee/frm_main.cpp @@ -748,13 +748,12 @@ void MainFrame::OnArcExtract(wxCommandEvent& e) // 作業ディレクトリ作成。 swInfo.fStoreDirectoryPathes = false; wxString szDestDirBase = nMode == 3 ? this->tree_ctrl->GetItemText(this->tree_ctrl->GetSelection()) : wxT("tpi_tmp"); - wxStandardPaths p; if (szDestDirBase == wxT("-----")) { // 書庫ルートのときは書庫名にしておく。 szDestDirBase = this->fnArchive.GetName(); } - swInfo.fnDestinationDirectory = MakeDirPath(wxFileName::DirName(p.GetTempDir()), szDestDirBase, true); + swInfo.fnDestinationDirectory = MakeDirPath(wxFileName::DirName(wxStandardPaths::Get().GetTempDir()), szDestDirBase, true); if (! swInfo.fnDestinationDirectory.IsOk()) { wxLogError(_("Unable to make the temporary directory!")); diff --git a/src/lychee/lychee.cpp b/src/lychee/lychee.cpp index 32f90ef..4c7d416 100644 --- a/src/lychee/lychee.cpp +++ b/src/lychee/lychee.cpp @@ -39,8 +39,7 @@ bool Lychee::OnInit() { wxChar cSep = wxFileName::GetPathSeparator(); szCwd = ::wxGetCwd() + cSep; - wxStandardPaths p; - ::wxSetWorkingDirectory(::wxPathOnly(p.GetExecutablePath()) + cSep); + ::wxSetWorkingDirectory(::wxPathOnly(wxStandardPaths::Get().GetExecutablePath()) + cSep); } // 言語ファイルのパスを指定。 diff --git a/src/plugin/spiLibrary/spiLibrary.cpp b/src/plugin/spiLibrary/spiLibrary.cpp index 7171ded..0bc6f5a 100644 --- a/src/plugin/spiLibrary/spiLibrary.cpp +++ b/src/plugin/spiLibrary/spiLibrary.cpp @@ -137,8 +137,7 @@ int __stdcall LoadPlugin } hFile.Close(); - wxStandardPaths p; - wxString szSPIPath = wxPathOnly(p.GetExecutablePath()) + wxT("/lib/"), szSPIName; + wxString szSPIPath = wxPathOnly(wxStandardPaths::Get().GetExecutablePath()) + wxT("/lib/"), szSPIName; wxDir fs(szSPIPath); if (fs.GetFirst(& szSPIName, wxT("*.spi"))) { diff --git a/src/plugin/xpiLibrary/xpiLibrary.cpp b/src/plugin/xpiLibrary/xpiLibrary.cpp index 80e2566..8d5846f 100644 --- a/src/plugin/xpiLibrary/xpiLibrary.cpp +++ b/src/plugin/xpiLibrary/xpiLibrary.cpp @@ -142,8 +142,7 @@ int __stdcall LoadPlugin } hFile.Close(); - wxStandardPaths p; - wxString szSPIPath = wxPathOnly(p.GetExecutablePath()) + wxT("/lib/"), szSPIName; + wxString szSPIPath = wxPathOnly(wxStandardPaths::Get().GetExecutablePath()) + wxT("/lib/"), szSPIName; wxDir fs(szSPIPath); if (fs.GetFirst(& szSPIName, wxT("*.spi"))) { @@ -231,8 +230,7 @@ int __stdcall GetFileInformation static wxDir fs; if (_bFirst) { - wxStandardPaths p; - szXPIPath = wxPathOnly(p.GetExecutablePath()) + wxT("/lib/"); + szXPIPath = wxPathOnly(wxStandardPaths::Get().GetExecutablePath()) + wxT("/lib/"); fs.Open(szXPIPath); // 画像の情報を取得。 @@ -404,12 +402,7 @@ int __stdcall Command return nErrorCode; } - wxString szXPIPath; - { - wxStandardPaths p; - szXPIPath = wxPathOnly(p.GetExecutablePath()) + wxT("/lib/"); - } - + wxString szXPIPath = wxPathOnly(wxStandardPaths::Get().GetExecutablePath()) + wxT("/lib/"); for (size_t i = 0; i < _asFiles.GetCount(); i++) { // 処理を行うか確認。