added default ctor and fixed copying of wxFileData (patch 1149384)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32421 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -162,6 +162,7 @@ public:
|
||||
is_drive = 0x0008
|
||||
};
|
||||
|
||||
wxFileData() { Init(); }
|
||||
// Full copy constructor
|
||||
wxFileData( const wxFileData& fileData ) { Copy(fileData); }
|
||||
// Create a filedata from this information
|
||||
@@ -224,10 +225,10 @@ public:
|
||||
// initialize a wxListItem attributes
|
||||
void MakeItem( wxListItem &item );
|
||||
|
||||
|
||||
// operators
|
||||
wxFileData& operator = (const wxFileData& fd) { Copy(fd); return *this; }
|
||||
|
||||
private:
|
||||
protected:
|
||||
wxString m_fileName;
|
||||
wxString m_filePath;
|
||||
long m_size;
|
||||
@@ -235,6 +236,9 @@ private:
|
||||
wxString m_permissions;
|
||||
int m_type;
|
||||
int m_image;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@@ -157,6 +157,7 @@ extern size_t wxGetAvailableDrives(wxArrayString &paths, wxArrayString &names, w
|
||||
|
||||
wxFileData::wxFileData( const wxString &filePath, const wxString &fileName, fileType type, int image_id )
|
||||
{
|
||||
Init();
|
||||
m_fileName = fileName;
|
||||
m_filePath = filePath;
|
||||
m_type = type;
|
||||
@@ -165,6 +166,13 @@ wxFileData::wxFileData( const wxString &filePath, const wxString &fileName, file
|
||||
ReadData();
|
||||
}
|
||||
|
||||
void wxFileData::Init()
|
||||
{
|
||||
m_size = 0;
|
||||
m_type = wxFileData::is_file;
|
||||
m_image = wxFileIconsTable::file;
|
||||
}
|
||||
|
||||
void wxFileData::Copy( const wxFileData& fileData )
|
||||
{
|
||||
m_fileName = fileData.GetFileName();
|
||||
@@ -173,7 +181,7 @@ void wxFileData::Copy( const wxFileData& fileData )
|
||||
m_dateTime = fileData.GetDateTime();
|
||||
m_permissions = fileData.GetPermissions();
|
||||
m_type = fileData.GetType();
|
||||
m_image = GetImageId();
|
||||
m_image = fileData.GetImageId();
|
||||
}
|
||||
|
||||
void wxFileData::ReadData()
|
||||
|
Reference in New Issue
Block a user