Conditionally assigns errmsg to str if str is not null and returns false. * This is a seemingly pointless function, but it saves some messiness in * methods whose QString *errmsg parameter is optional. */
| 61 | * This is a seemingly pointless function, but it saves some messiness in |
| 62 | * methods whose QString *errmsg parameter is optional. */ |
| 63 | bool |
| 64 | err(QString *str, const QString &errmsg) |
| 65 | { |
| 66 | if (str) { |
| 67 | *str = errmsg; |
| 68 | } |
| 69 | return false; |
| 70 | } |
| 71 | |
| 72 | /** Ensures all characters in str are in validChars. If a character appears |
| 73 | * in str but not in validChars, it will be removed and the resulting |