Remote application supports not having a signature set in resources/attributes and uses a default signature then.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1442 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2002-10-07 22:09:26 +00:00
parent 159ed07994
commit aa48c99b96
2 changed files with 11 additions and 8 deletions

View File

@ -16,4 +16,8 @@ enum {
MSG_READY_TO_RUN = 'redy', //
};
// Argh, a macro! But that way, we avoid a compiler warning.
#define kDefaultTestAppSignature \
"application/x-vnd.obos-roster-launch-app-default"
#endif // ROSTER_TEST_APP_DEF_H

View File

@ -142,15 +142,14 @@ main(int argc, char **argv)
error = file.SetTo(path, B_READ_ONLY);
// get signature
BString signatureString;
if (error == B_OK)
error = file.ReadAttrString("signature", &signatureString);
else
if (error == B_OK) {
if (file.ReadAttrString("signature", &signatureString) == B_OK
&& signatureString.Length() > 0) {
strcpy(signature, signatureString.String());
} else
strcpy(signature, kDefaultTestAppSignature);
} else
printf("ERROR: Couldn't init app file: %s\n", strerror(error));
// copy signature
if (error == B_OK)
strcpy(signature, signatureString.String());
else
printf("ERROR: Couldn't get signature: %s\n", strerror(error));
} else
printf("ERROR: Couldn't get app ref: %s\n", strerror(error));
// create the app