Changeset 17836

Show
Ignore:
Timestamp:
06/14/06 08:31:46 (2 years ago)
Author:
axeld
Message:

* No need to create a BPath object for the leaf name in CreateAppMetaMimeThread.
* The preferred application is now written with the case preserved. This fixes

bug #635.

* Minor cleanup.
* BApplication::_InitData() now also corrects a pre-registered application signature

if the case is different. Note, however, that the application watching mechanism
doesn't seem to work correctly with this, maybe sending out those should be postponed
until the registration is completed?

Location:
haiku/trunk/src/kits
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • haiku/trunk/src/kits/app/Application.cpp

    r17797 r17836  
    331331                } else 
    332332                        appInfo.port = fMsgPort; 
    333                 // check the signature and correct it, if necessary 
    334                 if (strcasecmp(appInfo.signature, fAppName)) 
     333                // check the signature and correct it, if necessary, also the case 
     334                if (strcmp(appInfo.signature, fAppName)) 
    335335                        BRoster::Private().SetSignature(team, fAppName); 
    336336                // complete the registration 
  • haiku/trunk/src/kits/storage/mime/CreateAppMetaMimeThread.cpp

    r17661 r17836  
    5555                return status; 
    5656 
    57         BPath path; 
    58         status = path.SetTo(ref); 
    59         if (status < B_OK) 
    60                 return status; 
    61  
    6257        // Read the app sig (which consequently keeps us from updating 
    6358        // non-applications, since we get an error if the file has no 
     
    7873                mime.Install(); 
    7974 
    80         signature.ToLower(); 
    81                 // Signatures and MIME types are case insensitive 
     75        BString path = "/"; 
     76        path.Append(signature); 
     77        path.ToLower(); 
     78                // Signatures and MIME types are case insensitive, but we want to 
     79                // preserve the case wherever possible 
     80        path.Prepend(kDatabaseDir.c_str()); 
    8281 
    83         char metaMimePath[B_PATH_NAME_LENGTH]; 
    84         sprintf(metaMimePath, "%s/%s", kDatabaseDir.c_str(), signature.String()); 
    85  
    86         status = typeNode.SetTo(metaMimePath); 
     82        status = typeNode.SetTo(path.String()); 
    8783        if (status < B_OK) 
    8884                return status; 
     
    9086        // Preferred App 
    9187        attr_info info; 
    92         if (status == B_OK && (fForce || typeNode.GetAttrInfo(kPreferredAppAttr, &info) != B_OK)) { 
     88        if (status == B_OK && (fForce || typeNode.GetAttrInfo(kPreferredAppAttr, &info) != B_OK)) 
    9389                status = mime.SetPreferredApp(signature.String()); 
    94         } 
     90 
    9591        // Short Description (name of the application) 
    96         if (status == B_OK && (fForce || typeNode.GetAttrInfo(kShortDescriptionAttr, &info) != B_OK)) { 
    97                 status = mime.SetShortDescription(path.Leaf()); 
    98         } 
     92        if (status == B_OK && (fForce || typeNode.GetAttrInfo(kShortDescriptionAttr, &info) != B_OK)) 
     93                status = mime.SetShortDescription(ref->name); 
     94 
    9995        // App Hint 
    100         if (status == B_OK && (fForce || typeNode.GetAttrInfo(kAppHintAttr, &info) != B_OK)) { 
     96        if (status == B_OK && (fForce || typeNode.GetAttrInfo(kAppHintAttr, &info) != B_OK)) 
    10197                status = mime.SetAppHint(ref); 
    102         } 
    10398 
    10499        // Mini Icon