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

List:       kde-commits
Subject:    KDE/kdelibs/kio/kio
From:       David Faure <faure () kde ! org>
Date:       2010-09-30 22:13:37
Message-ID: 20100930221337.0E933AC891 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1181399 by dfaure:

Apply changes to the configuration immediately (e.g. reload useragent configs), \
before we open any URL. Otherwise one had to hit "reload" after using the uachanger \
plugin, just because the dbus signal was processed after the openUrl call.
Tested on http://whatsmyuseragent.com/


 M  +12 -4     scheduler.cpp  
 M  +1 -1      scheduler.h  


--- trunk/KDE/kdelibs/kio/kio/scheduler.cpp #1181398:1181399
@@ -705,7 +705,7 @@
     void slotSlaveStatus(pid_t pid, const QByteArray &protocol,
                          const QString &host, bool connected);
 
-    void slotReparseSlaveConfiguration(const QString &);
+    void slotReparseSlaveConfiguration(const QString &, const QDBusMessage&);
 
     void slotSlaveConnected();
     void slotSlaveError(int error, const QString &errorMsg);
@@ -758,7 +758,7 @@
     dbus.registerObject( "/KIO/Scheduler", this, \
                QDBusConnection::ExportScriptableSlots |
                                                  \
                QDBusConnection::ExportScriptableSignals );
     dbus.connect(QString(), dbusPath, dbusInterface, "reparseSlaveConfiguration",
-                 this, SLOT(slotReparseSlaveConfiguration(QString)));
+                 this, SLOT(slotReparseSlaveConfiguration(QString,QDBusMessage)));
 }
 
 Scheduler::~Scheduler()
@@ -863,12 +863,20 @@
 void Scheduler::emitReparseSlaveConfiguration()
 {
     emit self()->reparseSlaveConfiguration( QString() );
+
+    // Do it immediately in this process, otherwise we might send a request before \
reparsing +    // (e.g. when changing useragent in the plugin)
+    schedulerPrivate->slotReparseSlaveConfiguration(QString(), QDBusMessage());
 }
 
 
-void SchedulerPrivate::slotReparseSlaveConfiguration(const QString &proto)
+void SchedulerPrivate::slotReparseSlaveConfiguration(const QString &proto, const \
QDBusMessage& msg)  {
-    kDebug(7006) << proto;
+    if (QDBusConnection::sessionBus().baseService() == msg.service()) {
+        kDebug(7006) << "Ignoring signal sent by myself";
+        return;
+    }
+    kDebug(7006) << "proto=" << proto;
     KProtocolManager::reparseConfiguration();
     SlaveConfig::self()->reset();
     sessionData.reset();
--- trunk/KDE/kdelibs/kio/kio/scheduler.h #1181398:1181399
@@ -283,7 +283,7 @@
                                                const QString &host, bool connected))
 
         // connected to D-Bus signal:
-        Q_PRIVATE_SLOT(schedulerPrivate, void slotReparseSlaveConfiguration(const \
QString &)) +        Q_PRIVATE_SLOT(schedulerPrivate, void \
slotReparseSlaveConfiguration(const QString &, const QDBusMessage&))  
         Q_PRIVATE_SLOT(schedulerPrivate, void slotSlaveConnected())
         Q_PRIVATE_SLOT(schedulerPrivate, void slotSlaveError(int error, const \
QString &errorMsg))


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

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