| 168 | |
| 169 | |
| 170 | int |
| 171 | main(int argc, char *argv[]) |
| 172 | { |
| 173 | // This is a workaround for the poor backwards compatibility of macOS |
| 174 | // with software that used to work in previous releases. macOS is far |
| 175 | // from being a serious piece of engineering, and developing stuff |
| 176 | // in macOS implies handling all the stuff that Apple engineers forgot |
| 177 | // to do right. |
| 178 | |
| 179 | #ifdef Q_OS_MACOS |
| 180 | qputenv("QT_MAC_WANTS_LAYER", "1"); |
| 181 | #endif // Q_OS_MACOS |
| 182 | |
| 183 | QApplication app(argc, argv); |
| 184 | QString appName = "SigDigger"; |
| 185 | int ret = EXIT_FAILURE; |
| 186 | int c; |
| 187 | |
| 188 | #ifdef __APPLE__ |
| 189 | QFont::insertSubstitution("Monospace", "Monaco"); |
| 190 | #endif // __APPLE__ |
| 191 | |
| 192 | while (true) { |
| 193 | int option_index = 0; |
| 194 | |
| 195 | c = getopt_long(argc, argv, "t:h", long_options, &option_index); |
| 196 | if (c == -1) |
| 197 | break; |
| 198 | |
| 199 | switch (c) { |
| 200 | case 't': |
| 201 | appName = optarg; |
| 202 | break; |
| 203 | |
| 204 | case 'h': |
| 205 | help(argv[0]); |
| 206 | exit(EXIT_SUCCESS); |
| 207 | |
| 208 | case '?': |
| 209 | fprintf(stderr, "%s: invalid option `-%c'.\n", argv[0], optopt); |
| 210 | help(argv[0]); |
| 211 | break; |
| 212 | |
| 213 | default: |
| 214 | fprintf(stderr, "%s: unexpected getopt_long retcode %d\n", argv[0], c); |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | if (appName == "SigDigger") { |
| 219 | ret = runSigDigger(app); |
| 220 | } else if (appName == "RMSViewer") { |
| 221 | ret = runRMSViewer(app); |
| 222 | } else { |
| 223 | fprintf( |
| 224 | stderr, |
| 225 | "%s: unknown tool `%s'\n", |
| 226 | argv[0], |
| 227 | appName.toStdString().c_str()); |
nothing calls this directly
no test coverage detected