[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/kcontrol/kfontinst/kio
From:       Craig Drummond <craig () kde ! org>
Date:       2004-04-03 9:31:11
Message-ID: 20040403093111.6250099E8 () office ! kde ! org
[Download RAW message or body]

CVS commit by craig: 

Make work again for root.


  M +21 -12    KioFonts.cpp   1.27


--- kdebase/kcontrol/kfontinst/kio/KioFonts.cpp  #1.26:1.27
@@ -74,5 +74,12 @@
 #endif
 
+#define KFI_USE_STDERR
+#ifdef KFI_USE_STDERR
+#include <qtextstream.h>
+#include <stdio.h>
+static QTextOStream  KDE_DBUG(stderr);
+#else
 #define KDE_DBUG kdDebug()
+#endif
 
 extern "C"
@@ -142,5 +149,5 @@ static void addAtom(KIO::UDSEntry &entry
 static bool createUDSEntry(KIO::UDSEntry &entry, const QString &name, const QString \
&path, const QString &url, const QString &mime, bool file)  {
-    KDE_DBUG << "createUDSEntry " << name << ' ' << path << endl;
+    KDE_DBUG << "createUDSEntry " << name << ' ' << path << ' ' << url << endl;
 
     KDE_struct_stat buff;
@@ -163,19 +170,19 @@ static bool createUDSEntry(KIO::UDSEntry
         if(file && (CFontEngine::isAFont(cPath) || CFontEngine::isAAfm(cPath)))
         {
-            if(CGlobal::fe().openFont(exists ? path : formattedPath))
-            {
-                QString displayedName(CGlobal::fe().getFullName());
+            QString fontName(CGlobal::fe().createName(exists ? path : \
formattedPath));  
+            if(fontName.isEmpty())
+                addAtom(entry, KIO::UDS_NAME, 0, name);
+            else
+            {
                 if(CFontEngine::isAAfm(cPath))
-                    displayedName+=i18n(", Metrics");
+                    fontName+=i18n(", Metrics");
             
                 if(name[0]=='.')
-                    displayedName+=i18n(KIO_FONTS_DISABLED);
-                addAtom(entry, KIO::UDS_NAME, 0, displayedName);
+                    fontName+=i18n(KIO_FONTS_DISABLED);
+                addAtom(entry, KIO::UDS_NAME, 0, fontName);
                 addAtom(entry, KIO::UDS_URL, 0, url);
                 CGlobal::fe().closeFont();
             }
-            else
-                addAtom(entry, KIO::UDS_NAME, 0, name);
         }
         else
@@ -520,5 +527,5 @@ void CKioFonts::listDir(const QStringLis
 
                             if((QChar('.')==fInfo->fileName()[0] || (!sys && \
                addDir(ds)) || xcfg.subInPath(ds)) &&
-                               createDirEntry(entry, fInfo->fileName(), ds, \
QString(KIO_FONTS_PROTOCOL)+QChar(':')+url.path()+QChar('/')+ +                       \
createDirEntry(entry, fInfo->fileName(), ds, \
                QString(KIO_FONTS_PROTOCOL)+QChar(':')+CMisc::dirSyntax(url.path())+
                                               fInfo->fileName(), sys && \
!CMisc::root()))  {
@@ -1332,5 +1339,7 @@ void CKioFonts::del(const KURL &url, boo
             items.append(*constIt+sub);
  
+#ifndef KFI_USE_STDERR 
     KDE_DBUG << "real " << items << endl;
+#endif
 
     if(items.count())


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic