mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-17 15:31:20 +00:00
Don't store view properties on network shares
Entering a folder will have Dolphin determine whether it can store the view properties in a .directory file within the folder or in a generic config location. It does so by checking for permissions on the file and parent dir causing various stat calls that potentially block on a slow mount. Also, the config reading thereafter can be very slow. Moreover, network shares are typically shared between users, so one user's view properties shouldn't affect or be overwritten by this Dolphin instance. It doesn't resolve symlinks but is surely an improvement over the status quo. Differential Revision: https://phabricator.kde.org/D23458
This commit is contained in:
parent
f4a1d1b022
commit
db717a21c5
|
@ -26,6 +26,8 @@
|
||||||
|
|
||||||
#include <QCryptographicHash>
|
#include <QCryptographicHash>
|
||||||
|
|
||||||
|
#include <KFileItem>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const int AdditionalInfoViewPropertiesVersion = 1;
|
const int AdditionalInfoViewPropertiesVersion = 1;
|
||||||
const int NameRolePropertiesVersion = 2;
|
const int NameRolePropertiesVersion = 2;
|
||||||
|
@ -70,6 +72,11 @@ ViewProperties::ViewProperties(const QUrl& url) :
|
||||||
m_filePath = url.toLocalFile();
|
m_filePath = url.toLocalFile();
|
||||||
|
|
||||||
bool useDestinationDir = !isPartOfHome(m_filePath);
|
bool useDestinationDir = !isPartOfHome(m_filePath);
|
||||||
|
if (!useDestinationDir) {
|
||||||
|
const KFileItem fileItem(url);
|
||||||
|
useDestinationDir = fileItem.isSlow();
|
||||||
|
}
|
||||||
|
|
||||||
if (!useDestinationDir) {
|
if (!useDestinationDir) {
|
||||||
const QFileInfo dirInfo(m_filePath);
|
const QFileInfo dirInfo(m_filePath);
|
||||||
const QFileInfo fileInfo(m_filePath + QDir::separator() + ViewPropertiesFileName);
|
const QFileInfo fileInfo(m_filePath + QDir::separator() + ViewPropertiesFileName);
|
||||||
|
|
Loading…
Reference in a new issue