KStandardDirs question

Martin Koller m.koller at surfeu.at
Sun Oct 31 11:40:24 GMT 2004


I stumbled over a problem with KStandardDirs:

I have a localdir Resource defined for korganizer with the absolute path
"/root/.kde/share/apps/korganizer/cal_dir" (running as root user)

In  ResourceLocalDir::doLoad() there is a check
 if ( !KStandardDirs::exists( dirName ) ) {

which says my directory does not exist (but it does).

Looking inside KStandardDirs::exists() I find that it only recognizes a 
directory if it ends with a "/" ...

 if (fullPath.at(fullPath.length() - 1) != '/') {
     if (S_ISREG( buff.st_mode ))
  return true;
 } else
     if (S_ISDIR( buff.st_mode ))
  return true;
 

The docu in the header file says:
 /**
  * Checks for existence and accessability.
  * Faster than creating a QFileInfo first.
  * @param fullPath the path to check
  * @return true if the directory exists
  */
 
So the docu says nothing about this behaviour. Why is this done it that way ?
Is this really meant to check only for directories (which it currently 
doesn't) ? 

I would assume that it just checks for existence, not also for the type.

-- 
Best regards/Schöne Grüße

Martin    ()  ascii ribbon campaign - against html mail 
          /\                        - against microsoft attachments

       Some operating systems are called 'user friendly',
             Linux however is 'expert friendly'.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20041031/87ca5e7f/attachment.sig>


More information about the kde-core-devel mailing list