1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-06-27 03:29:16 +02:00

Preserve directory structure when loading the maps

This commit is contained in:
2021-03-20 09:59:03 +01:00
parent 8196b96f65
commit 659cf4cc7a
6 changed files with 157 additions and 66 deletions

29
src/common/treenode.h Normal file
View File

@ -0,0 +1,29 @@
#ifndef TREENODE_H
#define TREENODE_H
#include <QList>
#include <QString>
template <typename T>
class TreeNode
{
public:
TreeNode() {}
TreeNode(const QString &name) : _name(name) {}
const QString &name() const {return _name;}
const QList<TreeNode> &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();}
private:
QString _name;
QList<TreeNode> _childs;
QList<T> _items;
};
#endif // TREENODE_H