summaryrefslogtreecommitdiffabout
path: root/microkde
authorulf69 <ulf69>2004-08-05 21:44:59 (UTC)
committer ulf69 <ulf69>2004-08-05 21:44:59 (UTC)
commitbb1dd236b41cbd5cc4aed3b320801aa07974122d (patch) (unidiff)
tree4d07c4fc759d2926c8a48e49af59448d46a35a7b /microkde
parent6ee7d4f5119837f89ec534c8c5c73845d521e135 (diff)
downloadkdepimpi-bb1dd236b41cbd5cc4aed3b320801aa07974122d.zip
kdepimpi-bb1dd236b41cbd5cc4aed3b320801aa07974122d.tar.gz
kdepimpi-bb1dd236b41cbd5cc4aed3b320801aa07974122d.tar.bz2
additional change for the tmp resourcetype
Diffstat (limited to 'microkde') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdecore/kstandarddirs.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/microkde/kdecore/kstandarddirs.cpp b/microkde/kdecore/kstandarddirs.cpp
index 75205d6..500426b 100644
--- a/microkde/kdecore/kstandarddirs.cpp
+++ b/microkde/kdecore/kstandarddirs.cpp
@@ -945,96 +945,99 @@ static int tokenize( QStringList& tokens, const QString& str,
945 } 945 }
946 946
947 return tokens.count(); 947 return tokens.count();
948} 948}
949 949
950QString KStandardDirs::kde_default(const char *type) { 950QString KStandardDirs::kde_default(const char *type) {
951 if (!strcmp(type, "data")) 951 if (!strcmp(type, "data"))
952 return "apps/"; 952 return "apps/";
953 if (!strcmp(type, "html")) 953 if (!strcmp(type, "html"))
954 return "share/doc/HTML/"; 954 return "share/doc/HTML/";
955 if (!strcmp(type, "icon")) 955 if (!strcmp(type, "icon"))
956 return "share/icons/"; 956 return "share/icons/";
957 if (!strcmp(type, "config")) 957 if (!strcmp(type, "config"))
958 return "config/"; 958 return "config/";
959 if (!strcmp(type, "pixmap")) 959 if (!strcmp(type, "pixmap"))
960 return "share/pixmaps/"; 960 return "share/pixmaps/";
961 if (!strcmp(type, "apps")) 961 if (!strcmp(type, "apps"))
962 return "share/applnk/"; 962 return "share/applnk/";
963 if (!strcmp(type, "sound")) 963 if (!strcmp(type, "sound"))
964 return "share/sounds/"; 964 return "share/sounds/";
965 if (!strcmp(type, "locale")) 965 if (!strcmp(type, "locale"))
966 return "share/locale/"; 966 return "share/locale/";
967 if (!strcmp(type, "services")) 967 if (!strcmp(type, "services"))
968 return "share/services/"; 968 return "share/services/";
969 if (!strcmp(type, "servicetypes")) 969 if (!strcmp(type, "servicetypes"))
970 return "share/servicetypes/"; 970 return "share/servicetypes/";
971 if (!strcmp(type, "mime")) 971 if (!strcmp(type, "mime"))
972 return "share/mimelnk/"; 972 return "share/mimelnk/";
973 if (!strcmp(type, "cgi")) 973 if (!strcmp(type, "cgi"))
974 return "cgi-bin/"; 974 return "cgi-bin/";
975 if (!strcmp(type, "wallpaper")) 975 if (!strcmp(type, "wallpaper"))
976 return "share/wallpapers/"; 976 return "share/wallpapers/";
977 if (!strcmp(type, "templates")) 977 if (!strcmp(type, "templates"))
978 return "share/templates/"; 978 return "share/templates/";
979 if (!strcmp(type, "exe")) 979 if (!strcmp(type, "exe"))
980 return "bin/"; 980 return "bin/";
981 if (!strcmp(type, "lib")) 981 if (!strcmp(type, "lib"))
982 return "lib/"; 982 return "lib/";
983 if (!strcmp(type, "module")) 983 if (!strcmp(type, "module"))
984 return "lib/kde3/"; 984 return "lib/kde3/";
985 if (!strcmp(type, "qtplugins")) 985 if (!strcmp(type, "qtplugins"))
986 return "lib/kde3/plugins"; 986 return "lib/kde3/plugins";
987 if (!strcmp(type, "xdgdata-apps")) 987 if (!strcmp(type, "xdgdata-apps"))
988 return "applications/"; 988 return "applications/";
989 if (!strcmp(type, "xdgdata-dirs")) 989 if (!strcmp(type, "xdgdata-dirs"))
990 return "desktop-directories/"; 990 return "desktop-directories/";
991 if (!strcmp(type, "xdgconf-menu")) 991 if (!strcmp(type, "xdgconf-menu"))
992 return "menus/"; 992 return "menus/";
993 if (!strcmp(type, "tmp"))
994 return "tmp/";
995
993 qFatal("unknown resource type %s", type); 996 qFatal("unknown resource type %s", type);
994 return QString::null; 997 return QString::null;
995} 998}
996 999
997QString KStandardDirs::saveLocation(const char *type, 1000QString KStandardDirs::saveLocation(const char *type,
998 const QString& suffix, 1001 const QString& suffix,
999 bool create) const 1002 bool create) const
1000{ 1003{
1001 //qDebug("KStandardDirs::saveLocation called %s %s", type,suffix.latin1() ); 1004 //qDebug("KStandardDirs::saveLocation called %s %s", type,suffix.latin1() );
1002 //return ""; 1005 //return "";
1003 checkConfig(); 1006 checkConfig();
1004 1007
1005 QString *pPath = savelocations.find(type); 1008 QString *pPath = savelocations.find(type);
1006 if (!pPath) 1009 if (!pPath)
1007 { 1010 {
1008 QStringList *dirs = relatives.find(type); 1011 QStringList *dirs = relatives.find(type);
1009 if (!dirs && ( 1012 if (!dirs && (
1010 (strcmp(type, "socket") == 0) || 1013 (strcmp(type, "socket") == 0) ||
1011 (strcmp(type, "tmp") == 0) || 1014 (strcmp(type, "tmp") == 0) ||
1012 (strcmp(type, "cache") == 0) )) 1015 (strcmp(type, "cache") == 0) ))
1013 { 1016 {
1014 (void) resourceDirs(type); // Generate socket|tmp|cache resource. 1017 (void) resourceDirs(type); // Generate socket|tmp|cache resource.
1015 dirs = relatives.find(type); // Search again. 1018 dirs = relatives.find(type); // Search again.
1016 } 1019 }
1017 if (dirs) 1020 if (dirs)
1018 { 1021 {
1019 // Check for existance of typed directory + suffix 1022 // Check for existance of typed directory + suffix
1020 if (strncmp(type, "xdgdata-", 8) == 0) 1023 if (strncmp(type, "xdgdata-", 8) == 0)
1021 pPath = new QString(realPath(localxdgdatadir() + dirs->last())); 1024 pPath = new QString(realPath(localxdgdatadir() + dirs->last()));
1022 else if (strncmp(type, "xdgconf-", 8) == 0) 1025 else if (strncmp(type, "xdgconf-", 8) == 0)
1023 pPath = new QString(realPath(localxdgconfdir() + dirs->last())); 1026 pPath = new QString(realPath(localxdgconfdir() + dirs->last()));
1024 else 1027 else
1025 pPath = new QString(realPath(localkdedir() + dirs->last())); 1028 pPath = new QString(realPath(localkdedir() + dirs->last()));
1026 } 1029 }
1027 else { 1030 else {
1028 dirs = absolutes.find(type); 1031 dirs = absolutes.find(type);
1029 if (!dirs) 1032 if (!dirs)
1030 qFatal("KStandardDirs: The resource type %s is not registered", type); 1033 qFatal("KStandardDirs: The resource type %s is not registered", type);
1031 pPath = new QString(realPath(dirs->last())); 1034 pPath = new QString(realPath(dirs->last()));
1032 } 1035 }
1033 1036
1034 savelocations.insert(type, pPath); 1037 savelocations.insert(type, pPath);
1035 } 1038 }
1036 1039
1037 QString fullPath = *pPath + suffix; 1040 QString fullPath = *pPath + suffix;
1038//US struct stat st; 1041//US struct stat st;
1039//US if (stat(QFile::encodeName(fullPath), &st) != 0 || !(S_ISDIR(st.st_mode))) 1042//US if (stat(QFile::encodeName(fullPath), &st) != 0 || !(S_ISDIR(st.st_mode)))
1040 QFileInfo fullPathInfo(QFile::encodeName(fullPath)); 1043 QFileInfo fullPathInfo(QFile::encodeName(fullPath));