//========================================================================
std::string irclean(const std::string& str)
{
- if (str == "GDCM::Unfound")
- {
- return "";
- }
- if (str[str.size()-1]==' ')
- {
- return str.substr(0,str.size()-1);
- }
- if (str[str.size()-1]==0)
- {
- return str.substr(0,str.size()-1);
- }
+ if(str.size() > 0)
+ {
+ if (str == "GDCM::Unfound")
+ {
+ return "";
+ }
+ if (str[str.size()-1]==' ')
+ {
+ return str.substr(0,str.size()-1);
+ }
+ if (str[str.size()-1]==0)
+ {
+ return str.substr(0,str.size()-1);
+ }
+ }
+
return str;
}
//========================================================================
std::string query = "DELETE FROM ";
- query += GetTree().GetLevelDescriptor(node->GetLevel()).GetName();
+
+ query += GetTree().GetLevelDescriptor(node->GetLevel()).GetName();
+
query += " WHERE ID='"+ node->GetAttribute("ID") + "';";
UPDATEDB(query);
: mParent(parent),//mData(0),
mChildrenLoaded(false)
{
+ mData.reset();
if (parent)
{
GimmickDebugMessage(6,"Default Node constructor (level "<<GetLevel()<<")"
: mParent(parent),//mData(0),
mChildrenLoaded(false)
{
+ mData.reset();
GimmickDebugMessage(6,"Node constructor (level "<<GetLevel()<<")"
<< std::endl);
{
delete *i;
}
-
+ mData.reset();
}
//=============================================================
/// Returns the level of the node in the tree
virtual int GetLevel() const { return mParent->GetLevel()+1; }
+
/// Returns the parent of the node
Node* GetParent() const { return mParent; }
{ if (mData!=0) return dynamic_cast<T>(mData); return 0; }
/// Sets the node data. Deletes existing data if any.
- void SetData(boost::shared_ptr<NodeData> d) { mData = d; }//{ if (mData) delete mData; mData = d; }
+ void SetData(boost::shared_ptr<NodeData> d) {mData.reset(); mData = d; }//{ if (mData) delete mData; mData = d; }
/// Sorts the children of the node
void SortChildren(const LexicographicalComparator&);
#if defined(BUILD_BRUKER)
#include "bruker2dicom.h"
#endif
+
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
+
namespace creaImageIO
{
void WxGimmickView::AddIgnoreFile(tree::Node* toRemove)
{
mGimmick->RemoveFile(crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())),toRemove);
- GetTreeViewMap()[crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()))]->UpdateLevel(1);
+ // GetTreeViewMap()[crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()))]->UpdateLevel(1);
}
//=================================================
{
needRefresh=true;
}
- tree::Node* n= (tree::Node*)(*i);
+ //tree::Node* n = new (tree::Node*)(*i);
GetTreeHandler()->LoadChildren((*i),4);
- GetGimmickView()->AddIgnoreFile(n);
+ GetGimmickView()->AddIgnoreFile(*i);
GetTreeHandler()->Remove(*i);
}