From 55699fc8a3324e76e2b304eab61ffb1dc6d1bbce Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Mon, 10 Oct 2022 04:15:48 +0300 Subject: [PATCH] kdecore: remove the unused "html" and hidden "home" standard directory resources Signed-off-by: Ivailo Monev --- kdecore/config/kconfiggroup.cpp | 2 -- kdecore/kde-config.cpp | 1 - kdecore/kernel/kstandarddirs.cpp | 4 ---- kdecore/kernel/kstandarddirs.h | 6 ++---- kdecore/tests/kstandarddirstest.cpp | 12 ------------ kio/tests/previewtest.cpp | 2 +- 6 files changed, 3 insertions(+), 24 deletions(-) diff --git a/kdecore/config/kconfiggroup.cpp b/kdecore/config/kconfiggroup.cpp index d3f2add0..0ed0e062 100644 --- a/kdecore/config/kconfiggroup.cpp +++ b/kdecore/config/kconfiggroup.cpp @@ -407,8 +407,6 @@ static QString translatePath( QString path ) // krazy:exclude=passbyvalue while (path[0] == QLatin1Char('/') && path[1] == QLatin1Char('/')) path.remove(0,1); - // we can not use KGlobal::dirs()->relativeLocation("home", path) here, - // since it would not recognize paths without a trailing '/'. // All of the 3 following functions to return the user's home directory // can return different paths. We have to test all them. const QString homeDir0 = QFile::decodeName(qgetenv("HOME")); diff --git a/kdecore/kde-config.cpp b/kdecore/kde-config.cpp index 53ea4881..3c6ed1fc 100644 --- a/kdecore/kde-config.cpp +++ b/kdecore/kde-config.cpp @@ -119,7 +119,6 @@ int main(int argc, char **argv) "config", I18N_NOOP("Configuration files"), "data", I18N_NOOP("Where applications store data"), "exe", I18N_NOOP("Executables in $prefix/bin"), - "html", I18N_NOOP("HTML documentation"), "icon", I18N_NOOP("Icons"), "kcfg", I18N_NOOP("Configuration description files"), "lib", I18N_NOOP("Libraries"), diff --git a/kdecore/kernel/kstandarddirs.cpp b/kdecore/kernel/kstandarddirs.cpp index 7d7fe13b..45b0b5e2 100644 --- a/kdecore/kernel/kstandarddirs.cpp +++ b/kdecore/kernel/kstandarddirs.cpp @@ -321,7 +321,6 @@ static const struct ResourcesTblData { const char* const relativename; } ResourcesTbl[] = { { "data\0", "share/apps\0" }, - { "html\0", "share/doc/HTML\0" }, { "icon\0", "share/icons\0" }, { "config\0", "share/config\0" }, { "pixmap\0", "share/pixmaps\0" }, @@ -466,8 +465,6 @@ KStandardDirs::KStandardDirs() addResourceType(ResourcesTbl[i].type, nullptr, QString::fromLatin1(ResourcesTbl[i].relativename), true); } - addResourceDir("home", QDir::homePath(), false); - addResourceType("autostart", "xdgconf-autostart", QString::fromLatin1("/")); // merge them, start with xdg autostart addResourceType("autostart", nullptr, QString::fromLatin1("share/autostart")); // KDE ones are higher priority } @@ -486,7 +483,6 @@ QStringList KStandardDirs::allTypes() const } // Those are added manually by the constructor list.append(QString::fromLatin1("lib")); - //list.append(QString::fromLatin1("home")); // undocumented on purpose, said Waldo in r113855. // Those are handled by resourceDirs() itself list.append(QString::fromLatin1("tmp")); diff --git a/kdecore/kernel/kstandarddirs.h b/kdecore/kernel/kstandarddirs.h index edf17c8f..8f86b801 100644 --- a/kdecore/kernel/kstandarddirs.h +++ b/kdecore/kernel/kstandarddirs.h @@ -47,8 +47,8 @@ * install location, and one is $KDEHOME. * Under these toplevel prefixes there are several well-defined suffixes * where specific resource types can be found. - * For example, for the resource type @c "html" the suffixes could be - * @c share/doc/HTML and @c share/doc/kde/HTML. + * For example, for the resource type @c "services" the suffixes could be + * @c share/services and @c share/kde4/services. * The search algorithm tries to locate the file under each prefix-suffix * combination. * @@ -65,7 +65,6 @@ * @li @c config - Configuration files. * @li @c data - Where applications store data. * @li @c exe - Executables in $prefix/bin. findExe() for a function that takes $PATH into account. - * @li @c html - HTML documentation. * @li @c icon - Icons, see KIconLoader. * @li @c kcfg - KConfigXT config files. * @li @c lib - Libraries. @@ -571,7 +570,6 @@ public: * of what this is all about. * * @li @c data - @c share/apps - * @li @c html - @c share/doc/HTML * @li @c icon - @c share/icon * @li @c config - @c share/config * @li @c pixmap - @c share/pixmaps diff --git a/kdecore/tests/kstandarddirstest.cpp b/kdecore/tests/kstandarddirstest.cpp index 26b14a8f..3b650621 100644 --- a/kdecore/tests/kstandarddirstest.cpp +++ b/kdecore/tests/kstandarddirstest.cpp @@ -157,18 +157,6 @@ void KStandarddirsTest::testFindAllResources() QVERIFY( !oneEndsWith( configFilesWithFilter, "share/config/accept-languages.codes" ) ); // didn't match the filter QCOMPARE(fileNames.count(), configFilesWithFilter.count()); QVERIFY(fileNames.contains("kdebugrc")); - -#if 0 - list = t.findAllResources("html", "en/*/index.html", false); - for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { - kDebug() << "docs " << (*it).toLatin1().constData(); - } - - list = t.findAllResources("html", "*/*/*.html", false); - for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { - kDebug() << "docs " << (*it).toLatin1().constData(); - } -#endif } void KStandarddirsTest::testFindAllResourcesNewDir() diff --git a/kio/tests/previewtest.cpp b/kio/tests/previewtest.cpp index 72293b6a..7d52ff1a 100644 --- a/kio/tests/previewtest.cpp +++ b/kio/tests/previewtest.cpp @@ -17,7 +17,7 @@ PreviewTest::PreviewTest() { QGridLayout *layout = new QGridLayout(this); m_url = new KLineEdit(this); - m_url->setText(KDEDIR"/share/doc/HTML/en/common/top-kde.jpg"); + m_url->setText(KDEDIR "/share/apps/kdeui/pics/aboutkde.png"); layout->addWidget(m_url, 0, 0); QPushButton *btn = new QPushButton("Generate", this); connect(btn, SIGNAL(clicked()), SLOT(slotGenerate()));