OSDN Git Service

C++11のauto, nullptrを導入。
[tpi/lychee.git] / src / lychee / frm_main.cpp
index 52134ce..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
@@ -82,7 +82,7 @@ MainFrame::~MainFrame()
                this->conf.WriteId(CONF_LISTVIEW_C_PACKED,   this->list_ctrl->GetColumnWidth(2));\r
                this->conf.WriteId(CONF_LISTVIEW_C_RATIO,    this->list_ctrl->GetColumnWidth(3));\r
                this->conf.WriteId(CONF_LISTVIEW_C_METHOD,   this->list_ctrl->GetColumnWidth(4));\r
-               this->conf.WriteId(CONF_LISTVIEW_C_ATTR,         this->list_ctrl->GetColumnWidth(5));\r
+               this->conf.WriteId(CONF_LISTVIEW_C_ATTR,     this->list_ctrl->GetColumnWidth(5));\r
                this->conf.WriteId(CONF_LISTVIEW_C_LASTMOD,  this->list_ctrl->GetColumnWidth(6));\r
                this->conf.WriteId(CONF_LISTVIEW_C_PATH,     this->list_ctrl->GetColumnWidth(7));\r
                this->conf.WriteId(CONF_LISTVIEW_C_TYPE,     this->list_ctrl->GetColumnWidth(8));\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
@@ -277,11 +277,13 @@ void MainFrame::OnArcCreate(wxCommandEvent& e)
                mkDlg.files = * (wxArrayString *) e.GetClientData();\r
                swInfo.fnDestinationDirectory = wxFileName::DirName(wxFileName(mkDlg.files[0]).GetPath());\r
                // 相対パスに変換。\r
+//             for (auto s : mkDlg.files)\r
                for (size_t n = 0; n < mkDlg.files.GetCount(); n++)\r
                {\r
-                       wxFileName fn(mkDlg.files[n]);\r
+                       wxString & s = mkDlg.files[n];\r
+                       wxFileName fn(s);\r
                        fn.MakeRelativeTo(swInfo.fnDestinationDirectory.GetPath());\r
-                       mkDlg.files[n] = fn.GetFullPath();\r
+                       s = fn.GetFullPath();\r
                }\r
        }\r
 \r
@@ -432,7 +434,7 @@ void MainFrame::OnArcOpen(wxCommandEvent& e)
                idArcRoot = this->tree_ctrl->AppendItem(idRoot, wxT("-----"), 0, 1);\r
 \r
        // 巨大書庫のときにファイル名検査を省略するか。\r
-       bool bDTVCheck = piInfo.fiInfo.nUnpackedSize < 10000 || AskDlg(_("This archive contains so many files that it takes long to check Directory Traversal Vulnerability(DTV) problem. If you are sure this archive is safe, you can skip this scanning process. Do you want to scan for DTV problem?"), this) == wxNO;\r
+       bool bDTVCheck = true;//piInfo.fiInfo.nUnpackedSize < 10000 || AskDlg(_("This archive contains so many files that it takes long to check Directory Traversal Vulnerability(DTV) problem. If you are sure this archive is safe, you can skip this scanning process. Do you want to scan for DTV problem?"), this) == wxNO;\r
 \r
        // ファイル情報をロード。\r
        if (tpi.GetFileInformation(& piInfo.fiInfo, true))\r
@@ -451,93 +453,98 @@ void MainFrame::OnArcOpen(wxCommandEvent& e)
                                return;\r
                        }\r
 \r
-                       // 拡張子のみ設定されている場合。\r
-                       if (piInfo.fiInfo.szStoredName.IsEmpty())\r
-                       {\r
-                               piInfo.fiInfo.szStoredName = this->fnArchive.GetName();\r
-                               if (piInfo.fiInfo.fnFileName.HasExt())\r
-                               {\r
-                                       piInfo.fiInfo.szStoredName += wxT('.') + piInfo.fiInfo.fnFileName.GetExt();\r
-                               }\r
-                               piInfo.fiInfo.fnFileName = wxFileName(piInfo.fiInfo.szStoredName);\r
-                       }\r
+                       // 情報を保存してカウントアップ。\r
+                       this->fileinfo.Add(piInfo.fiInfo);\r
+               }\r
+               while (tpi.GetFileInformation(& piInfo.fiInfo));\r
+       }\r
+\r
+       // GetFileInformationがエラー終了した場合。\r
+       this->ErrorCheck(tpi.nErrorCode, wxT("GetFileInformation"));\r
 \r
