2
* Copyright 2006 Aaron Seigo <aseigo@kde.org>
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Library General Public License version 2
6
* published by the Free Software Foundation
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details
13
* You should have received a copy of the GNU Library General Public
14
* License along with this program; if not, write to the
15
* Free Software Foundation, Inc.,
16
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
#include <QApplication>
22
#include <KComponentData>
24
#include <KConfigGroup>
26
#include <KStandardDirs>
30
void migrateAppletsrc()
32
QString oldRc = KStandardDirs::locateLocal("config", "plasma-appletsrc");
34
if (oldRc.isEmpty() || !QFile::exists(oldRc)) {
35
//kDebug() << oldRc << "doesn't exist!";
39
QString newRc = KStandardDirs::locateLocal("config", "plasma-desktop-appletsrc");
41
if (QFile::exists(newRc)) {
42
//kDebug() << newRc << "exists!";
46
//kDebug() << "move" << oldRc << "to" << newRc;
47
KIO::FileCopyJob *job = KIO::file_move(oldRc, newRc);
51
void migratePlasmarc()
53
QString oldRc = KStandardDirs::locateLocal("config", "plasmarc");
55
if (oldRc.isEmpty() || !QFile::exists(oldRc)) {
56
//kDebug() << oldRc << "doesn't exist!";
60
QString newRc = KStandardDirs::locateLocal("config", "plasma-desktoprc");
62
if (QFile::exists(newRc)) {
63
//kDebug() << newRc << "exists!";
67
KIO::FileCopyJob *job = KIO::file_copy(oldRc, newRc);
69
//kDebug() << "opening up" << oldRc << "for" << newRc;
70
KConfig newConfig("plasma-desktoprc", KConfig::NoGlobals);
72
foreach (const QString &group, newConfig.groupList()) {
74
if (group.startsWith("Theme") || group == "CachePolicies") {
75
KConfigGroup newGroup(&newConfig, group);
76
newGroup.deleteGroup();
81
int main(int argc, char *argv[])
83
KComponentData cd("plasma-to-plasma-desktop");
84
QApplication app(argc, argv);