• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDECore

kstandarddirs_unix.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 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016    Boston, MA 02110-1301, USA.
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 }

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal