| 2233 | } |
| 2234 | |
| 2235 | AppInstPtr |
| 2236 | AppInstance::loadProject(const std::string& filename) |
| 2237 | { |
| 2238 | QFileInfo file( QString::fromUtf8( filename.c_str() ) ); |
| 2239 | |
| 2240 | if ( !file.exists() ) { |
| 2241 | return AppInstPtr(); |
| 2242 | } |
| 2243 | QString fileUnPathed = file.fileName(); |
| 2244 | QString path = file.path() + QChar::fromLatin1('/'); |
| 2245 | |
| 2246 | //We are in background mode, there can only be 1 instance active, wipe the current project |
| 2247 | boost::shared_ptr<Project> project = getProject(); |
| 2248 | project->resetProject(); |
| 2249 | |
| 2250 | bool ok = project->loadProject( path, fileUnPathed); |
| 2251 | if (ok) { |
| 2252 | return shared_from_this(); |
| 2253 | } |
| 2254 | |
| 2255 | project->resetProject(); |
| 2256 | |
| 2257 | return AppInstPtr(); |
| 2258 | } |
| 2259 | |
| 2260 | ///Close the current project but keep the window |
| 2261 | bool |
no test coverage detected