kdecore: remove the unused "html" and hidden "home" standard directory resources

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-10-10 04:15:48 +03:00
parent 056a8f184e
commit 55699fc8a3
6 changed files with 3 additions and 24 deletions

View file

@ -407,8 +407,6 @@ static QString translatePath( QString path ) // krazy:exclude=passbyvalue
while (path[0] == QLatin1Char('/') && path[1] == QLatin1Char('/')) while (path[0] == QLatin1Char('/') && path[1] == QLatin1Char('/'))
path.remove(0,1); 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 // All of the 3 following functions to return the user's home directory
// can return different paths. We have to test all them. // can return different paths. We have to test all them.
const QString homeDir0 = QFile::decodeName(qgetenv("HOME")); const QString homeDir0 = QFile::decodeName(qgetenv("HOME"));

View file

@ -119,7 +119,6 @@ int main(int argc, char **argv)
"config", I18N_NOOP("Configuration files"), "config", I18N_NOOP("Configuration files"),
"data", I18N_NOOP("Where applications store data"), "data", I18N_NOOP("Where applications store data"),
"exe", I18N_NOOP("Executables in $prefix/bin"), "exe", I18N_NOOP("Executables in $prefix/bin"),
"html", I18N_NOOP("HTML documentation"),
"icon", I18N_NOOP("Icons"), "icon", I18N_NOOP("Icons"),
"kcfg", I18N_NOOP("Configuration description files"), "kcfg", I18N_NOOP("Configuration description files"),
"lib", I18N_NOOP("Libraries"), "lib", I18N_NOOP("Libraries"),

View file

@ -321,7 +321,6 @@ static const struct ResourcesTblData {
const char* const relativename; const char* const relativename;
} ResourcesTbl[] = { } ResourcesTbl[] = {
{ "data\0", "share/apps\0" }, { "data\0", "share/apps\0" },
{ "html\0", "share/doc/HTML\0" },
{ "icon\0", "share/icons\0" }, { "icon\0", "share/icons\0" },
{ "config\0", "share/config\0" }, { "config\0", "share/config\0" },
{ "pixmap\0", "share/pixmaps\0" }, { "pixmap\0", "share/pixmaps\0" },
@ -466,8 +465,6 @@ KStandardDirs::KStandardDirs()
addResourceType(ResourcesTbl[i].type, nullptr, QString::fromLatin1(ResourcesTbl[i].relativename), true); 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", "xdgconf-autostart", QString::fromLatin1("/")); // merge them, start with xdg autostart
addResourceType("autostart", nullptr, QString::fromLatin1("share/autostart")); // KDE ones are higher priority 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 // Those are added manually by the constructor
list.append(QString::fromLatin1("lib")); list.append(QString::fromLatin1("lib"));
//list.append(QString::fromLatin1("home")); // undocumented on purpose, said Waldo in r113855.
// Those are handled by resourceDirs() itself // Those are handled by resourceDirs() itself
list.append(QString::fromLatin1("tmp")); list.append(QString::fromLatin1("tmp"));

View file

@ -47,8 +47,8 @@
* install location, and one is <tt>$KDEHOME</tt>. * install location, and one is <tt>$KDEHOME</tt>.
* Under these toplevel prefixes there are several well-defined suffixes * Under these toplevel prefixes there are several well-defined suffixes
* where specific resource types can be found. * where specific resource types can be found.
* For example, for the resource type @c "html" the suffixes could be * For example, for the resource type @c "services" the suffixes could be
* @c share/doc/HTML and @c share/doc/kde/HTML. * @c share/services and @c share/kde4/services.
* The search algorithm tries to locate the file under each prefix-suffix * The search algorithm tries to locate the file under each prefix-suffix
* combination. * combination.
* *
@ -65,7 +65,6 @@
* @li @c config - Configuration files. * @li @c config - Configuration files.
* @li @c data - Where applications store data. * @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 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 icon - Icons, see KIconLoader.
* @li @c kcfg - KConfigXT config files. * @li @c kcfg - KConfigXT config files.
* @li @c lib - Libraries. * @li @c lib - Libraries.
@ -571,7 +570,6 @@ public:
* of what this is all about. * of what this is all about.
* *
* @li @c data - @c share/apps * @li @c data - @c share/apps
* @li @c html - @c share/doc/HTML
* @li @c icon - @c share/icon * @li @c icon - @c share/icon
* @li @c config - @c share/config * @li @c config - @c share/config
* @li @c pixmap - @c share/pixmaps * @li @c pixmap - @c share/pixmaps

View file

@ -157,18 +157,6 @@ void KStandarddirsTest::testFindAllResources()
QVERIFY( !oneEndsWith( configFilesWithFilter, "share/config/accept-languages.codes" ) ); // didn't match the filter QVERIFY( !oneEndsWith( configFilesWithFilter, "share/config/accept-languages.codes" ) ); // didn't match the filter
QCOMPARE(fileNames.count(), configFilesWithFilter.count()); QCOMPARE(fileNames.count(), configFilesWithFilter.count());
QVERIFY(fileNames.contains("kdebugrc")); 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() void KStandarddirsTest::testFindAllResourcesNewDir()

View file

@ -17,7 +17,7 @@ PreviewTest::PreviewTest()
{ {
QGridLayout *layout = new QGridLayout(this); QGridLayout *layout = new QGridLayout(this);
m_url = new KLineEdit(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); layout->addWidget(m_url, 0, 0);
QPushButton *btn = new QPushButton("Generate", this); QPushButton *btn = new QPushButton("Generate", this);
connect(btn, SIGNAL(clicked()), SLOT(slotGenerate())); connect(btn, SIGNAL(clicked()), SLOT(slotGenerate()));