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

List:       kde-commits
Subject:    KDE/kdebase/workspace/kcontrol/kfontinst/dbus
From:       Craig Drummond <craig () kde ! org>
Date:       2010-01-19 23:07:02
Message-ID: 1263942422.315890.28693.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1077329 by craig:

Can't use KAuth CMake macros, as KFontinst is not actually using KAuth -
but uses PolkitQt directly, as KAuth does not support Kfontinst's method
of operation.

KFontinst seems to require the '<policy context="default">' section in
the system dbus config file - and KAuth does not seem to be adding this.

When checking if the system service is started, call a simple 'ping()'
method so that the service is instantiated.

BUG: 223107


 M  +9 -1      CMakeLists.txt  
 M  +5 -0      FontInst.cpp  
 M  +9 -11     FontInst.h  
 M  +8 -2      FontinstIface.h  
 A             org.kde.fontinst.conf  
 A             org.kde.fontinst.system-service.cmake  
 M  +3 -0      org.kde.fontinst.xml  


--- trunk/KDE/kdebase/workspace/kcontrol/kfontinst/dbus/CMakeLists.txt \
#1077328:1077329 @@ -23,5 +23,13 @@
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/session/org.kde.fontinst.service \
DESTINATION ${DBUS_SERVICES_INSTALL_DIR} )  
 # Use KAuth macros to create and install system dbus and policykit files
-kde4_install_auth_helper_files(fontinst org.kde.fontinst root)
+# Because I'm not using KAuth, but Polkit directly - org.kde.auth.conf needs 'policy \
context="default"' settings +# So, for the moment, dont use KAurth macro...
+# kde4_install_auth_helper_files(fontinst org.kde.fontinst root)
+
+install( FILES org.kde.fontinst.conf
+         DESTINATION ${SYSCONF_INSTALL_DIR}/dbus-1/system.d )
+configure_file(org.kde.fontinst.system-service.cmake \
${CMAKE_CURRENT_BINARY_DIR}/org.kde.fontinst.service) +install(FILES \
${CMAKE_CURRENT_BINARY_DIR}/org.kde.fontinst.service DESTINATION \
${DBUS_SYSTEM_SERVICES_INSTALL_DIR} ) +
 kde4_install_auth_actions(org.kde.fontinst fontinst.actions)
--- trunk/KDE/kdebase/workspace/kcontrol/kfontinst/dbus/FontInst.cpp #1077328:1077329
@@ -138,6 +138,11 @@
         theFolders[i].saveDisabled();
 }
 
+int FontInst::ping()
+{
+    return PING_STATUS_ALIVE;
+}
+
 void FontInst::list(int folders, int pid)
 {
     KFI_DBUG << folders << pid;
--- trunk/KDE/kdebase/workspace/kcontrol/kfontinst/dbus/FontInst.h #1077328:1077329
@@ -67,6 +67,11 @@
         STATUS_NO_SYS_CONNECTION
     };
 
+    enum EPingStatus
+    {
+        PING_STATUS_ALIVE = 1
+    };
+    
     enum EFolder
     {
         FOLDER_SYS,
@@ -93,17 +98,9 @@
 
     static bool isStarted(OrgKdeFontinstInterface *iface)
     {
-        QDBusReply<QStringList> \
                reply=iface->connection().interface()->registeredServiceNames();
-        if(reply.isValid())
-        {
-            QStringList                services(reply.value());
-            QStringList::ConstIterator it(services.begin()),
-                                        end(services.end());
-            for(; it!=end; ++it)
-                if((*it)==OrgKdeFontinstInterface::staticInterfaceName())
-                    return true;
-        }
-        return false;
+        int status=iface->ping();
+        printf("STATUS:%d\n", status);
+        return PING_STATUS_ALIVE==status;
     }
     
     FontInst(bool onSystemBus);
@@ -111,6 +108,7 @@
 
     public Q_SLOTS:
 
+    Q_SCRIPTABLE int  ping();
     Q_NOREPLY    void list(int folders, int pid);
     Q_NOREPLY    void stat(const QString &font, int folders, int pid);
     Q_NOREPLY    void install(const QString &file, bool createAfm, bool toSystem, \
                int pid, unsigned int xid, bool checkConfig);
--- trunk/KDE/kdebase/workspace/kcontrol/kfontinst/dbus/FontinstIface.h \
#1077328:1077329 @@ -8,8 +8,8 @@
  * Do not edit! All changes made to it will be lost.
  */
 
-#ifndef FONTINSTIFACE_H_1253199091
-#define FONTINSTIFACE_H_1253199091
+#ifndef FONTINSTIFACE_H
+#define FONTINSTIFACE_H
 
 #include <QtCore/QObject>
 #include <QtCore/QByteArray>
@@ -79,6 +79,12 @@
         callWithArgumentList(QDBus::NoBlock, QLatin1String("move"), argumentList);
     }
 
+    inline QDBusPendingReply<int> ping()
+    {
+        QList<QVariant> argumentList;
+        return asyncCallWithArgumentList(QLatin1String("ping"), argumentList);
+    }
+
     inline Q_NOREPLY void reconfigure(int pid)
     {
         QList<QVariant> argumentList;
--- trunk/KDE/kdebase/workspace/kcontrol/kfontinst/dbus/org.kde.fontinst.xml \
#1077328:1077329 @@ -27,6 +27,9 @@
       <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="const \
                KFI::Families &amp;"/>
       <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="const \
KFI::Families &amp;"/>  </signal>
+    <method name="ping">
+      <arg type="i" direction="out"/>
+    </method>
     <method name="list">
       <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" \
                value="QList&lt;KFI::Families&gt;"/>
       <annotation name="com.trolltech.QtDBus.QtTypeName.In0" \
value="QList&lt;KFI::Families&gt;"/>


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

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