1 /* This file is part of the KDE project
3 Copyright (C) 2008 Ralf Habacker <ralf.habacker@freenet.de>
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"
27 #include <kconfiggroup.h>
29 #include <kpluginfactory.h>
30 #include <kpluginloader.h>
31 #include <kstandarddirs.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()
53 WinStartMenuModule::WinStartMenuModule(QObject
* parent
, const QList
<QVariant
>&)
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()));
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"