X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Flychee%2Ffrm_main.cpp;h=3962438f4d7607ba4779f4852205df9248e7b4d8;hb=b4a642b33db5df1bb2661b53144508b78390d527;hp=5bc0586f8c40ae88825bd4a16c3fef35d39cd8e2;hpb=17ba46aecbd3640e2dc0061051e7e36bb89e6256;p=tpi%2Flychee.git diff --git a/src/lychee/frm_main.cpp b/src/lychee/frm_main.cpp index 5bc0586..3962438 100644 --- a/src/lychee/frm_main.cpp +++ b/src/lychee/frm_main.cpp @@ -45,7 +45,7 @@ bool g_fSortAscend; // MainFrame //****************************************************************************** -MainFrame::MainFrame(): wxFrame(), gFrame(NULL) +MainFrame::MainFrame(): wxFrame(), gFrame(nullptr) { } @@ -210,7 +210,7 @@ void MainFrame::OnInit(wxInitDialogEvent&) void MainFrame::OnClose(wxCloseEvent& e) { - if (e.CanVeto() && g_procDlg != NULL) + if (e.CanVeto() && g_procDlg != nullptr) { g_procDlg->OnClose(e); e.Veto(); @@ -224,7 +224,7 @@ void MainFrame::OnClose(wxCloseEvent& e) void MainFrame::OnSize(wxSizeEvent& e) { // プログレスバーの位置を変更。 - if (this->gFrame != NULL) + if (this->gFrame != nullptr) { this->gFrame->SetPosition(wxPoint(this->statusbar->GetSize().GetWidth() - 230, 10)); } @@ -241,11 +241,11 @@ void MainFrame::OnExit(wxCommandEvent&) void MainFrame::OnArcCreate(wxCommandEvent& e) { TPI_SWITCHES swInfo; - swInfo.pCustomSwitches = NULL; + swInfo.pCustomSwitches = nullptr; // 作成ダイアログを設定。 MakeDialog mkDlg(this, TPI_COMMAND_CREATE); - if (e.GetClientData() == NULL) + if (e.GetClientData() == nullptr) { if (::wxGetKeyState(WXK_SHIFT)) { @@ -686,9 +686,9 @@ void MainFrame::OnArcAdd(wxCommandEvent& e) MakeDialog mkDlg(this, TPI_COMMAND_ADD); TPI_SWITCHES swInfo; - swInfo.pCustomSwitches = NULL; + swInfo.pCustomSwitches = nullptr; - if (e.GetClientData() == NULL) + if (e.GetClientData() == nullptr) { if (::wxGetKeyState(WXK_SHIFT)) { @@ -802,7 +802,7 @@ void MainFrame::OnArcExtract(wxCommandEvent& e) { TPI_SWITCHES swInfo; swInfo.szArcName = this->fnArchive.GetFullPath(); - swInfo.pCustomSwitches = NULL; + swInfo.pCustomSwitches = nullptr; swInfo.szPassword = this->szPassword; // モード取得。通常は0, 実行なら1, ファイルDnDなら2、ディレクトリDnDなら3、クリップボードなら4、コンテキストメニューからなら8。 @@ -812,7 +812,7 @@ void MainFrame::OnArcExtract(wxCommandEvent& e) nMode = 0; } // 実行時のみ使用。 - wxFileType * ftFile = NULL; + wxFileType * ftFile = nullptr; // 展開ダイアログを作成。DnDまたは実行時は表示しない。 MakeDialog mkDlg(this, TPI_COMMAND_EXTRACT); @@ -906,13 +906,13 @@ void MainFrame::OnArcExtract(wxCommandEvent& e) // コマンドを実行。 wxString szTempFile = swInfo.fnDestinationDirectory.GetPathWithSep() + wxFileName(mkDlg.files[0], wxPATH_DOS).GetFullName(); - bool fSuccess = tpi.nErrorCode == TPI_ERROR_SUCCESS && ftFile != NULL; - myProcess * pCallback = new myProcess(szTempFile, swInfo.fnDestinationDirectory.GetPath()); + bool fSuccess = tpi.nErrorCode == TPI_ERROR_SUCCESS && ftFile != nullptr; + auto pCallback = new myProcess(szTempFile, swInfo.fnDestinationDirectory.GetPath()); if (fSuccess) { #ifdef __LINUX__ // Linuxでは引用符で囲む必要がある。 - fSuccess = ::wxExecute(ftFile->GetOpenCommand(QuoteString(szTempFile)), wxEXEC_ASYNC, pCallback) > 0; + fSuccess = ::wxExecute(wxT("xdg-open ") + QuoteString(szTempFile), wxEXEC_ASYNC, pCallback) > 0; #else fSuccess = ::wxExecute(ftFile->GetOpenCommand(szTempFile), wxEXEC_ASYNC, pCallback) > 0; #endif @@ -926,7 +926,7 @@ void MainFrame::OnArcExtract(wxCommandEvent& e) { // 展開対象を決定。 wxArrayString asFiles; - myFileDataObject * objFile = new myFileDataObject(); + auto objFile = new myFileDataObject(); objFile->szTempDir = nMode == 3 ? swInfo.fnDestinationDirectory.GetPath() : swInfo.fnDestinationDirectory.GetFullPath(); // for (auto s : mkDlg.files) for (size_t n = 0; n < mkDlg.files.GetCount(); n++) @@ -955,7 +955,7 @@ void MainFrame::OnArcExtract(wxCommandEvent& e) else { // 自身にドロップされると煩雑なので、一時的にドロップを受け付けないようにしておく。 - this->SetDropTarget(NULL); + this->SetDropTarget(nullptr); // DnD開始。 wxDropSource dropSource(* objFile, this);