author | ulf69 <ulf69> | 2004-08-05 21:42:29 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-05 21:42:29 (UTC) |
commit | 6ee7d4f5119837f89ec534c8c5c73845d521e135 (patch) (unidiff) | |
tree | 265d25e37da63a00ae3302059c2c628efb57b570 | |
parent | c3a704f5acda9cf9fee66e5c0b1b864f3b7dd852 (diff) | |
download | kdepimpi-6ee7d4f5119837f89ec534c8c5c73845d521e135.zip kdepimpi-6ee7d4f5119837f89ec534c8c5c73845d521e135.tar.gz kdepimpi-6ee7d4f5119837f89ec534c8c5c73845d521e135.tar.bz2 |
added tmp as a resourcetype. KDE handled tmp differently, but we do not need
the special handling. So i simply added it as standard resource type
-rw-r--r-- | microkde/kdecore/kstandarddirs.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/microkde/kdecore/kstandarddirs.cpp b/microkde/kdecore/kstandarddirs.cpp index e1c78f6..75205d6 100644 --- a/microkde/kdecore/kstandarddirs.cpp +++ b/microkde/kdecore/kstandarddirs.cpp | |||
@@ -46,97 +46,97 @@ | |||
46 | 46 | ||
47 | #include <qstringlist.h> | 47 | #include <qstringlist.h> |
48 | 48 | ||
49 | #include "kstandarddirs.h" | 49 | #include "kstandarddirs.h" |
50 | #include "kconfig.h" | 50 | #include "kconfig.h" |
51 | #include "kdebug.h" | 51 | #include "kdebug.h" |
52 | //US #include "kinstance.h" | 52 | //US #include "kinstance.h" |
53 | #include "kshell.h" | 53 | #include "kshell.h" |
54 | //US#include <sys/param.h> | 54 | //US#include <sys/param.h> |
55 | //US#include <unistd.h> | 55 | //US#include <unistd.h> |
56 | 56 | ||
57 | //US | 57 | //US |
58 | QString KStandardDirs::mAppDir = QString::null; | 58 | QString KStandardDirs::mAppDir = QString::null; |
59 | 59 | ||
60 | 60 | ||
61 | template class QDict<QStringList>; | 61 | template class QDict<QStringList>; |
62 | 62 | ||
63 | #if 0 | 63 | #if 0 |
64 | #include <qtextedit.h> | 64 | #include <qtextedit.h> |
65 | void ddd( QString op ) | 65 | void ddd( QString op ) |
66 | { | 66 | { |
67 | static QTextEdit * dot = 0; | 67 | static QTextEdit * dot = 0; |
68 | if ( ! dot ) | 68 | if ( ! dot ) |
69 | dot = new QTextEdit(); | 69 | dot = new QTextEdit(); |
70 | 70 | ||
71 | dot->show(); | 71 | dot->show(); |
72 | 72 | ||
73 | dot->append( op ); | 73 | dot->append( op ); |
74 | 74 | ||
75 | } | 75 | } |
76 | #endif | 76 | #endif |
77 | class KStandardDirs::KStandardDirsPrivate | 77 | class KStandardDirs::KStandardDirsPrivate |
78 | { | 78 | { |
79 | public: | 79 | public: |
80 | KStandardDirsPrivate() | 80 | KStandardDirsPrivate() |
81 | : restrictionsActive(false), | 81 | : restrictionsActive(false), |
82 | dataRestrictionActive(false) | 82 | dataRestrictionActive(false) |
83 | { } | 83 | { } |
84 | 84 | ||
85 | bool restrictionsActive; | 85 | bool restrictionsActive; |
86 | bool dataRestrictionActive; | 86 | bool dataRestrictionActive; |
87 | QAsciiDict<bool> restrictions; | 87 | QAsciiDict<bool> restrictions; |
88 | QStringList xdgdata_prefixes; | 88 | QStringList xdgdata_prefixes; |
89 | QStringList xdgconf_prefixes; | 89 | QStringList xdgconf_prefixes; |
90 | }; | 90 | }; |
91 | 91 | ||
92 | static const char* const types[] = {"html", "icon", "apps", "sound", | 92 | static const char* const types[] = {"html", "icon", "apps", "sound", |
93 | "data", "locale", "services", "mime", | 93 | "data", "locale", "services", "mime", |
94 | "servicetypes", "config", "exe", | 94 | "servicetypes", "config", "exe", "tmp", |
95 | "wallpaper", "lib", "pixmap", "templates", | 95 | "wallpaper", "lib", "pixmap", "templates", |
96 | "module", "qtplugins", | 96 | "module", "qtplugins", |
97 | "xdgdata-apps", "xdgdata-dirs", "xdgconf-menu", 0 }; | 97 | "xdgdata-apps", "xdgdata-dirs", "xdgconf-menu", 0 }; |
98 | 98 | ||
99 | static int tokenize( QStringList& token, const QString& str, | 99 | static int tokenize( QStringList& token, const QString& str, |
100 | const QString& delim ); | 100 | const QString& delim ); |
101 | 101 | ||
102 | KStandardDirs::KStandardDirs( ) : addedCustoms(false) | 102 | KStandardDirs::KStandardDirs( ) : addedCustoms(false) |
103 | { | 103 | { |
104 | d = new KStandardDirsPrivate; | 104 | d = new KStandardDirsPrivate; |
105 | dircache.setAutoDelete(true); | 105 | dircache.setAutoDelete(true); |
106 | relatives.setAutoDelete(true); | 106 | relatives.setAutoDelete(true); |
107 | absolutes.setAutoDelete(true); | 107 | absolutes.setAutoDelete(true); |
108 | savelocations.setAutoDelete(true); | 108 | savelocations.setAutoDelete(true); |
109 | addKDEDefaults(); | 109 | addKDEDefaults(); |
110 | } | 110 | } |
111 | 111 | ||
112 | KStandardDirs::~KStandardDirs() | 112 | KStandardDirs::~KStandardDirs() |
113 | { | 113 | { |
114 | delete d; | 114 | delete d; |
115 | } | 115 | } |
116 | 116 | ||
117 | bool KStandardDirs::isRestrictedResource(const char *type, const QString& relPath) const | 117 | bool KStandardDirs::isRestrictedResource(const char *type, const QString& relPath) const |
118 | { | 118 | { |
119 | if (!d || !d->restrictionsActive) | 119 | if (!d || !d->restrictionsActive) |
120 | return false; | 120 | return false; |
121 | 121 | ||
122 | if (d->restrictions[type]) | 122 | if (d->restrictions[type]) |
123 | return true; | 123 | return true; |
124 | 124 | ||
125 | if (strcmp(type, "data")==0) | 125 | if (strcmp(type, "data")==0) |
126 | { | 126 | { |
127 | applyDataRestrictions(relPath); | 127 | applyDataRestrictions(relPath); |
128 | if (d->dataRestrictionActive) | 128 | if (d->dataRestrictionActive) |
129 | { | 129 | { |
130 | d->dataRestrictionActive = false; | 130 | d->dataRestrictionActive = false; |
131 | return true; | 131 | return true; |
132 | } | 132 | } |
133 | } | 133 | } |
134 | return false; | 134 | return false; |
135 | } | 135 | } |
136 | 136 | ||
137 | void KStandardDirs::applyDataRestrictions(const QString &relPath) const | 137 | void KStandardDirs::applyDataRestrictions(const QString &relPath) const |
138 | { | 138 | { |
139 | QString key; | 139 | QString key; |
140 | int i = relPath.find('/'); | 140 | int i = relPath.find('/'); |
141 | if (i != -1) | 141 | if (i != -1) |
142 | key = "data_"+relPath.left(i); | 142 | key = "data_"+relPath.left(i); |