1
/* This file is part of the KDE libraries
2
Copyright (C) 2007 Bernhard Loos <nhuh.put@web.de>
3
Copyright (C) 2008 Christian Ehrlicher <ch.ehrlicher@gmx.de>
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License version 2 as published by the Free Software Foundation.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
Boston, MA 02110-1301, USA.
20
#include "kstandarddirs.h"
22
#include <config-prefix.h>
24
#include "kkernel_win.h"
26
QString getKde4Prefix();
28
inline QString prefix() { return getKde4Prefix(); }
29
inline QString share() { return getKde4Prefix() + QLatin1String("share/"); }
30
inline QString kde_moduledir() { return getKde4Prefix() + QLatin1String("lib/kde4/"); }
32
QString KStandardDirs::installPath(const char *type)
34
Q_ASSERT(type != NULL);
38
if (strcmp("apps", type) == 0)
39
return share() + QLatin1String("applnk/");
42
if (strcmp("config", type) == 0)
43
return share() + QLatin1String("config/");
46
if (strcmp("kcfg", type) == 0)
47
return share() + QLatin1String("config.kcfg/");
48
if (strcmp("kdedir", type) == 0)
52
if (strcmp("data", type) == 0)
53
return share() + QLatin1String("apps/");
56
if (strcmp("exe", type) == 0)
57
return prefix() + QLatin1String("bin/");
60
if (strcmp("html", type) == 0)
61
return share() + QLatin1String("doc/HTML/");
64
if (strcmp("icon", type) == 0)
65
return share() + QLatin1String("icons/");
66
if (strcmp("include", type) == 0)
67
return prefix() + QLatin1String("include/");
70
if (strcmp("lib", type) == 0)
71
return prefix() + QLatin1String("lib" KDELIBSUFF "/");
72
if (strcmp("libexec", type) == 0)
73
return prefix() + QLatin1String("lib" KDELIBSUFF "/kde4/libexec/");
74
if (strcmp("locale", type) == 0)
75
return share() + QLatin1String("locale/");
78
if (strcmp("module", type) == 0)
79
return kde_moduledir();
80
if (strcmp("mime", type) == 0)
81
return share() + QLatin1String("mimelnk/");
84
if (strcmp("qtplugins", type) == 0)
85
return kde_moduledir() + QLatin1String("plugins/");
88
if (strcmp("services", type) == 0)
89
return share() + QLatin1String("kde4/services/");
90
if (strcmp("servicetypes", type) == 0)
91
return share() + QLatin1String("kde4/servicetypes/");
92
if (strcmp("sound", type) == 0)
93
return share() + QLatin1String("sounds/");
96
if (strcmp("templates", type) == 0)
97
return share() + QLatin1String("templates/");
100
if (strcmp("wallpaper", type) == 0)
101
return share() + QLatin1String("wallpapers/");
104
if (strcmp("xdgconf-menu", type) == 0)
105
return share() + QLatin1String("xdg/menus/");
106
if (strcmp("xdgdata-apps", type) == 0)
107
return share() + QLatin1String("applications/kde4/");
108
if (strcmp("xdgdata-dirs", type) == 0)
109
return share() + QLatin1String("desktop-directories/");