not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / libs / taskmanager / startup.cpp
blob586c01ce2d72972991e95a885c36ab9b2d59dd15
1 /*****************************************************************
3 Copyright (c) 2000-2001 Matthias Elter <elter@kde.org>
4 Copyright (c) 2001 Richard Moore <rich@kde.org>
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 ******************************************************************/
25 // Own
26 #include "startup.h"
28 // Qt
29 #include <QSet>
31 #include "taskmanager.h"
33 namespace TaskManager
36 class Startup::Private
38 public:
39 Private(const KStartupInfoId& id, const KStartupInfoData& data)
40 : id(id), data(data)
44 KStartupInfoId id;
45 KStartupInfoData data;
46 QSet<WId> windowMatches;
49 Startup::Startup(const KStartupInfoId& id, const KStartupInfoData& data,
50 QObject * parent, const char *name)
51 : QObject(parent),
52 d(new Private(id, data))
54 setObjectName( name );
57 Startup::~Startup()
59 delete d;
62 QString Startup::text() const
64 return d->data.findName();
67 QString Startup::bin() const
69 return d->data.bin();
72 QString Startup::icon() const
74 return d->data.findIcon();
77 void Startup::update(const KStartupInfoData& data)
79 d->data.update(data);
80 emit changed(::TaskManager::TaskUnchanged);
83 KStartupInfoId Startup::id() const
85 return d->id;
88 void Startup::addWindowMatch(WId window)
90 d->windowMatches.insert(window);
93 bool Startup::matchesWindow(WId window) const
95 return d->windowMatches.contains(window);
98 } // TaskManager namespace
101 #include "startup.moc"