~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to khotkeys/libkhotkeysprivate/windows_helper/window_selection_interface.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 1999-2001 Lubos Lunak <l.lunak@kde.org>
 
2
   Copyright (C) 2008 Michael Jansen <kde@michael-jansen.biz>
 
3
 
 
4
   This program is free software; you can redistribute it and/or
 
5
   modify it under the terms of the GNU General Public License
 
6
   Version 2 as published by the Free Software Foundation;
 
7
 
 
8
   This program is distributed in the hope that it will be useful,
 
9
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
   GNU General Public License for more details.
 
12
 
 
13
   You should have received a copy of the GNU General Public License
 
14
   along with this program; if not, write to the Free Software
 
15
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
16
*/
 
17
 
 
18
#include "window_selection_rules.h"
 
19
 
 
20
#include <KDebug>
 
21
 
 
22
 
 
23
namespace KHotKeys {
 
24
 
 
25
Windowdef::Windowdef( const QString& comment_P )
 
26
    : _comment( comment_P )
 
27
    {
 
28
    }
 
29
 
 
30
 
 
31
Windowdef::Windowdef( KConfigGroup& cfg_P )
 
32
    {
 
33
    _comment = cfg_P.readEntry( "Comment" );
 
34
    }
 
35
 
 
36
 
 
37
Windowdef::~Windowdef()
 
38
    {
 
39
    }
 
40
 
 
41
 
 
42
void Windowdef::cfg_write( KConfigGroup& cfg_P ) const
 
43
    {
 
44
    cfg_P.writeEntry( "Type", "ERROR" );
 
45
    cfg_P.writeEntry( "Comment", comment());
 
46
    }
 
47
 
 
48
 
 
49
const QString& Windowdef::comment() const
 
50
    {
 
51
    return _comment;
 
52
    }
 
53
 
 
54
 
 
55
Windowdef* Windowdef::create_cfg_read( KConfigGroup& cfg_P )
 
56
    {
 
57
    QString type = cfg_P.readEntry( "Type" );
 
58
    if( type == "SIMPLE" )
 
59
        return new Windowdef_simple( cfg_P );
 
60
    kWarning() << "Unknown Windowdef type read from cfg file\n";
 
61
    return NULL;
 
62
    }
 
63
 
 
64
 
 
65
void Windowdef::set_comment(const QString &comment)
 
66
    {
 
67
    _comment = comment;
 
68
    }
 
69
 
 
70
 
 
71
 
 
72
} // namespace KHotKeys