mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-06-27 03:29:16 +02:00
Preserve directory structure when loading the POIs
+ POI files handling optimization
This commit is contained in:
@ -12,17 +12,25 @@ public:
|
||||
TreeNode(const QString &name) : _name(name) {}
|
||||
|
||||
const QString &name() const {return _name;}
|
||||
const QList<TreeNode> &childs() const {return _childs;}
|
||||
const QList<TreeNode<T> > &childs() const {return _childs;}
|
||||
const QList<T> &items() const {return _items;}
|
||||
|
||||
void addItem(T node) {_items.append(node);}
|
||||
void addChild(const TreeNode<T> &child) {_childs.append(child);}
|
||||
|
||||
bool isEmpty() const {return _childs.isEmpty() && _items.isEmpty();}
|
||||
void clear() {clear(*this);}
|
||||
|
||||
private:
|
||||
void clear(TreeNode<T> &node)
|
||||
{
|
||||
for (int i = 0; i < node._childs.size(); i++)
|
||||
clear(node._childs[i]);
|
||||
node._items.clear();
|
||||
}
|
||||
|
||||
QString _name;
|
||||
QList<TreeNode> _childs;
|
||||
QList<TreeNode<T> > _childs;
|
||||
QList<T> _items;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user