diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/list_item.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/list_item.cpp b/src/list_item.cpp index 6409169..a7fde7e 100644 --- a/src/list_item.cpp +++ b/src/list_item.cpp @@ -2,7 +2,14 @@ #include "types.h" QIcon* choose_icon(StatusType status_type) { - return new QIcon(); // TODO: null icon for the moment + // via the use of `static' in the following switch block, the idea is to only initialize each QIcon type once in the program's lifetime. + + switch (status_type) { + // TODO: only null icon for the moment + default: + static QIcon* icon = new QIcon(); + return icon; + } } ListItem::ListItem(const QString &text, StatusType status_type, QListWidget *parent, int index) : |