KDECore
kstandarddirs_win.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
00020 #include "kstandarddirs.h"
00021
00022 #include <config-prefix.h>
00023 #include <config.h>
00024 #include "kkernel_win.h"
00025
00026 QString getKde4Prefix();
00027
00028 inline QString prefix() { return getKde4Prefix(); }
00029 inline QString share() { return getKde4Prefix() + QLatin1String("share/"); }
00030 inline QString kde_moduledir() { return getKde4Prefix() + QLatin1String("lib/kde4/"); }
00031
00032 QString KStandardDirs::installPath(const char *type)
00033 {
00034 Q_ASSERT(type != NULL);
00035
00036 switch (type[0]) {
00037 case 'a':
00038 if (strcmp("apps", type) == 0)
00039 return share() + QLatin1String("applnk/");
00040 break;
00041 case 'c':
00042 if (strcmp("config", type) == 0)
00043 return share() + QLatin1String("config/");
00044 break;
00045 case 'k':
00046 if (strcmp("kcfg", type) == 0)
00047 return share() + QLatin1String("config.kcfg/");
00048 if (strcmp("kdedir", type) == 0)
00049 return prefix();
00050 break;
00051 case 'd':
00052 if (strcmp("data", type) == 0)
00053 return share() + QLatin1String("apps/");
00054 break;
00055 case 'e':
00056 if (strcmp("exe", type) == 0)
00057 return prefix() + QLatin1String("bin/");
00058 break;
00059 case 'h':
00060 if (strcmp("html", type) == 0)
00061 return share() + QLatin1String("doc/HTML/");
00062 break;
00063 case 'i':
00064 if (strcmp("icon", type) == 0)
00065 return share() + QLatin1String("icons/");
00066 if (strcmp("include", type) == 0)
00067 return prefix() + "include";
00068 break;
00069 case 'l':
00070 if (strcmp("lib", type) == 0)
00071 return prefix() + QString::fromLatin1("lib" KDELIBSUFF "/");
00072 if (strcmp("libexec", type) == 0)
00073 return prefix() + QString::fromLatin1("lib" KDELIBSUFF "/kde4/libexec/");
00074 if (strcmp("locale", type) == 0)
00075 return share() + QLatin1String("locale/");
00076 break;
00077 case 'm':
00078 if (strcmp("module", type) == 0)
00079 return kde_moduledir();
00080 if (strcmp("mime", type) == 0)
00081 return share() + QLatin1String("mimelnk/");
00082 break;
00083 case 'q':
00084 if (strcmp("qtplugins", type) == 0)
00085 return kde_moduledir() + QLatin1String("plugins/");
00086 break;
00087 case 's':
00088 if (strcmp("services", type) == 0)
00089 return share() + QLatin1String("kde4/services/");
00090 if (strcmp("servicetypes", type) == 0)
00091 return share() + QLatin1String("kde4/servicetypes/");
00092 if (strcmp("sound", type) == 0)
00093 return share() + QLatin1String("sounds/");
00094 break;
00095 case 't':
00096 if (strcmp("templates", type) == 0)
00097 return share() + QLatin1String("templates/");
00098 break;
00099 case 'w':
00100 if (strcmp("wallpaper", type) == 0)
00101 return share() + QLatin1String("wallpapers/");
00102 break;
00103 case 'x':
00104 if (strcmp("xdgconf-menu", type) == 0)
00105 return share() + QLatin1String("xdg/menus/");
00106 if (strcmp("xdgdata-apps", type) == 0)
00107 return share() + QLatin1String("applications/kde4/");
00108 if (strcmp("xdgdata-dirs", type) == 0)
00109 return share() + QLatin1String("desktop-directories/");
00110 break;
00111 }
00112 return QString();
00113 }