From 1a1c8ddf62f8fc53e4610759db1277e7e6e6e6c1 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Mon, 8 May 2006 15:17:12 +0000 Subject: [PATCH] PATCH: [ 1483344 ] Fix creating private file filters --- Src/Changes.txt | 4 ++++ Src/FileFiltersDlg.cpp | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Src/Changes.txt b/Src/Changes.txt index b1a2a781a..46ac47c85 100644 --- a/Src/Changes.txt +++ b/Src/Changes.txt @@ -2,6 +2,10 @@ Src\Changes.txt Add new items to top. (This summarizes all changes to all files under Src, including Src\Languages.) +2006-05-08 Kimmo + PATCH: [ 1483344 ] Fix creating private file filters + Src: FileFiltersDlg.cpp + 2006-05-07 Kimmo PATCH: [ 1483107 ] Remove dublicated code from folder compare progress dlg Src: DirCompProgressDlg.cpp DirCompProgressDlg.h diff --git a/Src/FileFiltersDlg.cpp b/Src/FileFiltersDlg.cpp index bbd5d1851..57975fe74 100644 --- a/Src/FileFiltersDlg.cpp +++ b/Src/FileFiltersDlg.cpp @@ -394,6 +394,7 @@ void FileFiltersDlg::OnBnClickedFilterfileTestButton() * filter directories? * @todo Warn user instead of silently failing when there * are no defined filter folders. + * @bug Doesn't fail or inform if copying template file fails. */ void FileFiltersDlg::OnBnClickedFilterfileNewbutton() { @@ -409,6 +410,11 @@ void FileFiltersDlg::OnBnClickedFilterfileNewbutton() return; } + CString templatePath(globalPath); + if (templatePath[templatePath.GetLength()-1] != '\\') + templatePath += "\\"; + templatePath += FILE_FILTER_TEMPLATE; + CString path = (globalPath.IsEmpty() ? userPath : globalPath); if (!globalPath.IsEmpty() && !userPath.IsEmpty()) @@ -420,8 +426,6 @@ void FileFiltersDlg::OnBnClickedFilterfileNewbutton() if (path.GetLength() && path[path.GetLength()-1] != '\\') path += '\\'; - CString tmplPath = path + FILE_FILTER_TEMPLATE; - CString s; if (SelectFile(s, path, title, IDS_FILEFILTER_FILEMASK, FALSE)) { @@ -443,7 +447,7 @@ void FileFiltersDlg::OnBnClickedFilterfileNewbutton() s += FileFilterExt; } - CopyFile(tmplPath, s, TRUE); + CopyFile(templatePath, s, TRUE); theApp.m_globalFileFilter.EditFileFilter(s); FileFilterMgr *pMgr = theApp.m_globalFileFilter.GetManager(); pMgr->AddFilter(s); -- 2.11.0