Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 167011 Details for
Bug 239269
kde-base/kdelibs-4.1.1-r4: kbuildsycoca4 global update creates unneeded directories in system paths
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fix
kdelibs-4.1.1-kconfig-dont-create-local-dirs.patch (text/plain), 2.87 KB, created by
Ambroz Bizjak
on 2008-10-02 17:01:54 UTC
(
hide
)
Description:
fix
Filename:
MIME Type:
Creator:
Ambroz Bizjak
Created:
2008-10-02 17:01:54 UTC
Size:
2.87 KB
patch
obsolete
>Index: kdecore/config/kconfig.cpp >=================================================================== >--- kdecore/config/kconfig.cpp (revision 866718) >+++ kdecore/config/kconfig.cpp (revision 866909) >@@ -296,11 +296,8 @@ > if (d->bDirty && d->mBackend) { > const QByteArray utf8Locale(locale().toUtf8()); > >- // Check if we can write to the local file. >- if (!d->mBackend->isWritable()) { >- // Create the containing dir, maybe it wasn't there >- d->mBackend->createEnclosing(); >- } >+ // Create the containing dir, maybe it wasn't there >+ d->mBackend->createEnclosing(); > > // lock the local file > if (d->configState == ReadWrite && !d->lockLocal()) { >@@ -409,7 +406,7 @@ > fileName = appName + QLatin1String("rc"); > if (type && *type) > resourceType = type; // only change it if it's not empty >- file = KStandardDirs::locateLocal(resourceType, fileName, componentData); >+ file = KStandardDirs::locateLocal(resourceType, fileName, false, componentData); > } > } else if (wantGlobals()) { // accessing "kdeglobals" > resourceType = "config"; >@@ -421,7 +418,7 @@ > else { > if (type && *type) > resourceType = type; // only change it if it's not empty >- file = KStandardDirs::locateLocal(resourceType, fileName, componentData); >+ file = KStandardDirs::locateLocal(resourceType, fileName, false, componentData); > > if (fileName == QLatin1String("kdeglobals")) > openFlags |= KConfig::IncludeGlobals; >Index: kdecore/config/kconfigini.cpp >=================================================================== >--- kdecore/config/kconfigini.cpp (revision 866718) >+++ kdecore/config/kconfigini.cpp (revision 866909) >@@ -485,8 +485,24 @@ > > bool KConfigIniBackend::isWritable() const > { >- if (!filePath().isEmpty()) >- return KStandardDirs::checkAccess(filePath(), W_OK); >+ if (!filePath().isEmpty()) { >+ if (KStandardDirs::checkAccess(filePath(), W_OK)) { >+ return true; >+ } >+ // The check might have failed because any of the containing dirs >+ // did not exist. If the file does not exist, check if the deepest >+ // existing dir is writable. >+ if (!QFileInfo(filePath()).exists()) { >+ QDir dir = QFileInfo(filePath()).absolutePath(); >+ while (!dir.exists()) { >+ if (!dir.cdUp()) { >+ return false; >+ } >+ } >+ return QFileInfo(dir.absolutePath()).isWritable(); >+ } >+ } >+ > return false; > } > >@@ -532,7 +548,7 @@ > if (filePath().isEmpty()) > return KConfigBase::NoAccess; > >- if (KStandardDirs::checkAccess(filePath(), W_OK)) >+ if (isWritable()) > return KConfigBase::ReadWrite; > > return KConfigBase::ReadOnly;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 239269
: 167011