| 134 | } |
| 135 | |
| 136 | QString Utils::commonPart(QStringList list) |
| 137 | { |
| 138 | if (list.empty()) |
| 139 | return ""; |
| 140 | |
| 141 | QString commonPart = removeSuffix(list.takeFirst()); |
| 142 | while (!list.empty()) |
| 143 | { |
| 144 | QString otherStr = removeSuffix(list.takeFirst()); |
| 145 | |
| 146 | int sameCharNumber = 0; |
| 147 | while (sameCharNumber < commonPart.length() && sameCharNumber < otherStr.length() && commonPart[sameCharNumber] == otherStr[sameCharNumber]) |
| 148 | sameCharNumber++; |
| 149 | commonPart = commonPart.left(sameCharNumber); |
| 150 | } |
| 151 | |
| 152 | // Remove the extra "-" or spaces at the end and return the result |
| 153 | commonPart = commonPart.trimmed(); |
| 154 | if (commonPart.endsWith("-")) |
| 155 | commonPart = commonPart.left(commonPart.length() - 1); |
| 156 | return commonPart.trimmed(); |
| 157 | } |
| 158 | |
| 159 | QString Utils::rsaEncrypt(QString input) |
| 160 | { |
nothing calls this directly
no outgoing calls
no test coverage detected