File indexing completed on 2025-02-02 09:10:33
0001 /*************************************************************************** 0002 * Copyright (C) 2003 by David Saxton * 0003 * david@bluehaze.org * 0004 * * 0005 * This program is free software; you can redistribute it and/or modify * 0006 * it under the terms of the GNU General Public License as published by * 0007 * the Free Software Foundation; either version 2 of the License, or * 0008 * (at your option) any later version. * 0009 ***************************************************************************/ 0010 0011 #include "libraryitem.h" 0012 0013 #include <QImage> 0014 #include <QStandardPaths> 0015 0016 LibraryItem::LibraryItem(QStringList idList, const QString &name, const QString &category, QIcon icon, Type type, createItemPtr _createItem) 0017 { 0018 m_idList = idList; 0019 m_name = name; 0020 m_category = category; 0021 m_icon = icon; 0022 m_type = type; 0023 createItem = _createItem; 0024 } 0025 0026 LibraryItem::LibraryItem(QStringList idList, const QString &name, const QString &category, const QString &iconName, Type type, createItemPtr _createItem) 0027 { 0028 m_idList = idList; 0029 m_name = name; 0030 m_category = category; 0031 m_icon = QIcon(QStandardPaths::locate(QStandardPaths::AppDataLocation, "icons/" + iconName)); 0032 m_type = type; 0033 createItem = _createItem; 0034 } 0035 0036 LibraryItem::LibraryItem(QStringList idList, const QString &name, const QString &category, Type type, createItemPtr _createItem) 0037 { 0038 m_idList = idList; 0039 m_name = name; 0040 m_category = category; 0041 m_type = type; 0042 createItem = _createItem; 0043 } 0044 0045 LibraryItem::~LibraryItem() 0046 { 0047 } 0048 0049 QString LibraryItem::activeID() const 0050 { 0051 return m_idList.isEmpty() ? "" : m_idList[0]; 0052 }