[haiku-commits] Re: r35065 - haiku/trunk/src/kits/tracker

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 14 Jan 2010 08:58:17 +0100

anevilyak@xxxxxxxxx wrote:
>  FSIsDeskDir(const BEntry *entry, dev_t device)
>  {
>       BVolume volume(device);
> +     
>       status_t result = volume.InitCheck();
>       if (result != B_OK)
>               return false;
>  
> +     BVolume bootvolume;
> +     BVolumeRoster roster;
> +     if (roster.GetBootVolume(&bootvolume) == B_OK && volume != 
> bootvolume)
> +             return false;
> +
>       BPath path;
>       result = find_directory(B_DESKTOP_DIRECTORY, &path, true, 
> &volume);
>       if (result != B_OK)

Since the paths are compared afterwards, you could even compare it like 
this:

{
        BPath path;
        status_t result = find_directory(B_DESKTOP_DIRECTORY, &path, true);
        if (result != B_OK)
                return false;

        BEntry desktopEntry(path.Path());
        return *entry == desktopEntry;
}

Bye,
   Axel.


Other related posts: