/// Loads the project
/// @param fileName the filename to load the project
/// @return the project object or 0 on error. The error-message can be recieved by caller errorMessage()
Workspace* WorkspaceSerializer::loadWorkspace( const QString& fileName )
{
    errorMessage_.clear();

    // serialize the data (into a json document)
    edbee::JsonParser parser;
    if( !parser.parse(fileName) ) {
        errorMessage_ = parser.errorMessage();
        return 0;
    }
    QVariantMap map = parser.result().toMap();


    // change the application workspace
    Workspace* result = edbeeApp()->workspaceManager()->createWorkspace();
    result->setFilename( fileName );            // this need to be set before giving it to the workspace

    // load the data into the workspace
    // Unfortunately the current implementation depends on the window being available.
    // so the deserialization needs to take place after giving it to the application
    deserializeWorkspace( result, map );
    return result;
}