OSDN Git Service

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