KDECore
kstandarddirs_unix.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "kstandarddirs.h"
00020
00021 #include <config-prefix.h>
00022 #include <config.h>
00023
00024 QString KStandardDirs::installPath(const char *type)
00025 {
00026 Q_ASSERT(type != NULL);
00027
00028 switch (type[0]) {
00029 case 'a':
00030 if (strcmp("apps", type) == 0)
00031 return QString::fromLatin1(APPLNK_INSTALL_DIR "/");
00032 break;
00033 case 'c':
00034 if (strcmp("config", type) == 0)
00035 return QString::fromLatin1(CONFIG_INSTALL_DIR "/");
00036 break;
00037 case 'k':
00038 if (strcmp("kcfg", type) == 0)
00039 return QString::fromLatin1(KCFG_INSTALL_DIR "/");
00040 if (strcmp("kdedir", type) == 0)
00041 return QString::fromLatin1(KDEDIR "/");
00042 break;
00043 case 'd':
00044 if (strcmp("data", type) == 0)
00045 return QString::fromLatin1(DATA_INSTALL_DIR "/");
00046 break;
00047 case 'e':
00048 if (strcmp("exe", type) == 0)
00049 return QString::fromLatin1(BIN_INSTALL_DIR "/");
00050 break;
00051 case 'h':
00052 if (strcmp("html", type) == 0)
00053 return QString::fromLatin1(HTML_INSTALL_DIR "/");
00054 break;
00055 case 'i':
00056 if (strcmp("icon", type) == 0)
00057 return QString::fromLatin1(ICON_INSTALL_DIR "/");
00058 if (strcmp("include", type) == 0)
00059 return QString::fromLatin1(INCLUDE_INSTALL_DIR "/");
00060 break;
00061 case 'l':
00062 if (strcmp("lib", type) == 0)
00063 return QString::fromLatin1(LIB_INSTALL_DIR "/");
00064 if (strcmp("libexec", type) == 0)
00065 return QString::fromLatin1(KDEDIR "/lib" KDELIBSUFF "/kde4/libexec/");
00066 if (strcmp("locale", type) == 0)
00067 return QString::fromLatin1(LOCALE_INSTALL_DIR "/");
00068 break;
00069 case 'm':
00070 if (strcmp("module", type) == 0)
00071 return QString::fromLatin1(PLUGIN_INSTALL_DIR "/");
00072 if (strcmp("mime", type) == 0)
00073 return QString::fromLatin1(MIME_INSTALL_DIR "/");
00074 break;
00075 case 'q':
00076 if (strcmp("qtplugins", type) == 0)
00077 return QString::fromLatin1(PLUGIN_INSTALL_DIR "/plugins/");
00078 break;
00079 case 's':
00080 if (strcmp("services", type) == 0)
00081 return QString::fromLatin1(SERVICES_INSTALL_DIR "/");
00082 if (strcmp("servicetypes", type) == 0)
00083 return QString::fromLatin1(SERVICETYPES_INSTALL_DIR "/");
00084 if (strcmp("sound", type) == 0)
00085 return QString::fromLatin1(SOUND_INSTALL_DIR "/");
00086 break;
00087 case 't':
00088 if (strcmp("templates", type) == 0)
00089 return QString::fromLatin1(TEMPLATES_INSTALL_DIR "/");
00090 break;
00091 case 'w':
00092 if (strcmp("wallpaper", type) == 0)
00093 return QString::fromLatin1(WALLPAPER_INSTALL_DIR "/");
00094 break;
00095 case 'x':
00096 if (strcmp("xdgconf-menu", type) == 0)
00097 return QString::fromLatin1(SYSCONF_INSTALL_DIR "/xdg/menus/");
00098 if (strcmp("xdgdata-apps", type) == 0)
00099 return QString::fromLatin1(XDG_APPS_INSTALL_DIR "/");
00100 if (strcmp("xdgdata-dirs", type) == 0)
00101 return QString::fromLatin1(XDG_DIRECTORY_INSTALL_DIR "/");
00102 break;
00103 }
00104 return QString();
00105 }