mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 10:52:49 +00:00
kdecore: include the class name when printing warning from KStandardDirs::realPath()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
b3a991b9d6
commit
9b372b0d57
1 changed files with 10 additions and 10 deletions
|
@ -870,7 +870,7 @@ QString KStandardDirs::realPath(const QString &dirname)
|
||||||
return dirname;
|
return dirname;
|
||||||
|
|
||||||
if (dirname.at(0) != QLatin1Char('/')) {
|
if (dirname.at(0) != QLatin1Char('/')) {
|
||||||
qWarning("realPath called with a relative path '%s', please fix", qPrintable(dirname));
|
qWarning("KStandardDirs::realPath called with a relative path '%s', please fix", qPrintable(dirname));
|
||||||
return dirname;
|
return dirname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -905,7 +905,7 @@ QString KStandardDirs::realPath(const QString &dirname)
|
||||||
Q_ASSERT(!relative.isEmpty()); // infinite recursion ahead
|
Q_ASSERT(!relative.isEmpty()); // infinite recursion ahead
|
||||||
if (!relative.isEmpty()) {
|
if (!relative.isEmpty()) {
|
||||||
//qDebug() << "done, resolving" << dir << "and adding" << relative;
|
//qDebug() << "done, resolving" << dir << "and adding" << relative;
|
||||||
dir = realPath(dir) + relative;
|
dir = KStandardDirs::realPath(dir) + relative;
|
||||||
}
|
}
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
|
@ -978,7 +978,7 @@ QStringList KStandardDirs::KStandardDirsPrivate::resourceDirs(const char* type)
|
||||||
|
|
||||||
const QStringList dirs = m_relatives.value(type);
|
const QStringList dirs = m_relatives.value(type);
|
||||||
const QString typeInstallPath = installPath(type); // could be empty
|
const QString typeInstallPath = installPath(type); // could be empty
|
||||||
const QString installdir = typeInstallPath.isEmpty() ? QString() : realPath(typeInstallPath);
|
const QString installdir = typeInstallPath.isEmpty() ? QString() : KStandardDirs::realPath(typeInstallPath);
|
||||||
const QString installprefix = installPath("kdedir");
|
const QString installprefix = installPath("kdedir");
|
||||||
if (!dirs.isEmpty()) {
|
if (!dirs.isEmpty()) {
|
||||||
bool local = true;
|
bool local = true;
|
||||||
|
@ -990,7 +990,7 @@ QStringList KStandardDirs::KStandardDirsPrivate::resourceDirs(const char* type)
|
||||||
QByteArray rel = it.mid(1, pos - 1).toUtf8();
|
QByteArray rel = it.mid(1, pos - 1).toUtf8();
|
||||||
QString rest = it.mid(pos + 1);
|
QString rest = it.mid(pos + 1);
|
||||||
foreach (const QString &it2, resourceDirs(rel.constData())) {
|
foreach (const QString &it2, resourceDirs(rel.constData())) {
|
||||||
const QString path = realPath(it2 + rest);
|
const QString path = KStandardDirs::realPath(it2 + rest);
|
||||||
testdir.setPath(path);
|
testdir.setPath(path);
|
||||||
if ((local || testdir.exists()) && !candidates.contains(path, case_sensitivity)) {
|
if ((local || testdir.exists()) && !candidates.contains(path, case_sensitivity)) {
|
||||||
candidates.append(path);
|
candidates.append(path);
|
||||||
|
@ -1014,7 +1014,7 @@ QStringList KStandardDirs::KStandardDirsPrivate::resourceDirs(const char* type)
|
||||||
foreach (const QString &it, dirs) {
|
foreach (const QString &it, dirs) {
|
||||||
if (it.startsWith(QLatin1Char('%')))
|
if (it.startsWith(QLatin1Char('%')))
|
||||||
continue;
|
continue;
|
||||||
const QString path = realPath(*pit + it);
|
const QString path = KStandardDirs::realPath(*pit + it);
|
||||||
testdir.setPath(path);
|
testdir.setPath(path);
|
||||||
if ((local || testdir.exists()) && !candidates.contains(path, case_sensitivity))
|
if ((local || testdir.exists()) && !candidates.contains(path, case_sensitivity))
|
||||||
candidates.append(path);
|
candidates.append(path);
|
||||||
|
@ -1045,7 +1045,7 @@ QStringList KStandardDirs::KStandardDirsPrivate::resourceDirs(const char* type)
|
||||||
foreach (const QString &it, m_absolutes.value(type)) {
|
foreach (const QString &it, m_absolutes.value(type)) {
|
||||||
testdir.setPath(it);
|
testdir.setPath(it);
|
||||||
if (testdir.exists()) {
|
if (testdir.exists()) {
|
||||||
const QString filename = realPath(it);
|
const QString filename = KStandardDirs::realPath(it);
|
||||||
if (!candidates.contains(filename, case_sensitivity)) {
|
if (!candidates.contains(filename, case_sensitivity)) {
|
||||||
candidates.append(filename);
|
candidates.append(filename);
|
||||||
}
|
}
|
||||||
|
@ -1196,11 +1196,11 @@ QString KStandardDirs::saveLocation(const char *type,
|
||||||
} else {
|
} else {
|
||||||
// Check for existence of typed directory + suffix
|
// Check for existence of typed directory + suffix
|
||||||
if (strncmp(type, "xdgdata-", 8) == 0) {
|
if (strncmp(type, "xdgdata-", 8) == 0) {
|
||||||
path = realPath(localxdgdatadir() + path) ;
|
path = KStandardDirs::realPath(localxdgdatadir() + path) ;
|
||||||
} else if (strncmp(type, "xdgconf-", 8) == 0) {
|
} else if (strncmp(type, "xdgconf-", 8) == 0) {
|
||||||
path = realPath(localxdgconfdir() + path);
|
path = KStandardDirs::realPath(localxdgconfdir() + path);
|
||||||
} else {
|
} else {
|
||||||
path = realPath(localkdedir() + path);
|
path = KStandardDirs::realPath(localkdedir() + path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1208,7 +1208,7 @@ QString KStandardDirs::saveLocation(const char *type,
|
||||||
if (dirs.isEmpty()) {
|
if (dirs.isEmpty()) {
|
||||||
qFatal("KStandardDirs: The resource type %s is not registered", type);
|
qFatal("KStandardDirs: The resource type %s is not registered", type);
|
||||||
} else {
|
} else {
|
||||||
path = realPath(dirs.first());
|
path = KStandardDirs::realPath(dirs.first());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue