Skip to content
  • Leszek Lesner's avatar
    History (recentfolders) not working / folder never created · 5975b749
    Leszek Lesner authored and Luigi Toscano's avatar Luigi Toscano committed
    Summary:
    Folder History is not working anymore.
    
    BUG: 379177
    
    Commit 840d1c40 broke it.
    
    > QStandardPaths::locate(QStandardPaths::AppLocalDataLocation, "recentfolders/")
    
    always returns an empty string "" when either the recentfolders folder or the ~/.local/share/gwenview folder don't exist.
    See: http://doc.qt.io/qt-5/qstandardpaths.html#locate
    > If no such file or directory can be found, an empty string is returned
    
    KStandardDirs::locateLocal behaves differently (from the api doc)
    > No check is made if the specified filename actually exists. Missing directories are created.
    
    As we don't want to switch back to KStandardDirs I came up with a working patch using QStandardPaths::writableLocation (see attachment) as
    > Note: The storage location returned can be a directory that does not exist; i.e., it may need to be created by the system or the user.
    
    (from : http://doc.qt.io/qt-5/qstandardpaths.html#writableLocation )
    
    Reviewers: sandsmark, ltoscano
    
    Reviewed By: ltoscano
    
    Subscribers: ltoscano, cfeck
    
    Differential Revision: https://phabricator.kde.org/D5572
    5975b749