summaryrefslogtreecommitdiff
path: root/LiteEditor/assignedfilesmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'LiteEditor/assignedfilesmodel.cpp')
-rw-r--r--LiteEditor/assignedfilesmodel.cpp34
1 files changed, 7 insertions, 27 deletions
diff --git a/LiteEditor/assignedfilesmodel.cpp b/LiteEditor/assignedfilesmodel.cpp
index 6e9d7f87..1d2c012c 100644
--- a/LiteEditor/assignedfilesmodel.cpp
+++ b/LiteEditor/assignedfilesmodel.cpp
@@ -1,28 +1,3 @@
-//////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-//
-// copyright : (C) 2014 The CodeLite Team
-// file name : assignedfilesmodel.cpp
-//
-// -------------------------------------------------------------------------
-// A
-// _____ _ _ _ _
-// / __ \ | | | | (_) |
-// | / \/ ___ __| | ___| | _| |_ ___
-// | | / _ \ / _ |/ _ \ | | | __/ _ )
-// | \__/\ (_) | (_| | __/ |___| | || __/
-// \____/\___/ \__,_|\___\_____/_|\__\___|
-//
-// F i l e
-//
-// 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 file was auto-generated by codelite's wxCrafter Plugin
// Do not modify this file by hand!
@@ -61,7 +36,7 @@ AssignedFilesModel::AssignedFilesModel()
AssignedFilesModel::~AssignedFilesModel()
{
for(size_t i=0; i<m_data.size(); ++i) {
- delete m_data.at(i);
+ wxDELETE(m_data.at(i));
}
m_data.clear();
}
@@ -101,6 +76,10 @@ wxString AssignedFilesModel::GetColumnType(unsigned int col) const
wxDataViewItem AssignedFilesModel::GetParent(const wxDataViewItem& item) const
{
+ if ( IsEmpty() ) {
+ return wxDataViewItem(NULL);
+ }
+
AssignedFilesModel_Item* node = reinterpret_cast<AssignedFilesModel_Item*>(item.m_pItem);
if ( node ) {
return wxDataViewItem(node->GetParent());
@@ -228,7 +207,7 @@ void AssignedFilesModel::DeleteItem(const wxDataViewItem& item)
if ( parent && parent->GetChildren().empty() )
DoChangeItemType(parentItem, false);
- delete node;
+ wxDELETE(node);
}
if ( IsEmpty() )
@@ -253,6 +232,7 @@ void AssignedFilesModel::Clear()
for(; iter != roots.end(); ++iter) {
DeleteItem( wxDataViewItem(*iter) );
}
+ m_data.clear();
Cleared();
}