diff --git a/src/preferences/mail/FilterList.cpp b/src/preferences/mail/FilterList.cpp index cba4df06da..b3dea672cf 100644 --- a/src/preferences/mail/FilterList.cpp +++ b/src/preferences/mail/FilterList.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011-2015, Haiku, Inc. All rights reserved. + * Copyright 2011-2016, Haiku, Inc. All rights reserved. * Copyright 2011, Clemens Zeidler * Distributed under the terms of the MIT License. */ @@ -11,7 +11,7 @@ #include #include -#include +#include #include @@ -35,19 +35,14 @@ FilterList::Reload() std::set knownNames; - directory_which which[] = {B_USER_ADDONS_DIRECTORY, - B_SYSTEM_ADDONS_DIRECTORY}; - for (size_t i = 0; i < sizeof(which) / sizeof(which[0]); i++) { - BPath path; - status_t status = find_directory(which[i], &path); - if (status != B_OK) - continue; + BString subPath("mail_daemon/"); + subPath << (fDirection == kIncoming + ? "inbound_filters" : "outbound_filters"); - path.Append("mail_daemon"); - if (fDirection == kIncoming) - path.Append("inbound_filters"); - else - path.Append("outbound_filters"); + BStringList paths; + BPathFinder().FindPaths(B_FIND_PATH_ADD_ONS_DIRECTORY, subPath, paths); + for (int32 i = 0; i < paths.CountStrings(); i++) { + BPath path(paths.StringAt(i)); BDirectory dir(path.Path()); if (dir.InitCheck() != B_OK)