| 39 | } |
| 40 | |
| 41 | void PAGViewer::openFile(QString path) { |
| 42 | PAGWindow* window = nullptr; |
| 43 | for (int i = 0; i < PAGWindow::AllWindows.count(); i++) { |
| 44 | auto win = PAGWindow::AllWindows[i]; |
| 45 | auto fileInWindow = win->getFilePath(); |
| 46 | if (fileInWindow.isEmpty() || fileInWindow == path) { |
| 47 | window = win; |
| 48 | break; |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | if (!window) { |
| 53 | window = new PAGWindow(); |
| 54 | window->open(); |
| 55 | PAGWindow::AllWindows.append(window); |
| 56 | QObject::connect(window, &PAGWindow::destroyWindow, this, &PAGViewer::onWindowDestroyed, |
| 57 | Qt::UniqueConnection); |
| 58 | } |
| 59 | |
| 60 | window->openFile(path); |
| 61 | } |
| 62 | |
| 63 | PAGCheckUpdateModel* PAGViewer::getCheckUpdateModel() { |
| 64 | return checkUpdateModel.get(); |
no test coverage detected