Detect window size enforced by environment variable (required for testing).
| 86 | |
| 87 | // Detect window size enforced by environment variable (required for testing). |
| 88 | static std::optional<QSize> getOverrideWindowSize() noexcept { |
| 89 | static const QString value = |
| 90 | qgetenv("LIBREPCB_WINDOW_SIZE").trimmed().toLower(); |
| 91 | if (value.isEmpty()) { |
| 92 | return std::nullopt; // Environment variable not set. |
| 93 | } |
| 94 | const QStringList numbers = value.split("x"); |
| 95 | const int width = numbers.value(0).toInt(); |
| 96 | const int height = numbers.value(1).toInt(); |
| 97 | return QSize(width, height); |
| 98 | } |
| 99 | |
| 100 | static bool askForRestoringBackup(const FilePath&) { |
| 101 | QMessageBox::StandardButton btn = QMessageBox::question( |
no test coverage detected