You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kbfx/kbfxlib/data/kbfxdatastack.cpp

85 lines
1.7 KiB

/*
* Copyright (C) 2006
* Siraj Razick <siraj@kdemail.net>
* PhobosK <phobosk@mail.kbfx.org>
* see Also AUTHORS
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License version 2 as
* published by the Free Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "kbfxdatastack.h"
KbfxDataStack::KbfxDataStack()
{
m_nameList.append ( "" );
m_name = "Unset";
m_count = 0;
}
KbfxDataStack::~KbfxDataStack()
{
//TODO: empty the list
}
void
KbfxDataStack::addGroupList ( KbfxDataGroupList * list )
{
m_stack[list->name() ]=list;
m_nameList.append ( list->name() );
m_dict[list->name() ]=m_count;
KbfxPlasmaCanvasStackData stackinfo;
stackinfo.name = list->name();
stackinfo.icon = list->iconPath();
m_dataDict[m_count] = stackinfo;
m_count++;
}
TQStringList
KbfxDataStack::getStackIndex()
{
return m_nameList;
}
KbfxDataGroupList *
KbfxDataStack::getStack ( TQString name )
{
if ( m_nameList.contains ( name ) >0 )
return m_stack[name];
else
{
return NULL;
}
}
TQString
KbfxDataStack::getSubGroupName ( uint id )
{
Dict::Iterator it;
for ( it=m_dict.begin();it!=m_dict.end();++it )
{
if ( it.data() == id )
return it.key();
}
return TQString ( "Empty" );
}