MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / loadProject

Method loadProject

Engine/AppInstance.cpp:2254–2277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2252}
2253
2254AppInstancePtr
2255AppInstance::loadProject(const std::string& filename)
2256{
2257 QFileInfo file( QString::fromUtf8( filename.c_str() ) );
2258
2259 if ( !file.exists() ) {
2260 return AppInstancePtr();
2261 }
2262 QString fileUnPathed = file.fileName();
2263 QString path = file.path() + QChar::fromLatin1('/');
2264
2265 //We are in background mode, there can only be 1 instance active, wipe the current project
2266 ProjectPtr project = getProject();
2267 project->resetProject();
2268
2269 bool ok = project->loadProject( path, fileUnPathed);
2270 if (ok) {
2271 return shared_from_this();
2272 }
2273
2274 project->resetProject();
2275
2276 return AppInstancePtr();
2277}
2278
2279///Close the current project but keep the window
2280bool

Callers 1

loadInternalMethod · 0.45

Calls 2

pathMethod · 0.45
resetProjectMethod · 0.45

Tested by

no test coverage detected