Fix Issue #392: refresh branch info when press "F5"
[TortoiseGit.git] / src / TortoiseMerge / TempFiles.cpp
blobe7e0277967ccd24c87ad809cbef229f85706ef8c
1 // TortoiseMerge - a Diff/Patch program
3 // Copyright (C) 2006,2008 - Stefan Kueng
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #include "StdAfx.h"
20 #include ".\tempfiles.h"
22 CTempFiles::CTempFiles(void)
26 CTempFiles::~CTempFiles(void)
28 for (int i=0; i<m_arTempFileList.GetCount(); i++)
30 DeleteFile(m_arTempFileList.GetAt(i));
34 CString CTempFiles::GetTempFilePath()
36 DWORD len = GetTempPath(0, NULL);
37 TCHAR * path = new TCHAR[len+1];
38 TCHAR * tempF = new TCHAR[len+100];
39 GetTempPath (len+1, path);
40 GetTempFileName (path, TEXT("tsm"), 0, tempF);
41 CString tempfile = CString(tempF);
42 delete [] path;
43 delete [] tempF;
44 m_arTempFileList.Add(tempfile);
45 return tempfile;