~ubuntu-branches/ubuntu/hardy/lmms/hardy

« back to all changes in this revision

Viewing changes to src/lib/clipboard.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Tobias Doerffel
  • Date: 2007-09-17 15:00:24 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070917150024-mo0zk4ks81jawqii
Tags: 0.3.0-1ubuntu1
* Resynchronized with Debian (LP: #139759, LP: #90806, LP: #102639,
  LP: #113447, LP: #121172, LP: #124890)
* reverted changes from 0.2.1-1.1ubuntu1 as upstream merged/included them

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
/*
4
4
 * clipboard.cpp - the clipboard for patterns, notes etc.
5
5
 *
6
 
 * Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
 
6
 * Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
7
7
 * 
8
8
 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
9
9
 *
19
19
 *
20
20
 * You should have received a copy of the GNU General Public
21
21
 * License along with this program (see COPYING); if not, write to the
22
 
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23
 
 * Boston, MA 02111-1307, USA.
 
22
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
23
 * Boston, MA 02110-1301 USA.
24
24
 *
25
25
 */
26
26
 
29
29
#include "journalling_object.h"
30
30
 
31
31
 
32
 
namespace clipboard
33
 
{
34
 
 
35
 
        map content;
36
 
 
37
 
 
38
 
        void copy( journallingObject * _obj )
39
 
        {
40
 
                QDomDocument doc;
41
 
                QDomElement parent = doc.createElement( "clipboard" );
42
 
                _obj->saveState( doc, parent );
43
 
                content[_obj->nodeName()] = parent.firstChild().toElement();
44
 
        }
45
 
 
46
 
 
47
 
 
48
 
 
49
 
        const QDomElement * getContent( const QString & _node_name )
50
 
        {
51
 
                if( content.find( _node_name ) != content.end() )
52
 
                {
53
 
                        return( &content[_node_name] );
54
 
                }
55
 
                return( NULL );
56
 
        }
57
 
 
58
 
} ;
 
32
 
 
33
 
 
34
clipboard::map clipboard::content;
 
35
 
 
36
 
 
37
 
 
38
 
 
39
void clipboard::copy( journallingObject * _obj )
 
40
{
 
41
        QDomDocument doc;
 
42
        QDomElement parent = doc.createElement( "clipboard" );
 
43
        _obj->saveState( doc, parent );
 
44
        content[_obj->nodeName()] = parent.firstChild().toElement();
 
45
}
 
46
 
 
47
 
 
48
 
 
49
 
 
50
const QDomElement * clipboard::getContent( const QString & _node_name )
 
51
{
 
52
        if( content.find( _node_name ) != content.end() )
 
53
        {
 
54
                return( &content[_node_name] );
 
55
        }
 
56
        return( NULL );
 
57
}
 
58
 
59
59
 
60
60
 
61
61