~ubuntu-branches/debian/sid/kxstitch/sid

« back to all changes in this revision

Viewing changes to kxstitch/flossscheme.cpp

  • Committer: Bazaar Package Importer
  • Author(s): eric pareja
  • Date: 2005-02-19 12:37:22 UTC
  • Revision ID: james.westby@ubuntu.com-20050219123722-kt3ru1nqvllietee
Tags: upstream-0.6
ImportĀ upstreamĀ versionĀ 0.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2003 by Stephen Allewell                                *
 
3
 *   stephen@mirramar.fsnet.co.uk                                          *
 
4
 *                                                                         *
 
5
 *   This program is free software; you can redistribute it and/or modify  *
 
6
 *   it under the terms of the GNU General Public License as published by  *
 
7
 *   the Free Software Foundation; either version 2 of the License, or     *
 
8
 *   (at your option) any later version.                                   *
 
9
 ***************************************************************************/
 
10
 
 
11
#include "flossscheme.h"
 
12
 
 
13
FlossScheme::FlossScheme()
 
14
{
 
15
  m_flosses.setAutoDelete(true);
 
16
}
 
17
 
 
18
QString FlossScheme::schemeName()
 
19
{
 
20
  return m_name;
 
21
}
 
22
 
 
23
void FlossScheme::setSchemeName(QString name)
 
24
{
 
25
  m_name = name;
 
26
}
 
27
 
 
28
void FlossScheme::addFloss(Floss *floss)
 
29
{
 
30
  m_flosses.append(floss);
 
31
}
 
32
 
 
33
Floss *FlossScheme::find(QString name)
 
34
{
 
35
  for (Floss* floss = m_flosses.first() ; floss ; floss = m_flosses.next())
 
36
  {
 
37
    if (floss->name == name)
 
38
      return floss;
 
39
  }
 
40
  return 0;
 
41
}
 
42
 
 
43
QPtrListIterator<Floss> FlossScheme::flossIterator()
 
44
{
 
45
  return QPtrListIterator<Floss>(m_flosses);
 
46
}
 
47
 
 
48
void FlossScheme::clearScheme()
 
49
{
 
50
  m_flosses.clear();
 
51
}
 
52