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:
committed by
Paul Licameli
parent
b0ef9c4e82
commit
b6fdffbab2
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user