KDECore
kstandarddirs_win.cpp
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2007 Bernhard Loos <nhuh.put@web.de> 00003 Copyright (C) 2008 Christian Ehrlicher <ch.ehrlicher@gmx.de> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License version 2 as published by the Free Software Foundation. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 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() + QLatin1String("include/"); 00068 break; 00069 case 'l': 00070 if (strcmp("lib", type) == 0) 00071 return prefix() + QLatin1String("lib" KDELIBSUFF "/"); 00072 if (strcmp("libexec", type) == 0) 00073 return prefix() + QLatin1String("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 }
KDE 4.6 API Reference