• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • kdecore
  • kernel
kstandarddirs_unix.cpp
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 2007 Bernhard Loos <nhuh.put@web.de>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*/
18
19#include "kstandarddirs.h"
20
21#include <config-prefix.h>
22#include <config.h>
23#include <QFile>
24
25QString KStandardDirs::installPath(const char *type)
26{
27 Q_ASSERT(type != NULL);
28
29 switch (type[0]) {
30 case 'a':
31 if (strcmp("apps", type) == 0)
32 return QFile::decodeName(APPLNK_INSTALL_DIR "/");
33 break;
34 case 'c':
35 if (strcmp("config", type) == 0)
36 return QFile::decodeName(CONFIG_INSTALL_DIR "/");
37 break;
38 case 'k':
39 if (strcmp("kcfg", type) == 0)
40 return QFile::decodeName(KCFG_INSTALL_DIR "/");
41 if (strcmp("kdedir", type) == 0)
42 return QFile::decodeName(KDEDIR "/");
43 break;
44 case 'd':
45 if (strcmp("data", type) == 0)
46 return QFile::decodeName(DATA_INSTALL_DIR "/");
47 break;
48 case 'e':
49 if (strcmp("exe", type) == 0)
50 return QFile::decodeName(BIN_INSTALL_DIR "/");
51 break;
52 case 'h':
53 if (strcmp("html", type) == 0)
54 return QFile::decodeName(HTML_INSTALL_DIR "/");
55 break;
56 case 'i':
57 if (strcmp("icon", type) == 0)
58 return QFile::decodeName(ICON_INSTALL_DIR "/");
59 if (strcmp("include", type) == 0)
60 return QFile::decodeName(INCLUDE_INSTALL_DIR "/");
61 break;
62 case 'l':
63 if (strcmp("lib", type) == 0)
64 return QFile::decodeName(LIB_INSTALL_DIR "/");
65 if (strcmp("libexec", type) == 0)
66 return QFile::decodeName(LIBEXEC_INSTALL_DIR "/");
67 if (strcmp("locale", type) == 0)
68 return QFile::decodeName(LOCALE_INSTALL_DIR "/");
69 break;
70 case 'm':
71 if (strcmp("module", type) == 0)
72 return QFile::decodeName(PLUGIN_INSTALL_DIR "/");
73 if (strcmp("mime", type) == 0)
74 return QFile::decodeName(MIME_INSTALL_DIR "/");
75 break;
76 case 'q':
77 if (strcmp("qtplugins", type) == 0)
78 return QFile::decodeName(PLUGIN_INSTALL_DIR "/plugins/");
79 break;
80 case 's':
81 if (strcmp("services", type) == 0)
82 return QFile::decodeName(SERVICES_INSTALL_DIR "/");
83 if (strcmp("servicetypes", type) == 0)
84 return QFile::decodeName(SERVICETYPES_INSTALL_DIR "/");
85 if (strcmp("sound", type) == 0)
86 return QFile::decodeName(SOUND_INSTALL_DIR "/");
87 break;
88 case 't':
89 if (strcmp("templates", type) == 0)
90 return QFile::decodeName(TEMPLATES_INSTALL_DIR "/");
91 break;
92 case 'w':
93 if (strcmp("wallpaper", type) == 0)
94 return QFile::decodeName(WALLPAPER_INSTALL_DIR "/");
95 break;
96 case 'x':
97 if (strcmp("xdgconf-menu", type) == 0)
98 return QFile::decodeName(SYSCONF_INSTALL_DIR "/xdg/menus/");
99 if (strcmp("xdgdata-apps", type) == 0)
100 return QFile::decodeName(XDG_APPS_INSTALL_DIR "/");
101 if (strcmp("xdgdata-dirs", type) == 0)
102 return QFile::decodeName(XDG_DIRECTORY_INSTALL_DIR "/");
103 break;
104 }
105 return QString();
106}
KStandardDirs::installPath
static QString installPath(const char *type)
Definition: kstandarddirs_unix.cpp:25
QString
kstandarddirs.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal