Ticket #2185: HWindow.cpp.diff

File HWindow.cpp.diff, 1.4 KB (added by kaoutsis, 11 years ago)

only with the find_directory changes

  • src/preferences/sounds/HWindow.cpp

     
    3535#include <fs_attr.h>
    3636#include <stdio.h>
    3737#include <Sound.h>
     38#include <FindDirectory.h>
    3839
    3940/***********************************************************
    4041 * Constructor
     
    330331        menu->AddItem(new BMenuItem(path.Leaf(), msg), 0);
    331332    }
    332333   
    333     BPath path("/boot/beos/etc/sounds");
    334     status_t err = B_OK;
     334    BPath path;
     335    status_t err = find_directory(B_BEOS_SOUNDS_DIRECTORY, &path);
    335336    BDirectory dir( path.Path() );
    336337    BEntry entry;
    337338    BPath item_path;
     
    351352        msg->AddRef("refs", &ref);
    352353        menu->AddItem(new BMenuItem(item_path.Leaf(), msg), 0);
    353354    }
    354    
    355     path.SetTo("/boot/home/config/sounds");
     355
     356    err = find_directory(B_USER_SOUNDS_DIRECTORY, &path);
    356357    dir.SetTo(path.Path());
    357     err = B_OK;
    358358    while (err == B_OK) {
    359359        err = dir.GetNextEntry((BEntry *)&entry, true);
    360360        if (entry.InitCheck() != B_NO_ERROR) {
     
    372372        msg->AddRef("refs", &ref);
    373373        menu->AddItem(new BMenuItem(item_path.Leaf(), msg), 0);
    374374    }
    375    
    376     path.SetTo("/boot/home/media");
     375
     376    err = find_directory(B_COMMON_SOUNDS_DIRECTORY, &path);
    377377    dir.SetTo(path.Path());
    378     err = B_OK;
    379378    while (err == B_OK) {
    380379        err = dir.GetNextEntry((BEntry *)&entry, true);
    381380        if (entry.InitCheck() != B_NO_ERROR) {