~ubuntu-branches/ubuntu/maverick/datakiosk/maverick

« back to all changes in this revision

Viewing changes to src/src/actioncollection.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-06-27 22:48:06 UTC
  • Revision ID: james.westby@ubuntu.com-20050627224806-8farkci1dc2onhbs
Tags: upstream-0.7
ImportĀ upstreamĀ versionĀ 0.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2005 by Adam Treat                                      *
 
3
 *   treat@kde.org                                                         *
 
4
 *                                                                         *
 
5
 *   Copyright (C) 2004 by Scott Wheeler                                   *
 
6
 *   wheeler@kde.org                                                       *
 
7
 *                                                                         *
 
8
 *   This program is free software; you can redistribute it and/or modify  *
 
9
 *   it under the terms of the GNU General Public License as published by  *
 
10
 *   the Free Software Foundation; either version 2 of the License, or     *
 
11
 *   (at your option) any later version.                                   *
 
12
 *                                                                         *
 
13
 ***************************************************************************/
 
14
 
 
15
#include <kactioncollection.h>
 
16
#include <kdebug.h>
 
17
 
 
18
#include "actioncollection.h"
 
19
 
 
20
namespace ActionCollection
 
21
{
 
22
    KActionCollection *actions()
 
23
    {
 
24
        static KActionCollection * a =
 
25
            new KActionCollection( static_cast<QWidget *>( 0 ), "DataKiosk Action Collection" );
 
26
        return a;
 
27
    }
 
28
 
 
29
    KAction *action( const char *key )
 
30
    {
 
31
#ifndef NO_DEBUG
 
32
        KAction * a = actions() ->action( key );
 
33
        if ( !a )
 
34
            kdWarning( 65432 ) << "KAction \"" << key << "\" is not defined yet." << endl;
 
35
        return a;
 
36
#else
 
37
 
 
38
        return actions() ->action( key );
 
39
#endif
 
40
 
 
41
    }
 
42
}