Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37569383
en ru br
Репозитории ALT
5.1: 4.4.5-alt0.M51.1
4.1: 4.1.3-alt1.M41.1
www.altlinux.org/Changes

Группа :: Система/Библиотеки
Пакет: kde4libs

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: kdelibs-4.1.96-alt-exists_ext.patch
Скачать


--- kdelibs-4.1.96/kdecore/kernel/kstandarddirs.cpp~	2009-01-13 18:29:30 +0300
+++ kdelibs-4.1.96/kdecore/kernel/kstandarddirs.cpp	2009-01-13 18:31:17 +0300
@@ -555,7 +555,7 @@ QString KStandardDirs::findResourceDir( 
 
     for (QStringList::ConstIterator it = candidates.begin();
          it != candidates.end(); ++it) {
-        if (exists(*it + filename)) {
+        if (exists_ext(*it + filename, (strcmp("exe",type)==0)? X_OK: R_OK)) {
             return *it;
         }
     }
@@ -568,7 +568,7 @@ QString KStandardDirs::findResourceDir( 
     return QString();
 }
 
-bool KStandardDirs::exists(const QString &fullPath)
+bool KStandardDirs::exists_ext(const QString &fullPath, int mode)
 {
 #ifdef Q_OS_WIN
     // access() and stat() give a stupid error message to the user
@@ -580,7 +580,7 @@ bool KStandardDirs::exists(const QString
 #else
     KDE_struct_stat buff;
     QByteArray cFullPath = QFile::encodeName(fullPath);
-    if (access(cFullPath, R_OK) == 0 && KDE_stat( cFullPath, &buff ) == 0) {
+    if (access(cFullPath, mode) == 0 && KDE_stat( cFullPath, &buff ) == 0) {
         if (!fullPath.endsWith('/')) {
             if (S_ISREG( buff.st_mode ))
                 return true;
@@ -592,6 +592,11 @@ bool KStandardDirs::exists(const QString
 #endif
 }
 
+bool KStandardDirs::exists(const QString &fullPath)
+{
+    return exists_ext(fullPath, R_OK);
+}
+
 static void lookupDirectory(const QString& path, const QString &relPart,
                             const QRegExp &regexp,
                             QStringList& list,
--- kdelibs-4.0.0/kdecore/kernel/kstandarddirs.h~	2008-01-28 20:28:15 +0300
+++ kdelibs-4.0.0/kdecore/kernel/kstandarddirs.h	2008-01-28 20:42:07 +0300
@@ -672,6 +672,7 @@ public:
      * @return @c true if the directory exists, @c false otherwise
      */
     static bool exists(const QString &fullPath);
+    static bool exists_ext(const QString &fullPath, int mode);
 
     /**
      * Expands all symbolic links and resolves references to
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin