MCPcopy Create free account
hub / github.com/audacity/audacity / ProjectFile

Class ProjectFile

au4/src/project/types/projecttypes.h:146–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144};
145
146struct ProjectFile {
147 QUrl url;
148 QString displayNameOverride = {};
149
150 ProjectFile() = default;
151
152 ProjectFile(const QUrl& url, const QString& displayNameOverride = {})
153 : url(url), displayNameOverride(displayNameOverride) {}
154
155 ProjectFile(const muse::io::path_t& path, const QString& displayNameOverride = {})
156 : url(path.toQUrl()), displayNameOverride(displayNameOverride) {}
157
158 bool isNull() const
159 {
160 return url.isEmpty();
161 }
162
163 bool isValid() const
164 {
165 return url.isValid();
166 }
167
168 bool hasDisplayName() const
169 {
170 if (!displayNameOverride.isEmpty()) {
171 return true;
172 }
173
174 return url.isLocalFile();
175 }
176
177 QString displayName(bool includingExtension) const
178 {
179 if (!displayNameOverride.isEmpty()) {
180 return displayNameOverride;
181 }
182
183 return muse::io::filename(path(), includingExtension).toQString();
184 }
185
186 muse::io::path_t path() const
187 {
188 assert(url.isEmpty() || url.isLocalFile());
189
190 return muse::io::path_t(url);
191 }
192
193 bool operator ==(const ProjectFile& other) const
194 {
195 return url == other.url
196 && displayNameOverride == other.displayNameOverride;
197 }
198
199 bool operator !=(const ProjectFile& other) const
200 {
201 return !(*this == other);
202 }
203};

Callers 4

toProjectFileMethod · 0.85
openProjectMethod · 0.85
setStartupScoreFileMethod · 0.85
onStartupPageOpenedMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected