* 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 <string.h>
|
||||||
|
|
||||||
|
#include <FindDirectory.h>
|
||||||
#include <NodeInfo.h>
|
#include <NodeInfo.h>
|
||||||
|
#include <Path.h>
|
||||||
#include <View.h>
|
#include <View.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -115,14 +117,30 @@ TeamListItem::GetInfo()
|
|||||||
bool
|
bool
|
||||||
TeamListItem::IsSystemServer()
|
TeamListItem::IsSystemServer()
|
||||||
{
|
{
|
||||||
// TODO: use find_directory() in place of hardcoded paths
|
static bool firstCall = true;
|
||||||
|
static BPath systemServersPath;
|
||||||
|
static BPath trackerPath;
|
||||||
|
static BPath deskbarPath;
|
||||||
|
|
||||||
char* system = "/boot/system/";
|
if (firstCall) {
|
||||||
if (strncmp(system, fInfo.args, strlen(system)) == 0)
|
find_directory(B_SYSTEM_SERVERS_DIRECTORY, &systemServersPath);
|
||||||
|
|
||||||
|
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;
|
return true;
|
||||||
|
|
||||||
system = "/system/servers/";
|
if (strncmp(trackerPath.Path(), fInfo.args, strlen(trackerPath.Path())) == 0)
|
||||||
if (strncmp(system, fInfo.args, strlen(system)) == 0)
|
return true;
|
||||||
|
|
||||||
|
if (strncmp(deskbarPath.Path(), fInfo.args, strlen(deskbarPath.Path())) == 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user