fixed RefsReceived initialization bug, added AppTypeWindow handling to ArgReceived
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4307 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -60,7 +60,7 @@ void
|
|||||||
FileTypeApp::RefsReceived(BMessage * message)
|
FileTypeApp::RefsReceived(BMessage * message)
|
||||||
{
|
{
|
||||||
BList entryList;
|
BList entryList;
|
||||||
int32 i;
|
int32 i = 0;
|
||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
while (message->FindRef("refs",i++,&ref) == B_OK) {
|
while (message->FindRef("refs",i++,&ref) == B_OK) {
|
||||||
BEntry * entry = new BEntry(&ref,true);
|
BEntry * entry = new BEntry(&ref,true);
|
||||||
@@ -183,6 +183,31 @@ FileTypeApp::ArgvReceived(int32 argc, const char * argv[], const char * cwd)
|
|||||||
PrintUsage(argv[0]);
|
PrintUsage(argv[0]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (entryList.CountItems() == 1) {
|
||||||
|
BEntry * entry = static_cast<BEntry*>(entryList.FirstItem());
|
||||||
|
BNode node(entry);
|
||||||
|
if (node.InitCheck() != B_OK) {
|
||||||
|
delete entry;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
BNodeInfo nodeInfo(&node);
|
||||||
|
if (nodeInfo.InitCheck() != B_OK) {
|
||||||
|
delete entry;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
char string[MAXPATHLEN];
|
||||||
|
if ((nodeInfo.GetType(string) == B_OK)
|
||||||
|
&& (strcmp(string,"application/x-vnd.Be-elfexecutable") == 0)) {
|
||||||
|
AppTypeWindow * window = new AppTypeWindow(entry);
|
||||||
|
if (window->InitCheck() == B_OK) {
|
||||||
|
fWindow = window;
|
||||||
|
fArgvOkay = true;
|
||||||
|
} else {
|
||||||
|
printf("Failed to create AppTypeWindow\n");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
FileTypeWindow * window = new FileTypeWindow(&entryList);
|
FileTypeWindow * window = new FileTypeWindow(&entryList);
|
||||||
if (window->InitCheck() != B_OK) {
|
if (window->InitCheck() != B_OK) {
|
||||||
printf("Failed to create FileTypeWindow\n");
|
printf("Failed to create FileTypeWindow\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user