mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-25 01:18:22 +08:00
Refactoring
This commit is contained in:
parent
4745d61905
commit
f90427229d
@ -91,3 +91,10 @@ int TreeItem::row() const
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
TreeItem* TreeItem::child(int row)
|
||||
{
|
||||
std::list<TreeItem*>::iterator child = childItems.begin();
|
||||
std::advance(child, row);
|
||||
return *child;
|
||||
}
|
@ -21,16 +21,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#include "ustring.h"
|
||||
#include "basetypes.h"
|
||||
|
||||
template <typename ForwardIt>
|
||||
ForwardIt u_std_next(
|
||||
ForwardIt it,
|
||||
typename std::iterator_traits<ForwardIt>::difference_type n = 1
|
||||
)
|
||||
{
|
||||
std::advance(it, n);
|
||||
return it;
|
||||
}
|
||||
|
||||
class TreeItem
|
||||
{
|
||||
public:
|
||||
@ -47,14 +37,14 @@ public:
|
||||
UINT8 insertChildAfter(TreeItem *item, TreeItem *newItem); // Non-trivial implementation in CPP file
|
||||
|
||||
// Model support operations
|
||||
TreeItem *child(int row) { return *u_std_next(childItems.begin(), row); }
|
||||
TreeItem *child(int row); // Non-trivial implementation in CPP file
|
||||
int childCount() const {return childItems.size(); }
|
||||
int columnCount() const { return 5; }
|
||||
UString data(int column) const; // Non-trivial implementation in CPP file
|
||||
int row() const; // Non-trivial implementation in CPP file
|
||||
TreeItem *parent() { return parentItem; }
|
||||
|
||||
// Reading operations for item parameters
|
||||
// Getters and setters for item parameters
|
||||
UString name() const { return itemName; }
|
||||
void setName(const UString &text) { itemName = text; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user