commit kbluetooth for openSUSE:Factory
Hello community, here is the log from the commit of package kbluetooth for openSUSE:Factory checked in at Thu Feb 25 02:28:48 CET 2010. -------- --- KDE/kbluetooth/kbluetooth.changes 2010-02-03 09:34:16.000000000 +0100 +++ /mounts/work_src_done/STABLE/kbluetooth/kbluetooth.changes 2010-02-22 20:07:21.000000000 +0100 @@ -1,0 +2,11 @@ +Mon Feb 22 19:04:30 UTC 2010 - tittiatcoke@gmail.com + +- update to 0.4.2 + * Fix speed calculation when receiving and sending filesI + * Pairing request are accepted also when clicking on Trust button + * Important dialogs are modal, so they’re not hidden by other + applications + * Fix a crash that happens when the sender device disconnects + before the file transfer is accepted + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- kbluetooth-0.4.tar.bz2 New: ---- kbluetooth-0.4.2.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kbluetooth.spec ++++++ --- /var/tmp/diff_new_pack.C9fVsJ/_old 2010-02-25 02:21:58.000000000 +0100 +++ /var/tmp/diff_new_pack.C9fVsJ/_new 2010-02-25 02:21:58.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package kbluetooth (Version 0.4) +# spec file for package kbluetooth (Version 0.4.2) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -24,10 +24,10 @@ Group: System/GUI/KDE Summary: The bluetooth framework for KDE4 Url: http://www.kde-apps.org/content/show.php/kbluetooth?content=112110 -Version: 0.4 +Version: 0.4.2 Release: 1 BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: kbluetooth-0.4.tar.bz2 +Source0: kbluetooth-%{version}.tar.bz2 Requires: obex-data-server kdebase4-workspace >= 4.1.96 Requires: bluez >= 4 Requires: obex-data-server >= 0.4 @@ -63,7 +63,7 @@ Tom Patzig <tpatzig@suse.de> %prep -%setup -q -n kbluetooth-0.4 +%setup -q -n kbluetooth-%{version} %patch0 -p1 %build ++++++ kbluetooth-0.4.tar.bz2 -> kbluetooth-0.4.2.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kbluetooth-0.4/src/agent/agent.cpp new/kbluetooth-0.4.2/src/agent/agent.cpp --- old/kbluetooth-0.4/src/agent/agent.cpp 2010-02-01 21:37:39.000000000 +0100 +++ new/kbluetooth-0.4.2/src/agent/agent.cpp 2010-02-21 23:21:47.000000000 +0100 @@ -69,6 +69,7 @@ int ret; currentDialog = dialog; + currentDialog->setModal(true); ret = currentDialog->exec(); currentDialog = 0; @@ -93,8 +94,7 @@ return; } case(1): { - QDBusMessage error = msg.createErrorReply("org.bluez.Error.Rejected", "Authorization rejected"); - QDBusConnection::systemBus().send(error); + //No error no anything means OK, and this case is for the Trust button return; } case(0): { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kbluetooth-0.4/src/obexserver/obexserversession.cpp new/kbluetooth-0.4.2/src/obexserver/obexserversession.cpp --- old/kbluetooth-0.4/src/obexserver/obexserversession.cpp 2010-02-01 21:37:38.000000000 +0100 +++ new/kbluetooth-0.4.2/src/obexserver/obexserversession.cpp 2010-02-21 23:21:47.000000000 +0100 @@ -53,6 +53,7 @@ ObexServerSession::~ObexServerSession() { delete manager; + delete fileTransfer; } void ObexServerSession::accept() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kbluetooth-0.4/src/obexserver/obexserversessionfiletransfer.cpp new/kbluetooth-0.4.2/src/obexserver/obexserversessionfiletransfer.cpp --- old/kbluetooth-0.4/src/obexserver/obexserversessionfiletransfer.cpp 2010-02-01 21:37:38.000000000 +0100 +++ new/kbluetooth-0.4.2/src/obexserver/obexserversessionfiletransfer.cpp 2010-02-21 23:21:47.000000000 +0100 @@ -31,6 +31,7 @@ ObexServerSessionFileTransfer::ObexServerSessionFileTransfer(ObexServerSession* serverSession, QDBusInterface* session, const QString& filename, const QString& path, qulonglong size) { + setAutoDelete(false); m_serverSession = serverSession; m_dbusSession = session; m_fileName = filename; @@ -76,15 +77,24 @@ setTotalAmount(Bytes, m_totalFileSize); setProcessedAmount(Bytes, 0); m_dbusSession->call("Accept"); + m_time = QTime::currentTime(); + m_procesedBytes = 0; } void ObexServerSessionFileTransfer::slotTransferProgress(qulonglong transferred) { - kDebug() << "Transfer progress ..."; - ulong currentPercent = percent(); + kDebug() << "Transfer progress ..." << transferred; + + QTime currentTime = QTime::currentTime(); + int time = m_time.secsTo(currentTime); + if (time != 0) { + qulonglong diffBytes = transferred - m_procesedBytes; + float speed = diffBytes / time; + kDebug() << "Bytes: " << diffBytes << " Speed: " << speed; + emitSpeed(speed); + m_time = currentTime; + m_procesedBytes = transferred; + } setProcessedAmount(Bytes, transferred); - ulong newPercent = percent(); - double unit = m_totalFileSize / 100.0; - emitSpeed(newPercent*unit - currentPercent*unit); } void ObexServerSessionFileTransfer::slotTransferCompleted() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kbluetooth-0.4/src/obexserver/obexserversessionfiletransfer.h new/kbluetooth-0.4.2/src/obexserver/obexserversessionfiletransfer.h --- old/kbluetooth-0.4/src/obexserver/obexserversessionfiletransfer.h 2010-02-01 21:37:38.000000000 +0100 +++ new/kbluetooth-0.4.2/src/obexserver/obexserversessionfiletransfer.h 2010-02-21 23:21:47.000000000 +0100 @@ -61,6 +61,8 @@ QString m_remoteName; QString m_remoteAddr; Solid::Control::BluetoothRemoteDevice bluetoothDevice; + QTime m_time; + qlonglong m_procesedBytes; }; #endif // OBEXSERVERSESSIONFILETRANSFER_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kbluetooth-0.4/src/obexsession/obexsession.cpp new/kbluetooth-0.4.2/src/obexsession/obexsession.cpp --- old/kbluetooth-0.4/src/obexsession/obexsession.cpp 2010-02-01 21:37:39.000000000 +0100 +++ new/kbluetooth-0.4.2/src/obexsession/obexsession.cpp 2010-02-21 23:21:48.000000000 +0100 @@ -111,7 +111,9 @@ void ObexSession::disconnect() { + kDebug() << "CAlling disconnect"; session->call("Disconnect"); + session->call("Close"); } void ObexSession::close() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kbluetooth-0.4/src/obexsession/obexsessionfiletransfer.cpp new/kbluetooth-0.4.2/src/obexsession/obexsessionfiletransfer.cpp --- old/kbluetooth-0.4/src/obexsession/obexsessionfiletransfer.cpp 2010-02-01 21:37:39.000000000 +0100 +++ new/kbluetooth-0.4.2/src/obexsession/obexsessionfiletransfer.cpp 2010-02-21 23:21:48.000000000 +0100 @@ -71,15 +71,24 @@ setTotalAmount(Bytes, totalSize); m_totalFileSize = totalSize; setProcessedAmount(Bytes, 0); + m_time = QTime::currentTime(); + m_procesedBytes = 0; } void ObexSessionFileTransfer::slotTransferProgress(qulonglong transferred) { - kDebug() << "Transfer progress ..."; - ulong currentPercent = percent(); + kDebug() << "Transfer progress ..." << transferred; + + QTime currentTime = QTime::currentTime(); + int time = m_time.secsTo(currentTime); + if (time != 0) { + qulonglong diffBytes = transferred - m_procesedBytes; + float speed = diffBytes / time; + kDebug() << "Bytes: " << diffBytes << " Speed: " << speed; + emitSpeed(speed); + m_time = currentTime; + m_procesedBytes = transferred; + } setProcessedAmount(Bytes, transferred); - ulong newPercent = percent(); - double unit = m_totalFileSize / 100.0; - emitSpeed(newPercent*unit - currentPercent*unit); } void ObexSessionFileTransfer::slotTransferCompleted() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kbluetooth-0.4/src/obexsession/obexsessionfiletransfer.h new/kbluetooth-0.4.2/src/obexsession/obexsessionfiletransfer.h --- old/kbluetooth-0.4/src/obexsession/obexsessionfiletransfer.h 2010-02-01 21:37:39.000000000 +0100 +++ new/kbluetooth-0.4.2/src/obexsession/obexsessionfiletransfer.h 2010-02-21 23:21:48.000000000 +0100 @@ -21,6 +21,7 @@ #define OBEXSESSIONFILETRANSFER_H #include <KJob> +#include <QDate> class ObexSession; class QDBusInterface; @@ -48,5 +49,7 @@ QDBusInterface* m_dbusSession; QString m_localPath; qulonglong m_totalFileSize; + QTime m_time; + qlonglong m_procesedBytes; }; #endif // OBEXSESSIONFILETRANSFER_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kbluetooth-0.4/src/trayicon.cpp new/kbluetooth-0.4.2/src/trayicon.cpp --- old/kbluetooth-0.4/src/trayicon.cpp 2010-02-01 21:37:39.000000000 +0100 +++ new/kbluetooth-0.4.2/src/trayicon.cpp 2010-02-21 23:21:49.000000000 +0100 @@ -73,7 +73,7 @@ m_kBlueLock = 0; m_wallet = 0; modes << "Off" << "Discoverable" << "Connectable" ; - + setParent(kapp); setIconByName("kbluetooth"); setToolTip("kbluetooth", "KBluetooth", "KDE bluetooth framework"); @@ -132,18 +132,18 @@ server->close(); delete server; } - + if(serversession) { serversession->cancel(); serversession->disconnect(); delete serversession; } - + delete confGroup; delete config; - + delete m_kBlueLock; - + delete m_aboutDialog; qDebug() << "bye bye"; } @@ -250,7 +250,7 @@ agent->setExitOnRelease(false); updateTooltip(); - + sendToAction->setEnabled(true); wizardAction->setEnabled(true); adapterAction->setEnabled(true); @@ -316,32 +316,32 @@ } void KBlueTray::updateTooltip() { - kDebug() << "Updating Tooltip"; + kDebug() << "Updating Tooltip"; if(!online) { toolTipInfo = i18n("No Bluetooth Adapter"); return; } - if(!adapter || !server ) + if(!adapter || !server ) return; - - + + toolTipInfo = "<b>Name:</b> " + adapter->name() + "<br />" \ + "<b>Address:</b> " + adapter->address() + "<br />" \ + "<b>KBlueLock:</b> "; if (!kblueLockEnabled) - toolTipInfo += "Disabled"; + toolTipInfo += "Disabled"; else toolTipInfo += ("Enabled for " + lockDeviceName); - + toolTipInfo += "<br /><b>Receiving Files:</b> "; if(server) { toolTipInfo += ((server->isStarted()) ? "Enabled" : "Disabled"); } else { toolTipInfo += "Disabled"; } - + //tray->setToolTip(toolTipInfo); } @@ -383,7 +383,7 @@ m_aboutDialog = new KAboutApplicationDialog(KGlobal::mainComponent().aboutData()); m_aboutDialog->exec(); } - + if(m_aboutDialog->isVisible()){ m_aboutDialog->raise(); }else{ @@ -507,7 +507,7 @@ obexSessionReady(); }else{ kDebug() << "Calling disconnect"; - connect(session,SIGNAL(disconnected()),this,SLOT(fileTransferFinal())); + connect(session,SIGNAL(closed()),this,SLOT(fileTransferFinal())); session->disconnect(); } } @@ -583,18 +583,18 @@ { m_kBlueLock->disable(); kDebug() << "Periodic Discovery Stopped"; - + m_kBlueLock = new KBlueLock(adapter); m_kBlueLock->unlockEnable(true); lockSelector = new DeviceSel(this,QString("computer,phone").split(',')); lockSelector->setOkButtonText("Select"); lockSelector->setInfoLabel(i18n("Selecting a device enables KBlueLock (a balloon message will pop up from the tray when your target device is found and KBlueLock is ready).\nIf the device disappears, your screen will be locked.")); - + connect(lockSelector, SIGNAL(deviceSelected(QString)), m_kBlueLock, SLOT(enable(QString))); connect(lockSelector,SIGNAL(selectorCancelled()),this,SLOT(slotBlueSelectorCancelled())); connect(lockSelector, SIGNAL(unlockChanged(bool)), m_kBlueLock, SLOT(unlockEnable(bool))); - + connect(m_kBlueLock, SIGNAL(lockEnabled()), this, SLOT(lockEnabled())); connect(m_kBlueLock, SIGNAL(lockDisabled()), this, SLOT(lockDisabled())); connect(m_kBlueLock, SIGNAL(lockReady()), this, SLOT(lockReady())); @@ -631,6 +631,7 @@ dialog->setCaption(i18n("Received files directory:")); dialog->setButtons(KDialog::Ok | KDialog::Cancel); dialog->setMinimumWidth(430); + dialog->setModal(true); int response = dialog->exec(); QString saveUrl = urlR->url().path(); @@ -640,7 +641,7 @@ config->group("ObexServer").sync(); } delete dialog; - + } void KBlueTray::openObexError() { @@ -774,6 +775,9 @@ fileTransfer->setLocalPath(saveUrl); } kDebug() << "transfer started"; + if (!fileTransfer) { + return; + } #ifdef HAVE_NEPOMUK connect(fileTransfer, SIGNAL( result(KJob*) ), this, SLOT( slotFileReceiveComplete(KJob*) )); #endif ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de