summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdecore/kstandarddirs.cpp146
1 files changed, 73 insertions, 73 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
@@ -64,6 +64,6 @@ template class QDict<QStringList>;
64#include <qtextedit.h> 64#include <qtextedit.h>
65void ddd( QString op ) 65void 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();
@@ -93,5 +93,5 @@ 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 };
@@ -360,3 +360,3 @@ QString KStandardDirs::findResourceDir( const char *type,
360#endif 360#endif
361 for (QStringList::ConstIterator it = candidates.begin(); it != candidates.end(); it++) 361 for (QStringList::ConstIterator it = candidates.begin(); it != candidates.end(); it++)
362 { 362 {
@@ -370,3 +370,3 @@ QString KStandardDirs::findResourceDir( const char *type,
370 qDebug("KStdDirs::findResDir(): can't find %s ", filename.latin1()); 370 qDebug("KStdDirs::findResDir(): can't find %s ", filename.latin1());
371 371
372#endif 372#endif
@@ -383,3 +383,3 @@ bool KStandardDirs::exists(const QString &fullPath)
383 if (fullPathInfo.isReadable()) 383 if (fullPathInfo.isReadable())
384 { 384 {
385 if (fullPath.at(fullPath.length() - 1) != '/') { 385 if (fullPath.at(fullPath.length() - 1) != '/') {
@@ -388,6 +388,6 @@ bool KStandardDirs::exists(const QString &fullPath)
388 return true; 388 return true;
389 } 389 }
390 else { 390 else {
391 //US if (S_ISDIR( buff.st_mode )) 391 //US if (S_ISDIR( buff.st_mode ))
392 if (fullPathInfo.isDir()) 392 if (fullPathInfo.isDir())
393 return true; 393 return true;
@@ -410,3 +410,3 @@ static void lookupDirectory(const QString& path, const QString &relPart,
410 QDir dp(QFile::encodeName(path)); 410 QDir dp(QFile::encodeName(path));
411 411
412 if (!dp.exists()) 412 if (!dp.exists())
@@ -428,6 +428,6 @@ static void lookupDirectory(const QString& path, const QString &relPart,
428 QStringList::Iterator it = direntries.begin(); 428 QStringList::Iterator it = direntries.begin();
429 429
430 while ( it != list.end() ) // for each file... 430 while ( it != list.end() ) // for each file...
431 { 431 {
432 432
433//US QString fn( QFile::decodeName(ep->d_name)); 433//US QString fn( QFile::decodeName(ep->d_name));
@@ -437,3 +437,3 @@ static void lookupDirectory(const QString& path, const QString &relPart,
437 break; 437 break;
438 438
439 if (fn == _dot || fn == _dotdot || fn.at(fn.length() - 1).latin1() == '~' ) 439 if (fn == _dot || fn == _dotdot || fn.at(fn.length() - 1).latin1() == '~' )
@@ -451,3 +451,3 @@ static void lookupDirectory(const QString& path, const QString &relPart,
451 QString pathfn = path + fn; 451 QString pathfn = path + fn;
452/*US 452/*US
453 if ( stat( QFile::encodeName(pathfn), &buff ) != 0 ) { 453 if ( stat( QFile::encodeName(pathfn), &buff ) != 0 ) {
@@ -456,4 +456,4 @@ static void lookupDirectory(const QString& path, const QString &relPart,
456 } 456 }
457 457
458 if ( recursive ) 458 if ( recursive )
459 { 459 {
@@ -470,4 +470,4 @@ static void lookupDirectory(const QString& path, const QString &relPart,
470 } 470 }
471 471
472 if ( recursive ) 472 if ( recursive )
473 { 473 {
@@ -476,5 +476,5 @@ static void lookupDirectory(const QString& path, const QString &relPart,
476 } 476 }
477 477
478 478
479/*US 479/*US
480 if (!regexp.exactMatch(fn)) 480 if (!regexp.exactMatch(fn))
@@ -512,3 +512,3 @@ static void lookupDirectory(const QString& path, const QString &relPart,
512 return; // File not found 512 return; // File not found
513 513
514//US if ( S_ISREG( buff.st_mode)) 514//US if ( S_ISREG( buff.st_mode))
@@ -558,4 +558,4 @@ static void lookupPrefix(const QString& prefix, const QString& relpath,
558 QDir dp(QFile::encodeName(prefix)); 558 QDir dp(QFile::encodeName(prefix));
559 559
560 //USif (!dp) 560 //USif (!dp)
561 if (!dp.exists()) 561 if (!dp.exists())
@@ -573,3 +573,3 @@ static void lookupPrefix(const QString& prefix, const QString& relpath,
573 QStringList::Iterator it = direntries.begin(); 573 QStringList::Iterator it = direntries.begin();
574 574
575 while ( it != list.end() ) // for each file... 575 while ( it != list.end() ) // for each file...
@@ -579,3 +579,3 @@ static void lookupPrefix(const QString& prefix, const QString& relpath,
579 it++; 579 it++;
580 580
581 if (fn == _dot || fn == _dotdot || fn.at(fn.length() - 1) == '~') 581 if (fn == _dot || fn == _dotdot || fn.at(fn.length() - 1) == '~')
@@ -604,3 +604,3 @@ static void lookupPrefix(const QString& prefix, const QString& relpath,
604 if ( fnInfo.isDir() ) 604 if ( fnInfo.isDir() )
605 605
606 lookupPrefix(fn + '/', rest, rfn + '/', regexp, list, relList, recursive, uniq); 606 lookupPrefix(fn + '/', rest, rfn + '/', regexp, list, relList, recursive, uniq);
@@ -673,3 +673,3 @@ KStandardDirs::findAllResources( const char *type,
673 673
674QString 674QString
675KStandardDirs::realPath(const QString &dirname) 675KStandardDirs::realPath(const QString &dirname)
@@ -734,3 +734,3 @@ QStringList KStandardDirs::resourceDirs(const char *type) const
734 if (!candidates) { // filling cache 734 if (!candidates) { // filling cache
735/*US 735/*US
736 if (strcmp(type, "socket") == 0) 736 if (strcmp(type, "socket") == 0)
@@ -770,3 +770,3 @@ QStringList KStandardDirs::resourceDirs(const char *type) const
770 prefixList = &prefixes; 770 prefixList = &prefixes;
771 771
772 for (QStringList::ConstIterator pit = prefixList->begin(); 772 for (QStringList::ConstIterator pit = prefixList->begin();
@@ -837,3 +837,3 @@ QString KStandardDirs::findExe( const QString& appname,
837 qDebug("KStandardDirs::findExe this is probably wrong"); 837 qDebug("KStandardDirs::findExe this is probably wrong");
838 838
839 info.setFile( p ); 839 info.setFile( p );
@@ -1009,3 +1009,3 @@ QString KStandardDirs::saveLocation(const char *type,
1009 if (!dirs && ( 1009 if (!dirs && (
1010 (strcmp(type, "socket") == 0) || 1010 (strcmp(type, "socket") == 0) ||
1011 (strcmp(type, "tmp") == 0) || 1011 (strcmp(type, "tmp") == 0) ||
@@ -1032,13 +1032,13 @@ QString KStandardDirs::saveLocation(const char *type,
1032 } 1032 }
1033 1033
1034 savelocations.insert(type, pPath); 1034 savelocations.insert(type, pPath);
1035 } 1035 }
1036 1036
1037 QString fullPath = *pPath + suffix; 1037 QString fullPath = *pPath + suffix;
1038//US struct stat st; 1038//US struct stat st;
1039//US if (stat(QFile::encodeName(fullPath), &st) != 0 || !(S_ISDIR(st.st_mode))) 1039//US if (stat(QFile::encodeName(fullPath), &st) != 0 || !(S_ISDIR(st.st_mode)))
1040 QFileInfo fullPathInfo(QFile::encodeName(fullPath)); 1040 QFileInfo fullPathInfo(QFile::encodeName(fullPath));
1041 if (fullPathInfo.isReadable() || !fullPathInfo.isDir()) 1041 if (fullPathInfo.isReadable() || !fullPathInfo.isDir())
1042 1042
1043 1043
1044 { 1044 {
@@ -1137,3 +1137,3 @@ bool KStandardDirs::makeDir(const QString& dir2, int mode)
1137 1137
1138 1138
1139 // we want an absolute path 1139 // we want an absolute path
@@ -1143,3 +1143,3 @@ bool KStandardDirs::makeDir(const QString& dir2, int mode)
1143#endif 1143#endif
1144 1144
1145 QString target = dir; 1145 QString target = dir;
@@ -1167,3 +1167,3 @@ bool KStandardDirs::makeDir(const QString& dir2, int mode)
1167 //QMessageBox::information( 0,"cap111", base, 1 ); 1167 //QMessageBox::information( 0,"cap111", base, 1 );
1168/*US 1168/*US
1169 QCString baseEncoded = QFile::encodeName(base); 1169 QCString baseEncoded = QFile::encodeName(base);
@@ -1176,3 +1176,3 @@ bool KStandardDirs::makeDir(const QString& dir2, int mode)
1176 (void)unlink(baseEncoded); // try removing 1176 (void)unlink(baseEncoded); // try removing
1177 1177
1178 1178
@@ -1183,4 +1183,4 @@ bool KStandardDirs::makeDir(const QString& dir2, int mode)
1183 } 1183 }
1184*/ 1184*/
1185 1185
1186 if (dirObj.exists(base) == false) 1186 if (dirObj.exists(base) == false)
@@ -1235,3 +1235,3 @@ void KStandardDirs::addKDEDefaults()
1235//US kdedirList.append(KDEDIR); 1235//US kdedirList.append(KDEDIR);
1236//US for embedded, add qtopia dir as kdedir 1236//US for embedded, add qtopia dir as kdedir
1237 1237
@@ -1248,3 +1248,3 @@ void KStandardDirs::addKDEDefaults()
1248 QString localKdeDir; 1248 QString localKdeDir;
1249 1249
1250//US if (getuid()) 1250//US if (getuid())
@@ -1277,3 +1277,3 @@ void KStandardDirs::addKDEDefaults()
1277//US localKdeDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.microkde/"; 1277//US localKdeDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.microkde/";
1278 qDebug("KStandardDirs::addKDEDefaults: 1 has to be fixed"); 1278 qDebug("KStandardDirs::addKDEDefaults: 1 has to be fixed");
1279 } 1279 }
@@ -1285,3 +1285,3 @@ void KStandardDirs::addKDEDefaults()
1285//US 1285//US
1286// qDebug("KStandardDirs::addKDEDefaults: localKdeDir=%s", localKdeDir.latin1()); 1286// qDebug("KStandardDirs::addKDEDefaults: localKdeDir=%s", localKdeDir.latin1());
1287 if (localKdeDir != "-/") 1287 if (localKdeDir != "-/")
@@ -1330,3 +1330,3 @@ void KStandardDirs::addKDEDefaults()
1330//US localXdgDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.config/"; 1330//US localXdgDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.config/";
1331 qDebug("KStandardDirs::addKDEDefaults: 2 has to be fixed"); 1331 qDebug("KStandardDirs::addKDEDefaults: 2 has to be fixed");
1332 } 1332 }
@@ -1362,3 +1362,3 @@ void KStandardDirs::addKDEDefaults()
1362 } 1362 }
1363 1363
1364 xdgdirList.append("/usr/local/share/"); 1364 xdgdirList.append("/usr/local/share/");
@@ -1384,3 +1384,3 @@ void KStandardDirs::addKDEDefaults()
1384//US localXdgDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.local/share/"; 1384//US localXdgDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.local/share/";
1385 qDebug("KStandardDirs::addKDEDefaults: 3 has to be fixed"); 1385 qDebug("KStandardDirs::addKDEDefaults: 3 has to be fixed");
1386 } 1386 }
@@ -1395,3 +1395,3 @@ void KStandardDirs::addKDEDefaults()
1395 QString dir = KShell::tildeExpand(*it); 1395 QString dir = KShell::tildeExpand(*it);
1396 1396
1397 addXdgDataPrefix(dir); 1397 addXdgDataPrefix(dir);
@@ -1412,3 +1412,3 @@ void KStandardDirs::checkConfig() const
1412{ 1412{
1413/*US 1413/*US
1414 if (!addedCustoms && KGlobal::_instance && KGlobal::_instance->_config) 1414 if (!addedCustoms && KGlobal::_instance && KGlobal::_instance->_config)
@@ -1441,3 +1441,3 @@ bool KStandardDirs::addCustomized(KConfig *config)
1441 // to find entries that start with dir_$type 1441 // to find entries that start with dir_$type
1442/*US 1442/*US
1443 QMap<QString, QString> entries = config->entryMap("Directories"); 1443 QMap<QString, QString> entries = config->entryMap("Directories");
@@ -1503,3 +1503,3 @@ void KStandardDirs::setAppDir( const QString &appDir )
1503 1503
1504 if ( mAppDir.right( 1 ) != "/" ) 1504 if ( mAppDir.right( 1 ) != "/" )
1505 mAppDir += "/"; 1505 mAppDir += "/";
@@ -1508,4 +1508,4 @@ void KStandardDirs::setAppDir( const QString &appDir )
1508QString KStandardDirs::appDir() 1508QString KStandardDirs::appDir()
1509{ 1509{
1510 return mAppDir; 1510 return mAppDir;
1511} 1511}
@@ -1525,3 +1525,3 @@ QString locateLocal( const char *type,
1525 QString path = locateLocal(type, filename, true /*US, inst*/); 1525 QString path = locateLocal(type, filename, true /*US, inst*/);
1526 1526
1527 1527
@@ -1539,3 +1539,3 @@ why not staying with the original directorystructure ?
1539 1539
1540 1540
1541 QString escapedFilename = filename; 1541 QString escapedFilename = filename;
@@ -1549,3 +1549,3 @@ why not staying with the original directorystructure ?
1549*/ 1549*/
1550//US so my proposal is this: 1550//US so my proposal is this:
1551 1551
@@ -1560,9 +1560,9 @@ why not staying with the original directorystructure ?
1560#endif 1560#endif
1561 1561
1562 //US Create the containing dir if needed 1562 //US Create the containing dir if needed
1563 QFileInfo fi ( path ); 1563 QFileInfo fi ( path );
1564 1564
1565 // QString dir=pathurl.directory(); 1565 // QString dir=pathurl.directory();
1566 //QMessageBox::information( 0,"path", path, 1 ); 1566 //QMessageBox::information( 0,"path", path, 1 );
1567 1567
1568#ifdef _WIN32_ 1568#ifdef _WIN32_
@@ -1571,4 +1571,4 @@ why not staying with the original directorystructure ?
1571 KStandardDirs::makeDir(fi.dirPath( true )); 1571 KStandardDirs::makeDir(fi.dirPath( true ));
1572#endif 1572#endif
1573 1573
1574 qDebug("locate22: %s" , path.latin1()); 1574 qDebug("locate22: %s" , path.latin1());
@@ -1577,3 +1577,3 @@ why not staying with the original directorystructure ?
1577#endif 1577#endif
1578 1578
1579} 1579}
@@ -1602,3 +1602,3 @@ why not staying with the original directorystructure ?
1602 1602
1603 1603
1604 QString escapedFilename = filename; 1604 QString escapedFilename = filename;
@@ -1612,3 +1612,3 @@ why not staying with the original directorystructure ?
1612*/ 1612*/
1613//US so my proposal is this: 1613//US so my proposal is this:
1614 1614
@@ -1622,3 +1622,3 @@ why not staying with the original directorystructure ?
1622#endif 1622#endif
1623 1623
1624 //US Create the containing dir if needed 1624 //US Create the containing dir if needed
@@ -1632,4 +1632,4 @@ why not staying with the original directorystructure ?
1632 KStandardDirs::makeDir(dir); 1632 KStandardDirs::makeDir(dir);
1633#endif 1633#endif
1634 1634
1635 return path; 1635 return path;