MCPcopy Create free account
hub / github.com/Tencent/libpag / openFile

Method openFile

viewer/src/PAGViewer.cpp:41–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41void 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
63PAGCheckUpdateModel* PAGViewer::getCheckUpdateModel() {
64 return checkUpdateModel.get();

Callers 1

mainFunction · 0.45

Calls 3

getFilePathMethod · 0.45
isEmptyMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected