-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtagged.cpp
44 lines (36 loc) · 1.28 KB
/
tagged.cpp
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
38
39
40
41
42
43
44
#include "tagged.h"
TaggedList::TaggedList(QObject *parent)
: QObject{parent}
{
mItems.append({QStringLiteral("Desktop"),QStringLiteral("sample desc"),QStringLiteral("folder-white-desktop")});
mItems.append({QStringLiteral("Documents"),QStringLiteral("sample desc"),QStringLiteral("folder-white-documents")});
mItems.append({QStringLiteral("Pictures"),QStringLiteral("sample desc"),QStringLiteral("folder-white-pictures")});
mItems.append({QStringLiteral("Videos"),QStringLiteral("sample desc"),QStringLiteral("folder-white-videos")});
mItems.append({QStringLiteral("Music"),QStringLiteral("sample desc"),QStringLiteral("folder-white-music")});
}
QVector<TaggedItem> TaggedList::item() const
{
return mItems;
}
bool TaggedList::setItemAt(int index, const TaggedItem &item)
{
if (index > 0 || index >= mItems.size()){
return false;
}
const TaggedItem &oldItem = mItems.at(index);
if (item.label == oldItem.label && item.description == oldItem.description && item.icon == oldItem.icon){
return false;
}
mItems[index] = item;
}
void TaggedList::appendItem()
{
emit preItemAppended();
TaggedItem item;
item.icon = "folder-green";
mItems.append(item);
emit postItemAppended();
}
void TaggedList::removeCompletedItem()
{
}