diff options
| author | Frank Reininghaus <[email protected]> | 2013-06-23 10:01:24 +0200 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2013-06-23 10:01:24 +0200 |
| commit | b4dc66e27fd007bebeca3f68dbfad17483ca9241 (patch) | |
| tree | 36185ceaf9ad7cdfe20fc7c17100bae9b6acdc0b /src/views/viewproperties.cpp | |
| parent | e8c4d19b7c8d1881dae2a28b1ff7202683648ceb (diff) | |
Prevent possible infinite recursion in ViewProperties
If each directory can have its own view properties, and loadting the
.directory file fails in a directory, we have to load the global view
properties. However, if we try to do this by changing the "global view
properties setting" and loading the view properties for the same
directory again, we might get an infinite recursion if changing the
setting fails.
We now force a loading of the global view properties by constructing a
new ViewProperties object with an empty URL.
Thanks to Kurt Hindenburg for helping to debug this issue (which was
only reproducible on MacOS).
BUG: 316209
FIXED-IN: 4.10.5
REVIEW: 111182
Diffstat (limited to 'src/views/viewproperties.cpp')
| -rw-r--r-- | src/views/viewproperties.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/views/viewproperties.cpp b/src/views/viewproperties.cpp index 30deb7277..d4ecfafa0 100644 --- a/src/views/viewproperties.cpp +++ b/src/views/viewproperties.cpp @@ -53,7 +53,7 @@ ViewProperties::ViewProperties(const KUrl& url) : m_node(0) { GeneralSettings* settings = GeneralSettings::self(); - const bool useGlobalViewProps = settings->globalViewProps(); + const bool useGlobalViewProps = settings->globalViewProps() || url.isEmpty(); bool useDetailsViewWithPath = false; // We try and save it to the file .directory in the directory being viewed. @@ -100,13 +100,13 @@ ViewProperties::ViewProperties(const KUrl& url) : setVisibleRoles(QList<QByteArray>() << "path"); } else { // The global view-properties act as default for directories without - // any view-property configuration - settings->setGlobalViewProps(true); - - ViewProperties defaultProps(url); + // any view-property configuration. Constructing a ViewProperties + // instance for an empty KUrl ensures that the global view-properties + // are loaded. + KUrl emptyUrl; + ViewProperties defaultProps(emptyUrl); setDirProperties(defaultProps); - settings->setGlobalViewProps(false); m_changedProps = false; } } |
