src/writely/WriterUI.cpp
/**
 * Get the path of the last edited document in a previous session and clean the registry.
 * @return    an empty QVariantMap is there is no document registered.
 */
Get the path of the last edited document in a previous session and clean the registry.
@return    an empty QVariantMap is there is no document registered.
Get the path of the last edited document in a previous session and clean the registry . @return an empty QVariantMap is there is no document registered .
QVariantMap WriterUI::lastDocumentInEditing() {
    QSettings settings(kGLCompanyName, kGLAppName);
    if ( !settings.contains( kGLSettingKeyActiveDocument ) )
        return QVariantMap();
    QString activeDocument = settings.value( kGLSettingKeyActiveDocument ).toString();
    settings.remove( kGLSettingKeyActiveDocument );
    QFileInfo fileInfo(activeDocument);
    if (!fileInfo.exists())
        return QVariantMap();
    QVariantMap entry;
    entry["type"] = "file";
    loadFileInfo(entry, fileInfo);
    return entry;
}
QVariantMap WriterUI :: lastDocumentInEditing ( ) { QSettings settings ( kGLCompanyName , kGLAppName ) ; if ( ! settings . contains ( kGLSettingKeyActiveDocument ) ) return QVariantMap ( ) ; QString activeDocument = settings . value ( kGLSettingKeyActiveDocument ) . toString ( ) ; settings . remove ( kGLSettingKeyActiveDocument ) ; QFileInfo fileInfo ( activeDocument ) ; if ( ! fileInfo . exists ( ) ) return QVariantMap ( ) ; QVariantMap entry ; entry [ " " ] = " " ; loadFileInfo ( entry , fileInfo ) ; return entry ; }
Get the path of the last edited document in a previous session and clean the registry.
Get the path of the last edited document in a previous session and clean the registry .