-                       // セキュリティチェック。\r
-                       // ルート記号を削除。\r
-                       wxString szPath = piInfo.fiInfo.fnFileName.GetPathWithSep(wxPATH_UNIX);\r
-                       if (szPath.StartsWith(wxT("/")) || szPath.StartsWith(wxT("./")))\r
+//     for (auto f : this->fileinfo)\r
+       for (size_t i = 0; i < this->fileinfo.GetCount(); i++)\r
+       {\r
+               TPI_FILEINFO & f = this->fileinfo[i];\r
+               // 拡張子のみ設定されている場合。\r
+               if (f.szStoredName.IsEmpty())\r
+               {\r
+                       f.szStoredName = this->fnArchive.GetName();\r
+                       if (f.fnFileName.HasExt())\r
                        {\r
-                               piInfo.fiInfo.fnFileName = wxFileName(szPath.AfterFirst(wxT('/')), piInfo.fiInfo.fnFileName.GetFullName(), wxPATH_DOS);\r
+                               f.szStoredName += wxT('.') + f.fnFileName.GetExt();\r
                        }\r
-                       // ルートメンバの情報は無視する。\r
-                       if (piInfo.fiInfo.fnFileName.GetFullPath().IsEmpty() || piInfo.fiInfo.fnFileName.GetFullPath() == wxT("."))\r
+                       f.fnFileName = wxFileName(f.szStoredName);\r
+               }\r
+\r
+               // セキュリティチェック。\r
+               // ルート記号を削除。\r
+               wxString szPath = f.fnFileName.GetPathWithSep(wxPATH_UNIX);\r
+               if (szPath.StartsWith(wxT("/")) || szPath.StartsWith(wxT("./")))\r
+               {\r
+                       f.fnFileName = wxFileName(szPath.AfterFirst(wxT('/')), f.fnFileName.GetFullName(), wxPATH_DOS);\r
+               }\r
+               // ルートメンバの情報は無視する。\r
+               if (f.fnFileName.GetFullPath().IsEmpty() || f.fnFileName.GetFullPath() == wxT("."))\r
+               {\r
+                       continue;\r
+               }\r
+\r
+               // 改行文字/タブ文字などを削除。\r
+               if (f.szStoredName.Find(wxT('\r')) != wxNOT_FOUND\r
+               ||  f.szStoredName.Find(wxT('\n')) != wxNOT_FOUND\r
+               ||  f.szStoredName.Find(wxT('\t')) != wxNOT_FOUND)\r
+               {\r
+                       wxString sz = f.fnFileName.GetFullPath();\r
+                       sz.Replace(wxT("\r"), wxT(" "));\r
+                       sz.Replace(wxT("\n"), wxT(" "));\r
+                       sz.Replace(wxT("\t"), wxT(" "));\r
+                       f.eDanger = TRUE;\r
+                       f.fnFileName = wxFileName(sz);\r
+                       wxLogWarning(_("This archive may contain files whose name contains some special characters like CR(\\r), LF(\\n), Tab(\\t) and some problem would be happen if you extract these files. Don\'t extract these files carelessly.\nDanger file is:\n%s"), f.fnFileName.GetFullPath().c_str());\r
+               }\r
+\r
+               if (bDTVCheck)\r
+               {\r
+                       // DTV検査。\r
+                       if (f.fnFileName.GetPathWithSep(wxPATH_UNIX).Find(wxT("../")) != wxNOT_FOUND)\r
                        {\r
-                               continue;\r
+                               f.eDanger = TRUE;\r
+                               wxLogWarning(_("This archive may have Directory Traversal Vulnerability(DTV) problem, and some danger files may be extracted to the unexpected system directory! You should use the \"Ignore file pathes\" option when extracting this archive.\nDanger file is:\n%s"), f.fnFileName.GetFullPath().c_str());\r
                        }\r
-\r
-                       // 改行文字/タブ文字などを削除。\r
-                       if (piInfo.fiInfo.szStoredName.Find(wxT('\r')) != wxNOT_FOUND\r
-                       ||  piInfo.fiInfo.szStoredName.Find(wxT('\n')) != wxNOT_FOUND\r
-                       ||  piInfo.fiInfo.szStoredName.Find(wxT('\t')) != wxNOT_FOUND)\r
+                       // 空白の連続による拡張子偽装を検査。\r
+                       if (f.fnFileName.GetFullName().Find(wxT("        ")) != wxNOT_FOUND)\r
                        {\r
-                               wxString sz = piInfo.fiInfo.fnFileName.GetFullPath();\r
-                               sz.Replace(wxT("\r"), wxT(" "));\r
-                               sz.Replace(wxT("\n"), wxT(" "));\r
-                               sz.Replace(wxT("\t"), wxT(" "));\r
-                               piInfo.fiInfo.eDanger = TRUE;\r
-                               piInfo.fiInfo.fnFileName = wxFileName(sz);\r
-                               wxLogWarning(_("This archive may contain files whose name contains some special characters like CR(\\r), LF(\\n), Tab(\\t) and some problem would be happen if you extract these files. Don\'t extract these files carelessly.\nDanger file is:\n%s"), piInfo.fiInfo.fnFileName.GetFullPath().c_str());\r
+                               f.eDanger = TRUE;\r
+                               wxLogWarning(_("This archive may contain extension-disguised files whose real extension is hidden by using many blank charactor and you may mistake that it is a \"safe\" file. Don\'t execute these files carelessly.\nDanger file is:\n%s"), f.fnFileName.GetFullPath().c_str());\r
                        }\r
-\r
-                       if (bDTVCheck)\r
+                       // Unicode制御文字を検査。\r
+                       for (wxChar c = 0x200c; c <= 0x206f; c++)\r
                        {\r
-                               // DTV検査。\r
-                               if (piInfo.fiInfo.fnFileName.GetPathWithSep(wxPATH_UNIX).Find(wxT("../")) != wxNOT_FOUND)\r
-                               {\r
-                                       piInfo.fiInfo.eDanger = TRUE;\r
-                                       wxLogWarning(_("This archive may have Directory Traversal Vulnerability(DTV) problem, and some danger files may be extracted to the unexpected system directory! You should use the \"Ignore file pathes\" option when extracting this archive.\nDanger file is:\n%s"), piInfo.fiInfo.fnFileName.GetFullPath().c_str());\r
-                               }\r
-                               // 空白の連続による拡張子偽装を検査。\r
-                               if (piInfo.fiInfo.fnFileName.GetFullName().Find(wxT("        ")) != wxNOT_FOUND)\r
+                               if (f.fnFileName.GetFullName().Find(c) != wxNOT_FOUND)\r
                                {\r
-                                       piInfo.fiInfo.eDanger = TRUE;\r
-                                       wxLogWarning(_("This archive may contain extension-disguised files whose real extension is hidden by using many blank charactor and you may mistake that it is a \"safe\" file. Don\'t execute these files carelessly.\nDanger file is:\n%s"), piInfo.fiInfo.fnFileName.GetFullPath().c_str());\r
+                                       f.eDanger = TRUE;\r
+                                       wxLogWarning(_("This archive may contain extension-disguised files whose real extension is hidden by using Unicode control character and you may mistake that it is a \"safe\" file. Don\'t execute these files carelessly.\nDanger file is:\n%s"), f.fnFileName.GetFullPath().c_str());\r
                                }\r
-                               // Unicode制御文字を検査。\r
-                               for (wxChar c = 0x200c; c <= 0x206f; c++)\r
+                               switch (c)\r
                                {\r
-                                       if (piInfo.fiInfo.fnFileName.GetFullName().Find(c) != wxNOT_FOUND)\r
-                                       {\r
-                                               piInfo.fiInfo.eDanger = TRUE;\r
-                                               wxLogWarning(_("This archive may contain extension-disguised files whose real extension is hidden by using Unicode control character and you may mistake that it is a \"safe\" file. Don\'t execute these files carelessly.\nDanger file is:\n%s"), piInfo.fiInfo.fnFileName.GetFullPath().c_str());\r
-                                       }\r
-                                       switch (c)\r
-                                       {\r
-                                       case 0x200f: c = 0x2027; break;\r
-                                       case 0x202e: c = 0x2060; break;\r
-                                       }\r
+                               case 0x200f: c = 0x2027; break;\r
+                               case 0x202e: c = 0x2060; break;\r
                                }\r
                        }\r
+               }\r
 \r
-                       // ツリービューに反映。\r
-                       bool fDir = piInfo.fiInfo.dwAttribute & TPI_ATTRIBUTE_DIRECTORY ? true : false;\r
-                       TreeView_CheckNewerItem(this->tree_ctrl, idArcRoot, fDir ? piInfo.fiInfo.fnFileName.GetFullPath() : piInfo.fiInfo.fnFileName.GetPath(), true);\r
-\r
-                       // ディレクトリ属性を含むものについては情報を保存しない。\r
-                       if (fDir)\r
-                       {\r
-                               continue;\r
-                       }\r
+               // ツリービューに反映。\r
+               bool fDir = f.dwAttribute & TPI_ATTRIBUTE_DIRECTORY ? true : false;\r
+               TreeView_CheckNewerItem(this->tree_ctrl, idArcRoot, fDir ? f.fnFileName.GetFullPath() : f.fnFileName.GetPath(), true);\r
 \r
-                       // 情報を保存してカウントアップ。\r
-                       this->fileinfo.Add(piInfo.fiInfo);\r
+               // ディレクトリ属性を含むものについては情報を保存しない。\r
+               if (fDir)\r
+               {\r
+                       continue;\r
                }\r
-               while (tpi.GetFileInformation(& piInfo.fiInfo));\r
        }\r
 \r
