[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    KStandardDirs question
From:       Martin Koller <m.koller () surfeu ! at>
Date:       2004-10-31 11:40:24
Message-ID: 200410311240.31793.m.koller () surfeu ! at
[Download RAW message or body]


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'.

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic