-/*******************************************************************************
-$RCSfile$
-$Author$
-$Date$
-
-*******************************************************************************/
-
+/////////////////////////////////////////////////////////////////////////////
+// License (GPLv2+):
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at
+// your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+/////////////////////////////////////////////////////////////////////////////
+/**
+ * @file Coretools.cpp
+ *
+ * @brief Common routines
+ *
+ */
+// RCS ID line follows -- this is updated by CVS
+// $Id$
#include "stdafx.h"
#include <stdio.h>
#include <io.h>
{
if (pExt)
{
- (*pExt) = pszChar + 1;
+ (*pExt) = pszChar + 1;
}
ext = true; // extension is only after last period
extptr = pszChar;
return spath;
}
-
-/*******************************************************************************
- END OF FILE
-*******************************************************************************/
-
+/**
+ * @brief Returns Application Data path in user profile directory
+ * if one exists
+ */
+BOOL GetAppDataPath(CString &sAppDataPath)
+{
+ TCHAR path[_MAX_PATH] = {0};
+ if (GetEnvironmentVariable(_T("APPDATA"), path, _MAX_PATH))
+ {
+ sAppDataPath = path;
+ return TRUE;
+ }
+ else
+ {
+ sAppDataPath = _T("");
+ return FALSE;
+ }
+}
+/////////////////////////////////////////////////////////////////////////////
+// License (GPLv2+):
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+/////////////////////////////////////////////////////////////////////////////
+/**
+ * @file Coretools.h
+ *
+ * @brief Declaration file for Coretools.cpp
+ */
+// RCS ID line follows -- this is updated by CVS
+// $Id$
+
#ifndef CORETOOLS_H
#define CORETOOLS_H
HANDLE RunIt(LPCTSTR szExeFile, LPCTSTR szArgs, BOOL bMinimized = TRUE, BOOL bNewConsole = FALSE);
BOOL HasExited(HANDLE hProcess, DWORD *pCode = NULL);
BOOL IsLocalPath(LPCTSTR path);
+BOOL GetAppDataPath(CString &sAppDataPath);
#endif
// Load
void FileFilterMgr::LoadFromDirectory(LPCTSTR szPattern, LPCTSTR szExt)
{
- DeleteAllFilters();
+ // DeleteAllFilters();
CFileFind finder;
BOOL bWorking = finder.FindFile(szPattern);
int extlen = szExt ? _tcslen(szExt) : 0;
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
/////////////////////////////////////////////////////////////////////////////
-// Merge.cpp : Defines the class behaviors for the application.
-//
+/**
+ * @file Merge.cpp
+ *
+ * @brief Defines the class behaviors for the application.
+ *
+ */
+// RCS ID line follows -- this is updated by CVS
+// $Id$
#include "stdafx.h"
#include "Merge.h"
return TRUE;
}
-// Process commandline arguments
+/// Process commandline arguments
void CMergeApp::ParseArgs(CStringArray & files, UINT & nFiles, BOOL & recurse, DWORD & dwLeftFlags, DWORD & dwRightFlags)
{
for (int i = 1; i < __argc; i++)
if (!_tcsicmp(pszParam, _T("e")))
m_bEscCloses = TRUE;
- // -ur to not add left path to MEU
+ // -ul to not add left path to MRU
if (!_tcsicmp(pszParam, _T("ul")))
dwLeftFlags |= FFILEOPEN_NOMRU;
return CWinApp::DoMessageBox(lpszPrompt, nType, nIDPrompt);
}
-// Set flag so that application will broadcast notification at next
-// idle time (via WM_TIMER id=IDLE_TIMER)
+/**
+ * @brief Set flag so that application will broadcast notification at next
+ * idle time (via WM_TIMER id=IDLE_TIMER)
+ */
void CMergeApp::SetNeedIdleTimer()
{
m_bNeedIdleTimer = TRUE;
return FALSE;
}
-// Load any known file filters
+/** @brief Load any known file filters */
void CMergeApp::InitializeFileFilters()
{
if (!m_fileFilterMgr)
CString sPattern = GetModulePath() + _T("\\Filters\\*.flt");
m_fileFilterMgr->LoadFromDirectory(sPattern, _T(".flt"));
+
+ // Get Application data path in user profile directory
+ if (GetAppDataPath(sPattern))
+ {
+ // Load filters from subdir
+ sPattern += _T("\\WinMerge\\Filters\\*.flt");
+ m_fileFilterMgr->LoadFromDirectory(sPattern, _T(".flt"));
+ }
}
-// fill list with names of known filters
+/** @brief fill list with names of known filters */
void CMergeApp::GetFileFilterNameList(CStringList & filefilters, CString & selected) const
{
if (!m_fileFilterMgr) return;
selected = m_sFileFilterName;
}
-// Store current filter (if filter manager validates the name)
+/** @brief Store current filter (if filter manager validates the name) */
void CMergeApp::SetFileFilterName(LPCTSTR szFileFilterName)
{
m_sFileFilterName = _T("<None>");
2003-09-15 Kimmo
- BUG [ 806552 ] DirView icons missing?
+ BUG: [ 806552 ] DirView icons missing?
Adding icons for skipped files and folders
WinMerge: DirView.cpp Merge.rc resource.h
WinMerge/res: new files fileskip.bmp folderskip.bmp
Languages: resource.h *.rc new files /res fileskip.bmp folderskip.bmp
Don't color skipped items filenames in directory compare
WinMerge: DirView.cpp
+ PATCH: [ 804493 ] Read filter files from users profile directory
+ NOTE: Filters are read from %profiledir%/Application Data/WinMerge/Filters
+ common: coretools.h coretools.cpp
+ WinMerge: FileFilterMgr.cpp Merge.cpp
2003-09-14 Perry
PATCH: [ 805875 ] Switch to diffcode flags