-       // GetFileInformationがエラー終了した場合。\r
-       this->ErrorCheck(tpi.nErrorCode, wxT("GetFileInformation"));\r
-\r
        // 書庫の情報を取得。\r
        tpi.GetArchiveInformation(& this->aiArchive);\r
        this->ErrorCheck(tpi.nErrorCode, wxT("GetArchiveInformation"));\r
@@ -552,17 +559,17 @@ void MainFrame::OnArcOpen(wxCommandEvent& e)
 \r
        // 以下、UI処理。\r
        this->fileinfo.Shrink();\r
-       if (this->fileinfo.Count() < 10000)\r
+//     if (this->fileinfo.Count() < 10000)\r
        {\r
                this->tree_ctrl->ExpandAll();\r
                this->tree_ctrl->SelectItem(idArchive);\r
        }\r
-       else\r
+/*     else\r
        {\r
                // ファイル数が多いとソートに時間がかかるので、書庫のルートを表示させる。\r
                this->tree_ctrl->Expand(idArcRoot);\r
                this->tree_ctrl->SelectItem(idArcRoot);\r
-       }\r
+       }*/\r
        // ツリービューの位置合わせ。\r
        this->tree_ctrl->ScrollTo(idArchive);\r
        this->tree_ctrl->SetScrollPos(wxHORIZONTAL, 0);\r
