--- kdeebase-3.4/kcontrol/kfontinst/kcmfontinst/KCmFontInst.cpp.orig 2005-02-23 14:25:11 +0300
+++ kdeebase-3.4/kcontrol/kfontinst/kcmfontinst/KCmFontInst.cpp 2005-03-22 21:55:39 +0300
@@ -160,6 +160,8 @@ CKCmFontInst::CKCmFontInst(QWidget *pare
fontsLayout->addWidget(button, 1, 0);
fontsLayout->addItem(new QSpacerItem(4, 4, QSizePolicy::Expanding, QSizePolicy::Minimum));
+if ( getuid() != 0)
+{
layout->addWidget(toolbar);
#ifdef HAVE_XFT
layout->addWidget(itsPreview ? itsSplitter : fontsFrame);
@@ -167,6 +169,11 @@ CKCmFontInst::CKCmFontInst(QWidget *pare
layout->addWidget(fontsFrame);
#endif
layout->addWidget(itsStatusLabel);
+}
+else
+{
+ layout->addWidget( new QLabel( i18n("Disabled for root"), this ) );
+}
setButtons(0);
setRootOnlyMsg(i18n("The fonts shown are your personal fonts.
To see (and install) "
--- kdeebase-3.4/kcontrol/kfontinst/kcmfontinst/kcmfontinst.desktop.orig 2005-02-23 14:25:11 +0300
+++ kdeebase-3.4/kcontrol/kfontinst/kcmfontinst/kcmfontinst.desktop 2005-03-22 21:58:17 +0300
@@ -8,7 +8,6 @@ DocPath=kcontrol/kcmfontinst/index.html
X-KDE-Library=fontinst
X-KDE-FactoryName=fontinst
-X-KDE-RootOnly=true
X-KDE-ParentApp=kcontrol
--- kdebase-3.5.10/kcontrol/kfontinst/kio/KioFonts.cpp~ 2008-06-13 16:14:08 +0400
+++ kdebase-3.5.10/kcontrol/kfontinst/kio/KioFonts.cpp 2008-09-17 14:58:58 +0400
@@ -295,7 +295,7 @@ static bool createFolderUDSEntry(KIO::UD
QString url(KFI_KIO_FONTS_PROTOCOL+QString::fromLatin1(":/"));
return true;
}
- else if (sys && !Misc::root()) // Default system fonts folder does not actually exist yet!
+ else if (sys && true) // Default system fonts folder does not actually exist yet!
{
KFI_DBUG << "Default system folder (" << path << ") does not yet exist, so create dummy entry" << endl;
addAtom(entry, KIO::UDS_NAME, 0, name);
@@ -395,9 +395,9 @@ static bool createFontUDSEntry(KIO::UDSE
QString url(KFI_KIO_FONTS_PROTOCOL+QString::fromLatin1(":/"));
- if(!Misc::root())
+ if(true)
{
- url+=sys ? i18n(KFI_KIO_FONTS_SYS) : i18n(KFI_KIO_FONTS_USER);
+ url+=i18n(KFI_KIO_FONTS_USER);
url+=QString::fromLatin1("/");
}
if(multiple)
@@ -436,7 +436,7 @@ static KURL getRedirect(const KURL &u)
static bool nonRootSys(const KURL &u)
{
- return !Misc::root() && isSysFolder(CKioFonts::getSect(u.path()));
+ return true && isSysFolder(CKioFonts::getSect(u.path()));
}
static QString getFontFolder(const QString &defaultDir, const QString &root, QStringList &dirs)
@@ -707,7 +707,7 @@ static bool getFontList(const QStringLis
CKioFonts::CKioFonts(const QCString &pool, const QCString &app)
: KIO::SlaveBase(KFI_KIO_FONTS_PROTOCOL, pool, app),
- itsRoot(Misc::root()),
+ itsRoot(false),
itsUsingFcFpe(false),
itsUsingXfsFpe(false),
itsHasSys(false),
@@ -845,6 +845,7 @@ void CKioFonts::listDir(const KURL &url)
for ( ; it != end; ++it)
{
+ if( FOLDER_SYS==folder ) continue;
entry.clear();
if(createFontUDSEntry(entry, it.key(), it.data(), FOLDER_SYS==folder))
listEntry(entry, false);
@@ -857,8 +858,10 @@ void CKioFonts::listDir(const KURL &url)
totalSize(size);
createFolderUDSEntry(entry, i18n(KFI_KIO_FONTS_USER), itsFolders[FOLDER_USER].location, false);
listEntry(entry, false);
+#if 0
createFolderUDSEntry(entry, i18n(KFI_KIO_FONTS_SYS), itsFolders[FOLDER_SYS].location, true);
listEntry(entry, false);
+#endif
}
listEntry(size ? entry : KIO::UDSEntry(), true);
@@ -1066,7 +1069,7 @@ void CKioFonts::put(const KURL &u, int m
{
KFI_DBUG << "put " << u.path() << endl;
- if(isHidden(u))
+ if(isHidden(u) || nonRootSys(u))
{
error(KIO::ERR_WRITE_ACCESS_DENIED, u.prettyURL());
return;
@@ -1311,7 +1314,7 @@ void CKioFonts::copy(const KURL &src, co
//
KFI_DBUG << "copy " << src.prettyURL() << " - " << d.prettyURL() << endl;
- if(isHidden(d))
+ if(isHidden(d) || nonRootSys(KURL(d)))
{
error(KIO::ERR_WRITE_ACCESS_DENIED, d.prettyURL());
return;