* Removed hardcoded system location, now use find_directory()
* Fixed a bug I've miss last time: everything under /boot/system was considered a server team, including system apps and demos! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30051 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -10,7 +10,9 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <FindDirectory.h>
|
||||
#include <NodeInfo.h>
|
||||
#include <Path.h>
|
||||
#include <View.h>
|
||||
|
||||
|
||||
@@ -115,15 +117,31 @@ TeamListItem::GetInfo()
|
||||
bool
|
||||
TeamListItem::IsSystemServer()
|
||||
{
|
||||
// TODO: use find_directory() in place of hardcoded paths
|
||||
static bool firstCall = true;
|
||||
static BPath systemServersPath;
|
||||
static BPath trackerPath;
|
||||
static BPath deskbarPath;
|
||||
|
||||
if (firstCall) {
|
||||
find_directory(B_SYSTEM_SERVERS_DIRECTORY, &systemServersPath);
|
||||
|
||||
char* system = "/boot/system/";
|
||||
if (strncmp(system, fInfo.args, strlen(system)) == 0)
|
||||
find_directory(B_SYSTEM_DIRECTORY, &trackerPath);
|
||||
trackerPath.Append("Tracker");
|
||||
|
||||
find_directory(B_SYSTEM_DIRECTORY, &deskbarPath);
|
||||
deskbarPath.Append("Deskbar");
|
||||
|
||||
firstCall = false;
|
||||
}
|
||||
|
||||
if (strncmp(systemServersPath.Path(), fInfo.args, strlen(systemServersPath.Path())) == 0)
|
||||
return true;
|
||||
|
||||
system = "/system/servers/";
|
||||
if (strncmp(system, fInfo.args, strlen(system)) == 0)
|
||||
if (strncmp(trackerPath.Path(), fInfo.args, strlen(trackerPath.Path())) == 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
if (strncmp(deskbarPath.Path(), fInfo.args, strlen(deskbarPath.Path())) == 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user