@@ -679,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
@@ -713,11 +720,13 @@ void MainFrame::OnArcAdd(wxCommandEvent& e)
                mkDlg.files = * (wxArrayString *) e.GetClientData();\r
                swInfo.fnDestinationDirectory = wxFileName::DirName(wxFileName(mkDlg.files[0]).GetPath());\r
                // 相対パスに変換。\r
+//             for (auto s : mkDlg.files)\r
                for (size_t n = 0; n < mkDlg.files.GetCount(); n++)\r
                {\r
-                       wxFileName fn(mkDlg.files[n]);\r
+                       wxString & s = mkDlg.files[n];\r
+                       wxFileName fn(s);\r
                        fn.MakeRelativeTo(swInfo.fnDestinationDirectory.GetPath());\r
-                       mkDlg.files[n] = fn.GetFullPath();\r
+                       s = fn.GetFullPath();\r
                }\r
        }\r
 \r
@@ -793,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
@@ -803,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
@@ -897,13 +906,13 @@ 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
                                // Linuxでは引用符で囲む必要がある。\r
-                               fSuccess = ::wxExecute(ftFile->GetOpenCommand(QuoteString(szTempFile)), wxEXEC_ASYNC, pCallback) > 0;\r
+                               fSuccess = ::wxExecute(wxT("xdg-open ") + QuoteString(szTempFile), wxEXEC_ASYNC, pCallback) > 0;\r
 #else\r
                                fSuccess = ::wxExecute(ftFile->GetOpenCommand(szTempFile), wxEXEC_ASYNC, pCallback) > 0;\r
 #endif\r
