add more spacing
[personal-kdebase.git] / runtime / platforms / win / kwinstartmenu / winstartmenu.cpp
blob6e3121e278a5a08a526b72a0e3a4da6aec29b13a
1 /* This file is part of the KDE project
3 Copyright (C) 2008 Ralf Habacker <ralf.habacker@freenet.de>
4 All rights reserved.
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
22 #include "winstartmenu.h"
23 #include "winstartmenu_adaptor.h"
24 #include "misc.h"
26 #include <kconfig.h>
27 #include <kconfiggroup.h>
28 #include <kdebug.h>
29 #include <kpluginfactory.h>
30 #include <kpluginloader.h>
31 #include <kstandarddirs.h>
32 #include <ksycoca.h>
34 K_PLUGIN_FACTORY(WinStartMenuFactory,
35 registerPlugin<WinStartMenuModule>();
37 K_EXPORT_PLUGIN(WinStartMenuFactory("WinStartMenu"))
40 struct WinStartMenuModulePrivate
42 WinStartMenuModulePrivate()
43 : config("kwinstartmenurc")
46 virtual ~WinStartMenuModulePrivate()
50 KConfig config;
53 WinStartMenuModule::WinStartMenuModule(QObject* parent, const QList<QVariant>&)
54 : KDEDModule(parent)
55 , d( new WinStartMenuModulePrivate )
57 KConfigGroup group( &d->config, "General" );
59 if (group.readEntry("Enabled", true))
60 connect(KSycoca::self(), SIGNAL(databaseChanged()), this, SLOT(databaseChanged()));
62 new WinStartMenuAdaptor( this );
65 WinStartMenuModule::~WinStartMenuModule()
67 disconnect(KSycoca::self(), SIGNAL(databaseChanged()), this, SLOT(databaseChanged()));
68 delete d;
71 void WinStartMenuModule::databaseChanged()
73 kDebug() << "database changed";
74 createStartMenuEntries();
77 void WinStartMenuModule::removeStartMenuEntries()
79 removeDirectory(getKDEStartMenuPath());
82 void WinStartMenuModule::createStartMenuEntries()
84 updateStartMenuLinks();
87 #include "winstartmenu.moc"
89 // vim: ts=4 sw=4 et