Ticket #7372: mail.diff
File mail.diff, 2.7 KB (added by , 14 years ago) |
---|
-
src/apps/mail/Utilities.cpp
71 71 ssize_t size = node->ReadAttr(attr, B_STRING_TYPE, 0, 72 72 value->LockBuffer(attrInfo.size + 1), attrInfo.size); 73 73 74 value->UnlockBuffer(); 74 if (size < 0) 75 value->UnlockBuffer(0); 76 else 77 value->UnlockBuffer(size); 75 78 76 79 return size >= 0 ? B_OK : size; 77 80 } -
src/apps/mail/MailWindow.cpp
181 181 if (messenger != NULL) 182 182 fTrackerMessenger = *messenger; 183 183 184 char str[256];185 char status[272];186 184 float height; 187 185 BMenu* menu; 188 186 BMenu* subMenu; 189 187 BMenuItem* item; 190 188 BMessage* msg; 191 attr_info info;192 189 BFile file(ref, B_READ_ONLY); 193 190 194 191 if (ref) { … … 240 237 menu->AddSeparatorItem(); 241 238 242 239 subMenu = new BMenu(B_TRANSLATE("Close and ")); 243 if (file.GetAttrInfo(B_MAIL_ATTR_STATUS, &info) == B_NO_ERROR) 244 file.ReadAttr(B_MAIL_ATTR_STATUS, B_STRING_TYPE, 0, str, info.size); 245 else 246 str[0] = 0; 240 BString attribute; 241 ReadAttrString(&file, B_MAIL_ATTR_STATUS, &attribute); 247 242 248 if ( !strcmp(str, "New")) {243 if (attribute == "New") { 249 244 subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Leave as New"), 250 245 new BMessage(B_QUIT_REQUESTED), 'W', B_SHIFT_KEY)); 251 246 #if 0 … … 253 248 new BMessage(M_CLOSE_READ), 'W')); 254 249 #endif 255 250 } else { 256 if (strlen(str)) 257 sprintf(status, B_TRANSLATE("Leave as '%s'"), str); 258 else 259 sprintf(status, B_TRANSLATE("Leave same")); 260 subMenu->AddItem(item = new BMenuItem(status, 261 new BMessage(B_QUIT_REQUESTED), 'W')); 251 BString label = B_TRANSLATE("Leave as '%s'"); 252 label.ReplaceFirst("%s", attribute); 253 254 if (attribute.Length() <= 0) 255 label = B_TRANSLATE("Leave same"); 256 257 subMenu->AddItem(item = new BMenuItem(label, 258 new BMessage(B_QUIT_REQUESTED), 'W')); 262 259 AddShortcut('W', B_COMMAND_KEY | B_SHIFT_KEY, 263 260 new BMessage(B_QUIT_REQUESTED)); 264 261 } -
src/apps/mail/MailSupport.cpp
150 150 151 151 message->AddString("attribute", value.String()); 152 152 153 char name[256];153 BString name; 154 154 if (format != NULL) 155 snprintf(name, sizeof(name), format, value.String());155 name.SetToFormat("format", value.String()); 156 156 else 157 strlcpy(name, value.String(), sizeof(name));157 name = value; 158 158 159 159 if (index < 9 && !popup) 160 160 menu->AddItem(new BMenuItem(name, message, '1' + index));