[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:       2005-02-19 22:57:47
Message-ID: 20050219225747.34CE91B90C () office ! kde ! org
[Download RAW message or body]

CVS commit by craig: 

1. List fonts:/System even when default system location (/usr/local/share/fonts) does \
not exist. This allows installed system fonts to be shown (as list comes from \
fontconfig). Plus, folder is created when try to install. 2. When copying from file:/ \
to fonts:/system if default system location does not exist, then try to create.


  M +37 -4     KioFonts.cpp   1.51


--- kdebase/kcontrol/kfontinst/kio/KioFonts.cpp  #1.50:1.51
@@ -62,4 +62,5 @@
 #include <kdesu/su.h>
 #include <kprocess.h>
+#include <kdebug.h>
 #include <kxftconfig.h>
 #include <fontconfig/fontconfig.h>
@@ -70,10 +71,18 @@
 #include <ctype.h>
 
-#define KFI_DBUG kdDebug() << "[" << (int)(getpid()) << "] "
-#undef KFI_DBUG
+//#define KFI_FORCE_DEBUG_TO_STDERR
+
+#ifdef KFI_FORCE_DEBUG_TO_STDERR
+
 #include <qtextstream.h>
 QTextOStream ostr(stderr);
 #define KFI_DBUG ostr << "[" << (int)(getpid()) << "] "
 
+#else
+
+#define KFI_DBUG kdDebug() << "[" << (int)(getpid()) << "] "
+
+#endif
+
 #define MAX_IPC_SIZE   (1024*32)
 #define TIMEOUT        2         // Time between last mod and writing files...
@@ -180,4 +189,18 @@ static bool createUDSEntry(KIO::UDSEntry
         return true;
     }
+    else if (folder && sys && !KFI::Misc::root())   // 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);
+        addAtom(entry, KIO::UDS_FILE_TYPE, S_IFDIR);
+        addAtom(entry, KIO::UDS_ACCESS, 0744);
+        addAtom(entry, KIO::UDS_USER, 0, "root");
+        addAtom(entry, KIO::UDS_GROUP, 0, "root");
+        addAtom(entry, KIO::UDS_MIME_TYPE, 0, \
KFI_KIO_FONTS_PROTOCOL"/system-folder"); +        addAtom(entry, \
KIO::UDS_GUESSED_MIME_TYPE, 0, "application/octet-stream"); +
+        return true;
+    }
+
 
     return false;
@@ -1125,9 +1148,19 @@ void CKioFonts::copy(const KURL &src, co
                 if(nonRootSys(dest))
                 {
-                    QCString              cmd("cp -f ");
+                    QCString              cmd;
                     QStringList::Iterator it,
                                           end=srcFiles.end();
                     int                   size=0;
 
+                    if(!Misc::dExists(itsFolders[destFolder].location))
+                    {
+                        cmd+="mkdir ";
+                        \
cmd+=QFile::encodeName(KProcess::quote(itsFolders[destFolder].location)); +           \
cmd+=" && chmod 0755 "; +                        \
cmd+=QFile::encodeName(KProcess::quote(itsFolders[destFolder].location)); +           \
cmd+=" && "; +                    }
+                    cmd+="cp -f ";
+
                     for(it=srcFiles.begin(); it!=end; ++it) 
                     {


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

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