not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / khotkeys / libkhotkeysprivate / actions / action.cpp
blobd3a960adf5abbf58dcfd02d3ac9204d46c9374a4
1 /*
2 Copyright (C) 1999-2001 Lubos Lunak <l.lunak@kde.org>
3 Copyright (C) 2008 Michael Jansen <kde@michael-jansen.biz>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #include "actions.h"
22 #include <KDE/KConfigGroup>
23 #include <KDE/KDebug>
25 namespace KHotKeys {
28 Action::Action( ActionData* data_P )
29 : data( data_P )
34 Action::~Action()
39 void Action::aboutToBeErased()
41 // Nothing to do yet.
44 Action::Action( KConfigGroup&, ActionData* data_P )
45 : data( data_P )
50 Action* Action::create_cfg_read( KConfigGroup& cfg_P, ActionData* data_P )
52 QString type = cfg_P.readEntry( "Type" );
53 if( type == "COMMAND_URL" )
54 return new CommandUrlAction( cfg_P, data_P );
55 if( type == "MENUENTRY" )
56 return new MenuEntryAction( cfg_P, data_P );
57 if( type == "DCOP" || type == "DBUS" )
58 return new DBusAction( cfg_P, data_P );
59 if( type == "KEYBOARD_INPUT" )
60 return new KeyboardInputAction( cfg_P, data_P );
61 if( type == "ACTIVATE_WINDOW" )
62 return new ActivateWindowAction( cfg_P, data_P );
63 kWarning() << "Unknown Action type read from cfg file\n";
64 return NULL;
68 void Action::cfg_write( KConfigGroup& cfg_P ) const
70 cfg_P.writeEntry( "Type", "ERROR" ); // derived classes should call with their type
74 } // namespace KHotKeys