1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-23 06:31:17 +01:00

Don't copy wxFileName often, it's not lightweight! Use wxFileNameWrapper...

... which is a new class that defines moves.
This commit is contained in:
Paul Licameli
2016-04-11 00:16:29 -04:00
committed by Paul Licameli
parent b0ef9c4e82
commit b6fdffbab2
23 changed files with 291 additions and 208 deletions

View File

@@ -19,6 +19,7 @@
#include "audacity/Types.h"
#include "xml/XMLTagHandler.h"
#include "wxFileNameWrapper.h"
class wxHashTable;
class BlockArray;
@@ -94,7 +95,7 @@ class PROFILE_DLL_API DirManager final : public XMLTagHandler {
bool MoveToNewProjectDirectory(BlockFile *f);
bool CopyToNewProjectDirectory(BlockFile *f);
bool EnsureSafeFilename(wxFileName fName);
bool EnsureSafeFilename(const wxFileName &fName);
void Ref(BlockFile * f);
void Deref(BlockFile * f);
@@ -116,7 +117,7 @@ class PROFILE_DLL_API DirManager final : public XMLTagHandler {
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs);
XMLTagHandler *HandleXMLChild(const wxChar * WXUNUSED(tag)) { return NULL; }
void WriteXML(XMLWriter & WXUNUSED(xmlFile)) { wxASSERT(false); } // This class only reads tags.
bool AssignFile(wxFileName &filename, const wxString &value, bool check);
bool AssignFile(wxFileNameWrapper &filename, const wxString &value, bool check);
// Clean the temp dir. Note that now where we have auto recovery the temp
// dir is not cleaned at start up anymore. But it is cleaned when the
@@ -168,8 +169,8 @@ class PROFILE_DLL_API DirManager final : public XMLTagHandler {
private:
wxFileName MakeBlockFileName();
wxFileName MakeBlockFilePath(const wxString &value);
wxFileNameWrapper MakeBlockFileName();
wxFileNameWrapper MakeBlockFilePath(const wxString &value);
bool MoveOrCopyToNewProjectDirectory(BlockFile *f, bool copy);