MCPcopy Create free account
hub / github.com/IENT/YUView / openFile

Method openFile

YUViewLib/src/filesource/FileSource.cpp:59–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59bool FileSource::openFile(const QString &filePath)
60{
61 // Check if the file exists
62 this->fileInfo.setFile(filePath);
63 if (!this->fileInfo.exists() || !this->fileInfo.isFile())
64 return false;
65
66 if (this->isFileOpened && this->srcFile.isOpen())
67 this->srcFile.close();
68
69 // open file for reading
70 this->srcFile.setFileName(filePath);
71 this->isFileOpened = this->srcFile.open(QIODevice::ReadOnly);
72 if (!this->isFileOpened)
73 return false;
74
75 // Save the full file path
76 this->fullFilePath = filePath;
77
78 // Install a watcher for the file (if file watching is active)
79 this->updateFileWatchSetting();
80 this->fileChanged = false;
81
82 return true;
83}
84
85#if SSE_CONVERSION
86// Resize the target array if necessary and read the given number of bytes to the data array

Calls 1

Tested by 1