From: sirakaba Date: Mon, 20 Sep 2010 11:15:09 +0000 (+0000) Subject: 空白の入ったパスがDolphinで開けなかったバグを修正。 X-Git-Tag: 0.01beta8~45 X-Git-Url: http://git.osdn.net/view?p=tpi%2Flychee.git;a=commitdiff_plain;h=45324b398c3ae6fa41989b2418a74f560d636c20 空白の入ったパスがDolphinで開けなかったバグを修正。 git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/tpi/tpi@323 9df91469-1e22-0410-86e7-ea8537beb833 --- diff --git a/src/lychee/frm_main.cpp b/src/lychee/frm_main.cpp index 1cb8112..fb6c6c8 100644 --- a/src/lychee/frm_main.cpp +++ b/src/lychee/frm_main.cpp @@ -294,7 +294,7 @@ void MainFrame::OnArcCreate(wxCommandEvent& e) if (mkDlg.cbOpenAfter->IsChecked()) { // 作成先を開く。 - ::wxExecute(DIR_APP + swInfo.fnDestinationDirectory.GetFullPath()); + ::wxExecute(DIR_APP + QuoteString(swInfo.fnDestinationDirectory.GetFullPath())); } if (mkDlg.cbExitAfter->IsChecked()) @@ -582,7 +582,7 @@ void MainFrame::OnArcAdd(wxCommandEvent& e) if (mkDlg.cbOpenAfter->IsChecked()) { // 作成先を開く。 - ::wxExecute(DIR_APP + swInfo.fnDestinationDirectory.GetFullPath()); + ::wxExecute(DIR_APP + QuoteString(swInfo.fnDestinationDirectory.GetFullPath())); } if (mkDlg.cbExitAfter->IsChecked()) @@ -719,7 +719,7 @@ void MainFrame::OnArcExtract(wxCommandEvent& e) if (mkDlg.cbOpenAfter->IsChecked()) { // 展開先を開く。 - ::wxExecute(DIR_APP + swInfo.fnDestinationDirectory.GetFullPath()); + ::wxExecute(DIR_APP + QuoteString(swInfo.fnDestinationDirectory.GetFullPath())); } if (mkDlg.cbExitAfter->IsChecked()) @@ -739,7 +739,7 @@ void MainFrame::OnArcExtract(wxCommandEvent& e) { #ifdef __LINUX__ // Linuxでは引用符で囲む必要がある。 - ::wxExecute(ftFile->GetOpenCommand(wxT('"') + asFiles[0] + wxT('"')), wxEXEC_SYNC); + ::wxExecute(ftFile->GetOpenCommand(QuoteString(asFiles[0])), wxEXEC_SYNC); #else ::wxExecute(ftFile->GetOpenCommand(asFiles[0]), wxEXEC_SYNC); #endif diff --git a/src/lychee/functions.cpp b/src/lychee/functions.cpp index ca5e2b3..8d8dcef 100644 --- a/src/lychee/functions.cpp +++ b/src/lychee/functions.cpp @@ -254,3 +254,8 @@ wxIcon GetFileTypeIcon(wxFileName fn) } return icon; } + +wxString QuoteString(wxString s) +{ + return wxT('"') + s + wxT('"'); +} diff --git a/src/lychee/functions.h b/src/lychee/functions.h index 26ad2ae..e8564e8 100644 --- a/src/lychee/functions.h +++ b/src/lychee/functions.h @@ -38,5 +38,6 @@ wxArrayString MakeTargetFileList(MainFrame *, bool); bool WillMakeDirByArcName(MainFrame *, MakeDialog *); wxString GetFileTypeName(wxFileName); wxIcon GetFileTypeIcon(wxFileName); +wxString QuoteString(wxString); #endif