-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSourceTreeItem.cpp
More file actions
37 lines (30 loc) · 990 Bytes
/
SourceTreeItem.cpp
File metadata and controls
37 lines (30 loc) · 990 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
Written By Pradipna Nepal
www.pradsprojects.com
Copyright (C) 2013 Pradipna Nepal
Please read COPYING.txt included along with this source code for more detail.
If not included, see http://www.gnu.org/licenses/
*/
#include "SourceTreeItem.h"
SourceTreeItem::SourceTreeItem(QTreeWidget *parent, int itemType, QString name) : QTreeWidgetItem(parent) {
initialize(itemType, name);
}
SourceTreeItem::SourceTreeItem(int itemType, QString name) {
initialize(itemType, name);
}
void SourceTreeItem::initialize(int itemType, QString name) {
this->itemType = itemType;
this->name = name;
this->setText(0, name);
if (itemType == SRC_TREE_ITEM_FOLDER) {
this->setIcon(0, QIcon(":/icons/icons/folder.png"));
} else {
this->setIcon(0, QIcon(":/icons/icons/source.png"));
}
}
int SourceTreeItem::getItemType() {
return itemType;
}
QString SourceTreeItem::getName() {
return name;
}