@@ -917,11 +926,13 @@ 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 (size_t i = 0; i < mkDlg.files.GetCount(); i++)\r
+//                     for (auto s : mkDlg.files)\r
+                       for (size_t n = 0; n < mkDlg.files.GetCount(); n++)\r
                        {\r
-                               wxString szFileName = swInfo.fnDestinationDirectory.GetPathWithSep() + wxFileName(mkDlg.files[i], wxPATH_DOS).GetFullName();\r
+                               wxString & s = mkDlg.files[n];\r
+                               wxString szFileName = swInfo.fnDestinationDirectory.GetPathWithSep() + wxFileName(s, wxPATH_DOS).GetFullName();\r
                                if (nMode == 3)\r
                                {\r
                                        asFiles.Add(szFileName);\r
@@ -944,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
@@ -961,10 +972,12 @@ void MainFrame::OnArcExtract(wxCommandEvent& e)
                                // ディレクトリDnDのときは、先にディレクトリの中のファイルを消しておく。\r
                                if (nMode == 3)\r
                                {\r
+//                                     for (auto s : asFiles)\r
                                        for (size_t i = 0; i < asFiles.GetCount(); i++)\r
                                        {\r
-                                               chmod(asFiles[i].ToUTF8(), 0600);\r
-                                               ::wxRemoveFile(asFiles[i]);\r
+                                               wxString & s = asFiles[i];\r
+                                               chmod(s.ToUTF8(), 0600);\r
+                                               ::wxRemoveFile(s);\r
                                        }\r
                                }\r
 \r
@@ -1103,24 +1116,26 @@ void MainFrame::OnTreeChanged(wxTreeEvent& e)
        this->list_ctrl->SetImageList(& g_hIconLS, wxIMAGE_LIST_SMALL);\r
 \r
        // 配列と比較し、パスが一致しなければ消す。\r
+//     for (auto f : this->fileinfo)\r
        for (size_t i = 0; i < this->fileinfo.GetCount(); i++)\r
        {\r
                // パスを比較。\r
-               if (szNodePath == wxT("*") || szNodePath == this->fileinfo[i].fnFileName.GetPath())\r
+               TPI_FILEINFO & f = this->fileinfo[i];\r
+               if (szNodePath == wxT("*") || szNodePath == f.fnFileName.GetPath())\r
                {\r
                        // 項目がフォルダであるなら無視。\r
-                       if (this->fileinfo[i].fnFileName.IsDir() || ! TreeView_CheckNewerItem(this->tree_ctrl, this->tree_ctrl->GetLastChild(this->tree_ctrl->GetRootItem()), this->fileinfo[i].fnFileName.GetFullPath(), false))\r
+                       if (f.fnFileName.IsDir() || ! TreeView_CheckNewerItem(this->tree_ctrl, this->tree_ctrl->GetLastChild(this->tree_ctrl->GetRootItem()), f.fnFileName.GetFullPath(), false))\r
                        {\r
                                continue;\r
                        }\r
 \r
                        // フィルタにかからなければ無視。\r
-                       if (this->fileinfo[i].fnFileName.GetFullName().MakeLower().Find(this->tcFilter->GetValue().MakeLower()) == wxNOT_FOUND)\r
+                       if (f.fnFileName.GetFullName().MakeLower().Find(this->tcFilter->GetValue().MakeLower()) == wxNOT_FOUND)\r
                        {\r
                                continue;\r
                        }\r
 \r
-                       this->list_ctrl->apShowFile.Add(& this->fileinfo[i]);\r
+                       this->list_ctrl->apShowFile.Add(& f);\r
                }\r
        }\r
 \r