Commit d41679c9 authored by Vijay Krishnavanshi's avatar Vijay Krishnavanshi Committed by Pali Rohár

adapted slot and signals to Qt5

parent 4c7b000a
......@@ -124,11 +124,16 @@ void WebPresencePlugin::listenToAccount(Kopete::Account *account)
if (account && account->myself()) {
// Connect to the account's status changed signal
// because we can't know if the account has already connected
QObject::disconnect(account->myself(), SIGNAL(onlineStatusChanged(Kopete::Contact *, const Kopete::OnlineStatus&, const Kopete::OnlineStatus&)), this, SLOT(slotWaitMoreStatusChanges()));
QObject::connect(account->myself(), SIGNAL(onlineStatusChanged(Kopete::Contact *, const Kopete::OnlineStatus&, const Kopete::OnlineStatus&)), this, SLOT(slotWaitMoreStatusChanges()));
QObject::disconnect(account->myself(), &Kopete::Contact::onlineStatusChanged, this, &WebPresencePlugin::slotRecieveStatusUpdate);
QObject::connect(account->myself(), &Kopete::Contact::onlineStatusChanged, this, &WebPresencePlugin::slotRecieveStatusUpdate);
}
}
void WebPresencePlugin::slotRecieveStatusUpdate(Kopete::Contact * /* args */, const Kopete::OnlineStatus& /* args */, const Kopete::OnlineStatus& /* args */)
{
slotWaitMoreStatusChanges();
}
void WebPresencePlugin::slotWaitMoreStatusChanges()
{
if (!m_writeScheduler->isActive()) {
......@@ -141,7 +146,7 @@ void WebPresencePlugin::slotWriteFile()
m_writeScheduler->stop();
// generate the (temporary) XML file representing the current contact list
const QUrl dest = WebPresenceConfig::self()->uploadURL();
const QUrl dest = QUrl::fromLocalFile(WebPresenceConfig::self()->uploadURL().path());
if (dest.isEmpty() || !dest.isValid()) {
kDebug(14309) << "url is empty or not valid. NOT UPDATING!";
return;
......@@ -177,7 +182,7 @@ void WebPresencePlugin::slotWriteFile()
}
// upload it to the specified URL
QUrl src(m_output->fileName());
QUrl src = QUrl::fromLocalFile(m_output->fileName());
KIO::FileCopyJob *job = KIO::file_move(src, dest, -1, KIO::Overwrite | KIO::HideProgressInfo);
connect(job, &KIO::FileCopyJob::result, this, &WebPresencePlugin::slotUploadJobResult);
}
......
......@@ -24,6 +24,7 @@
#include <QUrl>
#include "kopetecontact.h"
#include "kopeteplugin.h"
class QTimer;
......@@ -81,6 +82,10 @@ protected Q_SLOTS:
* Called when an upload finished, displays error if needed
*/
void slotUploadJobResult(KJob *);
/**
* This slot is used for normalising the signal recieved
*/
void slotRecieveStatusUpdate(Kopete::Contact *, const Kopete::OnlineStatus&, const Kopete::OnlineStatus&);
/**
* Called to schedule a write, after waiting to see if more changes
* occur (accounts tend to change status together)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment