~ubuntu-branches/ubuntu/wily/muse/wily-proposed

« back to all changes in this revision

Viewing changes to muse/widgets/splitter.cpp

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2011-12-03 17:12:54 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20111203171254-28b1j4lpb46r5jtl
Tags: 2.0~rc1-1
* New upstream RC release.
* Refresh patches, remove those patches not needed anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
//  Linux Music Editor
4
4
//    $Id: splitter.cpp,v 1.1.1.1 2003/10/27 18:54:59 wschweer Exp $
5
5
//  (C) Copyright 1999 Werner Schweer (ws@seh.de)
 
6
//
 
7
//  This program is free software; you can redistribute it and/or
 
8
//  modify it under the terms of the GNU General Public License
 
9
//  as published by the Free Software Foundation; version 2 of
 
10
//  the License, or (at your option) any later version.
 
11
//
 
12
//  This program is distributed in the hope that it will be useful,
 
13
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
//  GNU General Public License for more details.
 
16
//
 
17
//  You should have received a copy of the GNU General Public License
 
18
//  along with this program; if not, write to the Free Software
 
19
//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
20
//
6
21
//=========================================================
7
22
 
8
23
#include "splitter.h"
11
26
#include <QList>
12
27
#include <QStringList>
13
28
 
 
29
namespace MusEGui {
 
30
 
14
31
//---------------------------------------------------------
15
32
//   Splitter
16
33
//---------------------------------------------------------
26
43
//   saveConfiguration
27
44
//---------------------------------------------------------
28
45
 
29
 
void Splitter::writeStatus(int level, Xml& xml)
 
46
void Splitter::writeStatus(int level, MusECore::Xml& xml)
30
47
      {
31
48
      QList<int> vl = sizes();
32
49
      //xml.nput(level++, "<%s>", name());
33
 
      xml.nput(level++, "<%s>", Xml::xmlString(objectName()).toLatin1().constData());
 
50
      xml.nput(level++, "<%s>", MusECore::Xml::xmlString(objectName()).toLatin1().constData());
34
51
      QList<int>::iterator ivl = vl.begin();
35
52
      for (; ivl != vl.end(); ++ivl) {
36
53
            xml.nput("%d ", *ivl);
37
54
            }
38
55
      //xml.nput("</%s>\n", name());
39
 
      xml.nput("</%s>\n", Xml::xmlString(objectName()).toLatin1().constData());
 
56
      xml.nput("</%s>\n", MusECore::Xml::xmlString(objectName()).toLatin1().constData());
40
57
      }
41
58
 
42
59
//---------------------------------------------------------
43
60
//   loadConfiguration
44
61
//---------------------------------------------------------
45
62
 
46
 
void Splitter::readStatus(Xml& xml)
 
63
void Splitter::readStatus(MusECore::Xml& xml)
47
64
      {
48
65
      QList<int> vl;
49
66
 
50
67
      for (;;) {
51
 
            Xml::Token token = xml.parse();
 
68
            MusECore::Xml::Token token = xml.parse();
52
69
            const QString& tag = xml.s1();
53
70
            switch (token) {
54
 
                  case Xml::Error:
55
 
                  case Xml::End:
 
71
                  case MusECore::Xml::Error:
 
72
                  case MusECore::Xml::End:
56
73
                        return;
57
 
                  case Xml::TagStart:
 
74
                  case MusECore::Xml::TagStart:
58
75
                        xml.unknown("Splitter");
59
76
                        break;
60
 
                  case Xml::Text:
 
77
                  case MusECore::Xml::Text:
61
78
                        {
62
79
                        //QStringList sl = QStringList::split(' ', tag);
63
80
                        QStringList sl = tag.split(QString(" "), QString::SkipEmptyParts);
67
84
                              }
68
85
                        }
69
86
                        break;
70
 
                  case Xml::TagEnd:
 
87
                  case MusECore::Xml::TagEnd:
71
88
                        if (tag == objectName()) {
72
89
                              setSizes(vl);
73
90
                              return;
77
94
                  }
78
95
            }
79
96
      }
 
97
 
 
98
} // namespace MusEGui