summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schweizer <genstef@gentoo.org>2007-04-08 11:02:24 +0000
committerStefan Schweizer <genstef@gentoo.org>2007-04-08 11:02:24 +0000
commit7c28fea5b87f2ddd815caa4fee1b1adb649ff704 (patch)
tree18eba9e3f5a032ced5b7085a2cd36d7c5c72318b /net-wireless/kdebluetooth
parentAdded ~ppc64; bug #172817 (diff)
downloadgentoo-2-7c28fea5b87f2ddd815caa4fee1b1adb649ff704.tar.gz
gentoo-2-7c28fea5b87f2ddd815caa4fee1b1adb649ff704.tar.bz2
gentoo-2-7c28fea5b87f2ddd815caa4fee1b1adb649ff704.zip
Add SuSe patches works with bluez-utils-3.7 thanks to Sergey Temerkhanov <temerkhanov@mail.ru> in bug 172832
(Portage version: 2.1.2.3)
Diffstat (limited to 'net-wireless/kdebluetooth')
-rw-r--r--net-wireless/kdebluetooth/ChangeLog12
-rw-r--r--net-wireless/kdebluetooth/files/better-menu-names.diff55
-rw-r--r--net-wireless/kdebluetooth/files/digest-kdebluetooth-1.0_beta2-r23
-rw-r--r--net-wireless/kdebluetooth/files/kcm-btpaired-fix.diff464
-rw-r--r--net-wireless/kdebluetooth/files/kcm-no-dcop-error.diff26
-rw-r--r--net-wireless/kdebluetooth/files/kdebluetooth-dbuspasskeyagent.diff552
-rw-r--r--net-wireless/kdebluetooth/files/kdebluetooth-sdp-bitop.diff42
-rw-r--r--net-wireless/kdebluetooth/files/kdebluetooth.diff19
-rw-r--r--net-wireless/kdebluetooth/kdebluetooth-1.0_beta2-r2.ebuild71
9 files changed, 1243 insertions, 1 deletions
diff --git a/net-wireless/kdebluetooth/ChangeLog b/net-wireless/kdebluetooth/ChangeLog
index 8647e1bda0d8..010189768d2e 100644
--- a/net-wireless/kdebluetooth/ChangeLog
+++ b/net-wireless/kdebluetooth/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for net-wireless/kdebluetooth
# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-wireless/kdebluetooth/ChangeLog,v 1.56 2007/02/02 17:48:14 gustavoz Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-wireless/kdebluetooth/ChangeLog,v 1.57 2007/04/08 11:02:24 genstef Exp $
+
+*kdebluetooth-1.0_beta2-r2 (08 Apr 2007)
+
+ 08 Apr 2007; Stefan Schweizer <genstef@gentoo.org>
+ +files/better-menu-names.diff, +files/kcm-btpaired-fix.diff,
+ +files/kcm-no-dcop-error.diff, +files/kdebluetooth.diff,
+ +files/kdebluetooth-dbuspasskeyagent.diff,
+ +files/kdebluetooth-sdp-bitop.diff, +kdebluetooth-1.0_beta2-r2.ebuild:
+ Add SuSe patches works with bluez-utils-3.7 thanks to Sergey Temerkhanov
+ <temerkhanov@mail.ru> in bug 172832
02 Feb 2007; Gustavo Zacarias <gustavoz@gentoo.org>
kdebluetooth-1.0_beta2-r1.ebuild:
diff --git a/net-wireless/kdebluetooth/files/better-menu-names.diff b/net-wireless/kdebluetooth/files/better-menu-names.diff
new file mode 100644
index 000000000000..e9212c1e42b4
--- /dev/null
+++ b/net-wireless/kdebluetooth/files/better-menu-names.diff
@@ -0,0 +1,55 @@
+Index: kdebluetooth/kdebluetooth-common/Makefile.am
+================================================================================
+--- kdebluetooth/kbtobexclient/kbtobexclient.desktop
++++ kdebluetooth/kbtobexclient/kbtobexclient.desktop
+@@ -4,10 +4,7 @@
+ Icon=kdebluetooth
+ Type=Application
+ MimeType=bluetooth/obex-object-push-profile
+-Name=kbtobexclient
+-Name[ta]=kbtobex கிளைஞ்சன்
+-Name[tr]=kbtobexistemcisi
+-Name[xx]=xxkbtobexclientxx
++Name=Send File via Bluetooth
+ GenericName=Bluetooth OBEX Client
+ GenericName[bg]=OBEX клиент за Bluetooth
+ GenericName[br]=Arlun OBEX Bluetooth
+--- kdebluetooth/kbtserialchat/kbtserialchat.desktop
++++ kdebluetooth/kbtserialchat/kbtserialchat.desktop
+@@ -5,9 +5,7 @@
+ Type=Application
+ MimeType=bluetooth/serial-port-profile
+ Name=kbtserialchat
+-Name[sv]=Kbtserialchat
+-Name[tr]=kbtserisohbet
+-Name[xx]=xxkbtserialchatxx
++Name=Bluetooth Terminal
+ GenericName=Bluetooth Chat
+ GenericName[bg]=Разговор с Bluetooth
+ GenericName[br]=Flapañ gant Bluetooth
+@@ -57,3 +55,4 @@
+ Comment[ta]=புலுடுத்துக்கான சிறிய முடிவு பயன்பாடு.
+ Comment[tr]=Bluetooth için küçük seri terminal uygulaması
+ Comment[xx]=xxSmall serial terminal application for Bluetoothxx
++X-SuSE-Unimportant=true
+--- kdebluetooth/kdebluetooth-common/Makefile.am
++++ kdebluetooth/kdebluetooth-common/Makefile.am
+@@ -7,18 +7,6 @@
+
+ EXTRA_DIST = $(kde_servicetypes_DATA)
+
+-# Bluetooth directory entry in the control center
+-xdg_directory_DATA = kde-settings-network-bluetooth.directory
+-
+-# from kdebase/applnk/Makefile.am
+-install-data-local:
+- $(mkinstalldirs) $(DESTDIR)$(kde_appsdir)/Settings/Network/Bluetooth
+- $(INSTALL_DATA) $(srcdir)/kde-settings-network-bluetooth.directory \
+- $(DESTDIR)$(kde_appsdir)/Settings/Network/Bluetooth/.directory
+-
+-uninstall-local:
+- -rm -f $(DESTDIR)$(kde_appsdir)/Settings/Network/Bluetooth/.directory
+-
+ # Update scripts
+ #update_DATA = kdebluetooth.upd kdebluetooth.sh
+ #updatedir = $(kde_datadir)/kconf_update
diff --git a/net-wireless/kdebluetooth/files/digest-kdebluetooth-1.0_beta2-r2 b/net-wireless/kdebluetooth/files/digest-kdebluetooth-1.0_beta2-r2
new file mode 100644
index 000000000000..d5e6b2783336
--- /dev/null
+++ b/net-wireless/kdebluetooth/files/digest-kdebluetooth-1.0_beta2-r2
@@ -0,0 +1,3 @@
+MD5 3c9b2c4800d8ef0b92dcc481fd9c62c9 kdebluetooth-1.0_beta2.tar.bz2 1228026
+RMD160 52d54f49a1eb5c89b2a5ad9550dc6b85d50b62e9 kdebluetooth-1.0_beta2.tar.bz2 1228026
+SHA256 9d2637a1e9bb220f048ce62014516418163d2bf92c29835a941eb962154e41b7 kdebluetooth-1.0_beta2.tar.bz2 1228026
diff --git a/net-wireless/kdebluetooth/files/kcm-btpaired-fix.diff b/net-wireless/kdebluetooth/files/kcm-btpaired-fix.diff
new file mode 100644
index 000000000000..574d234b2b80
--- /dev/null
+++ b/net-wireless/kdebluetooth/files/kcm-btpaired-fix.diff
@@ -0,0 +1,464 @@
+--- kdebluetooth/kbluetoothd/kcm_btpaired/filesettingsbase.ui
++++ kdebluetooth/kbluetoothd/kcm_btpaired/filesettingsbase.ui
+@@ -1,4 +1,4 @@
+-<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
++<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+ <class>FileSettingsBase</class>
+ <widget class="QWidget">
+ <property name="name">
+@@ -24,7 +24,7 @@
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+- <string>Here you have to specify the correct start/stop commands for BlueZ's &lt;i&gt;hcid&lt;/i&gt; and the location of BlueZ's &lt;i&gt;link_key&lt;/i&gt; file for the distribution you are using.</string>
++ <string>Here you have to specify the correct start/stop commands for BlueZ's &lt;i&gt;hcid&lt;/i&gt; and the directory of the BlueZ's &lt;i&gt;link_key&lt;/i&gt; files for the distribution you are using.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+@@ -123,7 +123,7 @@
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+- <string>Link key file:</string>
++ <string>Link key directory:</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="0" column="1">
+@@ -138,6 +138,9 @@
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
++ <property name="mode">
++ <number>26</number>
++ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+--- kdebluetooth/kbluetoothd/kcm_btpaired/pairedtab.cpp
++++ kdebluetooth/kbluetoothd/kcm_btpaired/pairedtab.cpp
+@@ -44,6 +44,7 @@
+ using namespace std;
+ using namespace KBluetooth;
+
++/* linkkey file is now ASCII format
+ struct HcidLinkKeyStruct {
+ bdaddr_t sba;
+ bdaddr_t dba;
+@@ -54,19 +55,17 @@
+ uint8_t type;
+ time_t time;
+ };
++*/
+
+ PairedTab::PairedTab(QWidget *parent, const char* name) :
+ PairedTabBase(parent, name)
+ {
+ KConfig* config = KApplication::kApplication()->config();
+- linkKeyFilename = config->readEntry("linkKeyFile", "/etc/bluetooth/link_key");
+- config->writeEntry("linkKeyFile", linkKeyFilename);
+- hcidStartCommand = config->readEntry("hcidStartCommand", "/etc/init.d/bluez-utils start");
+- hcidStopCommand = config->readEntry("hcidStopCommand", "/etc/init.d/bluez-utils stop");
++ linkKeyPath = config->readEntry("linkKeyPath", "/var/lib/bluetooth/");
++ config->writeEntry("linkKeyPath", linkKeyPath);
++ hcidStartCommand = config->readEntry("hcidStartCommand", "/etc/init.d/bluetooth start");
++ hcidStopCommand = config->readEntry("hcidStopCommand", "/etc/init.d/bluetooth stop");
+ bDirty = false;
+- linkKeyFileValid = false;
+- reloadList();
+- updateGUI();
+ linkKeyFileWatch = new KDirWatch(this);
+ connect(linkKeyFileWatch, SIGNAL(dirty(const QString&)),
+ this, SLOT(slotKeyFileChanged()));
+@@ -84,13 +83,51 @@
+ baseDialog->hide();
+ connect(baseDialog, SIGNAL(applyClicked()), this, SLOT(slotApplyFileSettings()));
+ connect(baseDialog, SIGNAL(okClicked()), this, SLOT(slotApplyFileSettings()));
++
++ watchKeys();
+
+- linkKeyFileWatch->addFile(linkKeyFilename);
+ linkKeyFileWatch->startScan(true, true);
++
++ reloadList();
++ updateGUI();
++}
++
++void PairedTab::watchKeys() {
++
++ kdDebug() << "watchKeys()" << endl;
++
++ QDir keyDir(linkKeyPath);
++ keyDir.setFilter( QDir::Dirs );
++ keyDir.setNameFilter("*:*:*:*:*");
++
++ QFileInfo *fi;
++ const QFileInfoList *list = keyDir.entryInfoList();
++ QFileInfoListIterator it(*list);
++
++ linkKeyFilename.clear();
++
++ while ((fi = it.current()) != 0) {
++
++ QString btDeviceDir = fi->fileName();
++ QString filename = keyDir.absPath();
++ filename.append("/").append(btDeviceDir).append("/").append("linkkeys");
++
++ QFile keyFile(filename);
++
++ if (keyFile.exists()) {
++ linkKeyFileWatch->addFile(filename);
++ linkKeyFilename.append(filename);
++ }
++
++ ++it;
++ }
+ }
+
+ void PairedTab::reloadList()
+ {
++
++ kdDebug() << "relodList()" << endl;
++
+ if (bDirty) {
+ if (KMessageBox::warningContinueCancel(this, i18n(
+ "The link key file has changed on disk. Do you want to reload the table and \
+@@ -98,82 +135,96 @@
+ return;
+ }
+ }
+-
+- QFile file(linkKeyFilename);
+-
+- kdDebug() << "reloadList()" << endl;
+ pairingList.clear();
+- linkKeyFileValid = false;
+- if (file.open(IO_ReadOnly)) {
+- linkKeyFileValid = true;
+- bool readSizeMismatch = false;
+- while (true) {
+- PairingInfo newInfo;
+- HcidLinkKeyStruct linkKeyStruct;
+- int rSize = 0;
+- if ((rSize = file.readBlock((char*)&linkKeyStruct, sizeof(HcidLinkKeyStruct)))
+- == sizeof(HcidLinkKeyStruct))
+- {
+- newInfo.localAddr = DeviceAddress(linkKeyStruct.sba);
+- newInfo.remoteAddr = DeviceAddress(linkKeyStruct.dba);
+- newInfo.time.setTime_t(linkKeyStruct.time);
+- newInfo.type = linkKeyStruct.type;
+- for (int n=0; n<16; ++n) {
+- newInfo.linkKey[n] = linkKeyStruct.key[n];
+- }
+- newInfo.remoteName = QString(newInfo.remoteAddr);
+- NameCache::getCachedName(newInfo.remoteAddr, newInfo.remoteName);
+- newInfo.remoteClass = 0;
+- NameCache::getCachedClass(newInfo.remoteAddr, newInfo.remoteClass);
+- pairingList.push_back(newInfo);
+- }
+- else {
+- if (rSize != 0) {
+- readSizeMismatch = true;
+- }
+- break;
+- }
+- kdDebug() << "localAddr read:" << QString(newInfo.localAddr) << endl;
+- }
+-
+- linkKeyFileValid = !readSizeMismatch;
+- file.close();
++
++ QStringList::iterator it;
++ for (it = linkKeyFilename.begin(); it != linkKeyFilename.end(); ++it) {
++
++ QFile file((*it));
++
++ if (file.open(IO_ReadOnly)) {
++
++ QTextStream stream(&file);
++ QString line, localAddr, remoteAddr, symLink, remoteClass;
++
++ while (!stream.atEnd()) {
++ PairingInfo newInfo;
++
++ line = stream.readLine();
++
++ QFileInfo fi(file);
++ QDir dir(fi.dir());
++ localAddr = dir.dirName();
++
++ remoteAddr = line.left(17);
++
++ newInfo.localAddr = DeviceAddress(localAddr);
++ newInfo.remoteAddr = DeviceAddress(remoteAddr);
++
++ // XXX: not provided by linkkey file at the moment
++ // newInfo.time.setTime_t(linkKeyStruct.time);
++
++ newInfo.linkKey = line.mid(18, 32);
++
++ newInfo.remoteName = QString(newInfo.remoteAddr);
++ NameCache::getCachedName(newInfo.remoteAddr, newInfo.remoteName);
++
++ newInfo.remoteClass = 0; // not provided by linkkey file at the moment(?) FIXME
++
++ NameCache::getCachedClass(newInfo.remoteAddr, newInfo.remoteClass);
++ pairingList.push_back(newInfo);
++ }
++
++ file.close();
++ }
+ }
+ }
+
+ bool PairedTab::saveList()
+ {
++ kdDebug() << "saveList()" << endl;
++
+ if (bDirty == false) return true;
+
+- kdDebug() << "saveList()" << endl;
+-
+ if (!stopDaemon()) return false;
+-
+- QFile file(linkKeyFilename);
+- if (file.open(IO_WriteOnly)) {
+- for (unsigned int n=0; n<pairingList.size(); ++n) {
+- HcidLinkKeyStruct info;
+- info.dba = pairingList[n].remoteAddr.getBdaddr(false);
+- for (int p=0; p<16; ++p) {
+- info.key[p] = pairingList[n].linkKey[p];
+- }
+- info.sba = pairingList[n].localAddr.getBdaddr(false);
+- info.time = pairingList[n].time.toTime_t();
+- info.type = pairingList[n].type;
+- file.writeBlock(reinterpret_cast<char*>(&info), sizeof(info));
+- }
+- file.close();
+-
+- if (!startDaemon()) return false;
+
+- bDirty = false;
+- return true;
++ QStringList::iterator it;
++ for (it = linkKeyFilename.begin(); it != linkKeyFilename.end(); ++it) {
++
++ QFile file((*it));
++ QFileInfo fi(file);
++ QDir deviceDir(fi.dir());
++
++ // clear linkkey file
++ file.remove();
++
++ if (file.open(IO_WriteOnly)) {
++ QTextStream stream(&file);
++ for (unsigned int n=0; n<pairingList.size(); ++n) {
++
++ if (pairingList[n].localAddr == deviceDir.dirName())
++ continue;
++
++ stream << pairingList[n].remoteAddr << " ";
++ stream << pairingList[n].linkKey << " ";
++ stream << pairingList[n].remoteClass << '\n';
++ }
++ file.close();
++
++ bDirty = false;
++ }
+ }
+- else {
+- KMessageBox::error(this, i18n("Could not write \
+-link key file. Your changes cannot be saved."), i18n("Error"));
+- return false;
++
++ if (bDirty) {
++ KMessageBox::error(this, i18n("Could not write "
++ "all link key files. Your complete changes cannot be saved."), i18n("Error")); // XXX String update
++
++ return false;
+ }
++
++ if (!startDaemon()) return false;
++
++ return true;
+ }
+
+ bool PairedTab::stopDaemon()
+@@ -192,34 +243,53 @@
+
+ void PairedTab::updateGUI()
+ {
+- vector<PairingInfo>::iterator pairIt;
++ kdDebug() << "updateGUI()" << endl;
++ vector<PairingInfo>::iterator pairIt, remoteIt;
++ KBluetooth::DeviceAddress prevLocalAddr;
++ QListViewItem *viewItem = NULL;
+ pairingListView->clear();
+ for (pairIt = pairingList.begin(); pairIt != pairingList.end(); ++pairIt) {
+- QListViewItem *viewItem = new QListViewItem(pairingListView);
+- pairIt->listViewItem = viewItem;
+-
+- viewItem->setText(0, QString(pairIt->remoteName));
+- QListViewItem *remoteAddrItem = new QListViewItem(viewItem);
+- remoteAddrItem->setPixmap(0, KGlobal::iconLoader()->loadIcon(
+- "pda_blue", KIcon::Small, 16));
+- remoteAddrItem->setSelectable(false);
+- remoteAddrItem->setText(0, QString(pairIt->remoteAddr));
+-
+- QListViewItem *localAddrItem = new QListViewItem(viewItem);
+- localAddrItem->setPixmap(0, KGlobal::iconLoader()->loadIcon(
+- "usbpendrive_unmount", KIcon::Small, 16));
+- localAddrItem->setSelectable(false);
+- localAddrItem->setText(0, QString(pairIt->localAddr));
+-
++
++ if (prevLocalAddr != pairIt->localAddr) {
++ kdDebug() << ">> " << pairIt->localAddr << endl;
++ viewItem = new QListViewItem(pairingListView);
++ viewItem->setSelectable(false);
++ viewItem->setText(0, QString(pairIt->localAddr));
++ viewItem->setOpen(true);
++ viewItem->setPixmap(0, KGlobal::iconLoader()->loadIcon(
++ "usbpendrive_unmount", KIcon::Small, 16));
++ }
++
++
++ remoteIt = pairIt;
++ if (remoteIt->localAddr == pairIt->localAddr) {
++ kdDebug() << "\t>> " << remoteIt->remoteAddr << endl;
++ QListViewItem *remoteAddrItem = new QListViewItem(viewItem);
++ remoteIt->listViewItem = remoteAddrItem;
++ QString iconName = DeviceClassMimeConverter::classToIconName(remoteIt->remoteClass);
++ remoteAddrItem->setPixmap(0, KGlobal::iconLoader()->loadIcon(
++ iconName, KIcon::Small, 16));
++
++ remoteAddrItem->setSelectable(true);
++
++ kdDebug() << "remoteName: " << remoteIt->remoteName << endl;
++ if (remoteIt->remoteName == remoteIt->remoteAddr)
++ remoteAddrItem->setText(0, QString(remoteIt->remoteAddr));
++ else
++ remoteAddrItem->setText(0, QString(remoteIt->remoteAddr).append(" / ").append(remoteIt->remoteName));
++ }
++
++
++ /* not provided by the linkkey file at the moment
++
+ QListViewItem *timeItem = new QListViewItem(viewItem);
+ timeItem->setPixmap(0, KGlobal::iconLoader()->loadIcon(
+ "clock", KIcon::Small, 16));
+ timeItem->setSelectable(false);
+ timeItem->setText(0, pairIt->time.toString());
++ */
++ prevLocalAddr = pairIt->localAddr;
+
+- QString iconName = DeviceClassMimeConverter::classToIconName(pairIt->remoteClass);
+- viewItem->setPixmap(0, KGlobal::iconLoader()->loadIcon(
+- iconName, KIcon::Small, 16));
+ }
+ }
+
+@@ -232,9 +302,14 @@
+
+ void PairedTab::slotRemovePairing()
+ {
++ kdDebug() << "slotRemovePairing()" << endl;
+ bool bDirty = false;
++ kdDebug() << "list size: " << pairingList.size() << endl;
+ for (int n=pairingList.size()-1; n>=0; --n) {
++ kdDebug() << n << " remote: " << pairingList[n].remoteAddr << pairingList[n].listViewItem->text(0) << pairingList[n].listViewItem->isSelected() << endl;
+ if (pairingList[n].listViewItem->isSelected()) {
++ kdDebug() << "erase pair: " << n << endl;
++
+ pairingList.erase(pairingList.begin()+n);
+ bDirty = true;
+ }
+@@ -248,20 +323,22 @@
+
+ void PairedTab::slotSelectionChanged()
+ {
+- for (QListViewItem* i=pairingListView->firstChild(); i != NULL;
+- i = i->nextSibling())
+- {
+- if (i->isSelected()) {
+- removePairingButton->setEnabled(true);
+- return;
+- }
++ for (QListViewItem* i=pairingListView->firstChild(); i != NULL; i = i->nextSibling()) {
++ for (QListViewItem *child=i->firstChild(); child != NULL; child = child->nextSibling())
++ {
++ if (child->isSelected()) {
++ removePairingButton->setEnabled(true);
++ return;
++ }
++ }
+ }
++
+ removePairingButton->setEnabled(false);
+ }
+
+ void PairedTab::slotFileSettings()
+ {
+- fileSettingsDialog->linkKeyFileEdit->setURL(linkKeyFilename);
++ fileSettingsDialog->linkKeyFileEdit->setURL(linkKeyPath);
+ fileSettingsDialog->startCommandEdit->setURL(hcidStartCommand);
+ fileSettingsDialog->stopCommandEdit->setURL(hcidStopCommand);
+
+@@ -270,20 +347,26 @@
+
+ void PairedTab::slotApplyFileSettings()
+ {
+- linkKeyFileWatch->removeFile(linkKeyFilename);
++ QStringList::iterator it;
++ for (it = linkKeyFilename.begin(); it != linkKeyFilename.end(); ++it) {
++ linkKeyFileWatch->removeFile((*it));
++ }
+
+- linkKeyFilename = fileSettingsDialog->linkKeyFileEdit->url();
++ linkKeyPath = fileSettingsDialog->linkKeyFileEdit->url();
+ hcidStartCommand = fileSettingsDialog->startCommandEdit->url();
+ hcidStopCommand = fileSettingsDialog->stopCommandEdit->url();
++
++ kdDebug() << "keypath: " << fileSettingsDialog->linkKeyFileEdit->url() << endl;
+
+ KConfig* config = KApplication::kApplication()->config();
+- config->writeEntry("linkKeyFile", linkKeyFilename);
++ config->writeEntry("linkKeyPath", linkKeyPath);
+ config->writeEntry("hcidStartCommand", hcidStartCommand);
+ config->writeEntry("hcidStopCommand", hcidStopCommand);
++
++ watchKeys();
++
+ reloadList();
+ updateGUI();
+-
+- linkKeyFileWatch->addFile(linkKeyFilename);
+ }
+
+
+--- kdebluetooth/kbluetoothd/kcm_btpaired/pairedtab.h
++++ kdebluetooth/kbluetoothd/kcm_btpaired/pairedtab.h
+@@ -43,7 +43,7 @@
+ KBluetooth::DeviceAddress remoteAddr;
+ QString remoteName;
+ int remoteClass;
+- uint8_t linkKey[16];
++ QString linkKey;
+ uint8_t type;
+ QDateTime time;
+ QListViewItem *listViewItem;
+@@ -52,12 +52,14 @@
+ bool linkKeyFileValid;
+ bool bDirty;
+
+- QString linkKeyFilename;
++ QValueList <QString> linkKeyFilename;
++ QString linkKeyPath;
+ QString hcidStartCommand;
+ QString hcidStopCommand;
+ KDirWatch *linkKeyFileWatch;
+ FileSettingsBase *fileSettingsDialog;
+
++ void watchKeys();
+ void reloadList();
+ bool saveList();
+ bool startDaemon();
diff --git a/net-wireless/kdebluetooth/files/kcm-no-dcop-error.diff b/net-wireless/kdebluetooth/files/kcm-no-dcop-error.diff
new file mode 100644
index 000000000000..57ba8b93d821
--- /dev/null
+++ b/net-wireless/kdebluetooth/files/kcm-no-dcop-error.diff
@@ -0,0 +1,26 @@
+Index: kbluetoothd/kcm/servicetab.cpp
+================================================================================
+--- kdebluetooth/kbluetoothd/kcm/servicetab.cpp
++++ kdebluetooth/kbluetoothd/kcm/servicetab.cpp
+@@ -389,7 +389,7 @@
+ {
+ DCOPCall dcop(client, "kbluetoothd", "MetaServer");
+ if (dcop.call("services()")!="QStringList") {
+- disableInterface(i18n("DCOP error when calling services()"));
++ disableInterface(i18n("No Bluetooth device found, disabling interface."));
+ return QStringList();
+ }
+ else {
+--- kdebluetooth/kbluetoothd/libkbluetoothd/checkdaemon.cpp
++++ kdebluetooth/kbluetoothd/libkbluetoothd/checkdaemon.cpp
+@@ -36,8 +36,8 @@
+ KMessageBox::information(mainWidget,
+ i18n("<p>The KDE Bluetooth Daemon (<i>kbluetoothd</i>) is \
+ needed and was started.</p>"),
+- i18n("KDE Bluetooth Framework"),
+- "kbluetoothd_autostart_msgbox");
++ i18n("KDE Bluetooth Framework")/*,
++ "kbluetoothd_autostart_msgbox"*/);
+ }
+ return true;
+ }
diff --git a/net-wireless/kdebluetooth/files/kdebluetooth-dbuspasskeyagent.diff b/net-wireless/kdebluetooth/files/kdebluetooth-dbuspasskeyagent.diff
new file mode 100644
index 000000000000..08e84d9ba831
--- /dev/null
+++ b/net-wireless/kdebluetooth/files/kdebluetooth-dbuspasskeyagent.diff
@@ -0,0 +1,552 @@
+--- kdebluetooth/kdebluetooth/kbluetoothd/kbluetoothd/Makefile.am
++++ kdebluetooth/kdebluetooth/kbluetoothd/kbluetoothd/Makefile.am
+@@ -4,10 +4,10 @@
+ # Code
+ bin_PROGRAMS = kbluetoothd
+
+-kbluetoothd_SOURCES = rfcommportlistener.cpp sdprecord.cpp confirmationdlgbase.ui confirmation.cpp devicenamecache.cpp devicenamecache.skel metaserver.skel hcidevmonitor.cpp trayicon.cpp main.cpp application.cpp conmainwidget.ui condetailswidget.ui metaserver.cpp connectiondlg.cpp devicescanner.skel devicescanner.cpp pinserver.cpp pinserver.skel pingendialog.ui pindefdialog.ui pindialog.cpp procinheritsock.cpp mostrecentlyused.skel mostrecentlyused.cpp hcilistener.cpp neighbourmonitor.cpp portlistener.cpp
++kbluetoothd_SOURCES = rfcommportlistener.cpp sdprecord.cpp confirmationdlgbase.ui confirmation.cpp devicenamecache.cpp devicenamecache.skel metaserver.skel hcidevmonitor.cpp trayicon.cpp main.cpp application.cpp conmainwidget.ui condetailswidget.ui metaserver.cpp connectiondlg.cpp devicescanner.skel devicescanner.cpp pinserver.cpp pinserver.skel pingendialog.ui pindefdialog.ui pindialog.cpp procinheritsock.cpp mostrecentlyused.skel mostrecentlyused.cpp hcilistener.cpp neighbourmonitor.cpp portlistener.cpp dbuspasskeyagent.cpp
+
+ kbluetoothd_LDFLAGS = $(KDE_RPATH) $(all_libraries)
+-kbluetoothd_LDADD = ../../libkbluetooth/libkbluetooth.la ../libkbluetoothd/libkbluetoothd.la $(LIB_KIO) $(LIB_KDEUI)
++kbluetoothd_LDADD = ../../libkbluetooth/libkbluetooth.la ../libkbluetoothd/libkbluetoothd.la $(LIB_KIO) $(LIB_KDEUI) $(DBUS_LIBS) -ldbus-qt-1
+
+ # Services
+ kde_servicetypes_DATA = kbluetoothdmodule.desktop
+@@ -31,6 +31,6 @@
+ $(INSTALL_DATA) $(srcdir)/eventsrc $(DESTDIR)$(kde_datadir)/kbluetoothd/eventsrc
+
+ # set the include path for X, qt and KDE
+-INCLUDES = -I$(top_srcdir)/kdebluetooth $(all_includes) $(BLUETOOTH_CFLAGS)
++INCLUDES = -I$(top_srcdir)/kdebluetooth $(all_includes) $(BLUETOOTH_CFLAGS) $(DBUS_CFLAGS)
+
+-noinst_HEADERS = procinheritsock.h mostrecentlyused.h hcilistener.h neighbourmonitor.h
++noinst_HEADERS = procinheritsock.h mostrecentlyused.h hcilistener.h neighbourmonitor.h dbuspasskeyagent.h
+--- ./kdebluetooth/kbluetoothd/kbluetoothd/application.cpp.orig 2006-10-16 14:23:56.000000000 +0400
++++ ./kdebluetooth/kbluetoothd/kbluetoothd/application.cpp 2007-03-30 23:34:21.792836593 +0400
+@@ -26,6 +26,8 @@
+ #include <libkbluetooth/configinfo.h>
+ #include <bluetooth/hci.h>
+
++#include "dbuspasskeyagent.h"
++
+ using namespace KBluetooth;
+ using namespace std;
+
+@@ -57,6 +59,8 @@
+ hciListener->start();
+ bFirstNewInstance = true;
+ trayIcon->slotMruMenuUpdate();
++
++ agent = new DBusPasskeyAgent(this);
+
+ // Warn the user if the location of kbluepin has changed
+ // Don't show if bluez-libs is 3.x
+@@ -74,6 +78,7 @@
+ mru->writeConfig();
+ delete m_config;
+ delete trayIcon;
++ delete agent;
+ }
+
+ int KBluetoothdApp::newInstance()
+
+--- kdebluetooth/kdebluetooth/kbluetoothd/kbluetoothd/application.h
++++ kdebluetooth/kdebluetooth/kbluetoothd/kbluetoothd/application.h
+@@ -29,6 +29,7 @@
+ class MostRecentlyUsed;
+ class HciListener;
+ class HciDevMonitor;
++class DBusPasskeyAgent;
+
+ class KBluetoothdApp: public KUniqueApplication
+ {
+@@ -52,6 +53,7 @@
+ void slotHciDeviceLost();
+ void configUpdate();
+ private:
++ DBusPasskeyAgent *agent;
+ void startServices();
+ void endServices();
+ KConfig* m_config;
+--- kdebluetooth/kdebluetooth/kbluetoothd/kbluetoothd/configure.in.in
++++ kdebluetooth/kdebluetooth/kbluetoothd/kbluetoothd/configure.in.in
+@@ -7,3 +7,18 @@
+ KDE_EXPAND_MAKEVAR(KBLUETOOTHDJOBTEMPLATEDIR, KBLUETOOTHDJOBTEMPLATEDIR)
+ AC_SUBST(KBLUETOOTHDJOBTEMPLATEDIR)
+ AC_DEFINE_UNQUOTED(KBLUETOOTHDJOBTEMPLATEDIR, "$KBLUETOOTHDJOBTEMPLATEDIR", [job templates for kbluetoothd])
++
++# DBUS
++PKG_CHECK_MODULES(DBUS, "dbus-1")
++
++AC_SUBST(DBUS_CFLAGS)
++AC_SUBST(DBUS_LIBS)
++
++# DBUS QT BINDING ### stolen from kpowersave and knetworkmanager ;) #
++CPPFLAGS="$CPPFLAGS $DBUS_CFLAGS $all_includes -DDBUS_API_SUBJECT_TO_CHANGE"
++AC_LANG_SAVE
++AC_LANG_CPLUSPLUS
++AC_CHECK_HEADER([dbus/connection.h],,[AC_MSG_ERROR([You need D-BUS/Qt3 bindings])])
++AC_CHECK_HEADER([dbus/message.h],,[AC_MSG_ERROR([You need D-BUS/Qt3 bindings])])
++#CPPFLAGS=$safe_CPPFLAGS
++AC_LANG_RESTORE
+--- kdebluetooth/kdebluetooth/kbluetoothd/kbluetoothd/dbuspasskeyagent.cpp
++++ kdebluetooth/kdebluetooth/kbluetoothd/kbluetoothd/dbuspasskeyagent.cpp
+@@ -0,0 +1,296 @@
++/*
++ *
++ * BlueZ Passkey Agent Interface for kbluetoothd
++ *
++ * Copyright (C) 2006 Daniel Gollub <dgollub@suse.de>
++ *
++ *
++ * This file is part of kbluetoothd.
++ *
++ * kbluetooth is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * libkbluetooth is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with libkbluetooth; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
++ *
++ */
++
++#include <kdebug.h>
++#include <unistd.h>
++#include "dbuspasskeyagent.h"
++
++#define KBLUETOOTH_DBUS_PATH "/org/bluez/kbluetoothd_"
++
++DBusMessage* DBusPasskeyAgent::_msg = NULL;
++KBluetoothdApp *DBusPasskeyAgent::_app = NULL;
++PinDialog* DBusPasskeyAgent::_pinDialog = NULL;
++DBusPasskeyAgent *DBusPasskeyAgent::_ctx = NULL;
++
++DBusPasskeyAgent::DBusPasskeyAgent(KBluetoothdApp *app) : QObject()
++{
++ this->_app = app;
++ this->_ctx = this;
++ this->agentpath = QString(KBLUETOOTH_DBUS_PATH "%1").arg(getpid());
++ dbusInit();
++ addHandler();
++ registerDefaultPasskeyAgent();
++}
++
++DBusPasskeyAgent::~DBusPasskeyAgent()
++{
++ kdDebug() << __func__ << endl;
++ unregisterDefaultPasskeyAgent();
++}
++
++bool DBusPasskeyAgent::dbusInit()
++{
++ kdDebug() << "<<<<< " << __func__ << endl;
++
++ kdDebug() << __func__ << "()" << endl;
++
++ DBusError error;
++ dbus_error_init(&error);
++ conn = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
++
++ if (!conn) {
++ kdDebug() << "dbus_bus_get() failed...." << endl;
++ if (dbus_error_is_set(&error)) {
++ kdDebug() << error.message << endl;
++ dbus_error_free(&error);
++ return false;
++ }
++ }
++
++ _dbusConnection = new DBusQt::Connection(this);
++ if (!_dbusConnection) {
++ kdDebug() << __func__ << " DBusQt::Connection() failed." << endl;
++ return false;
++ }
++
++ _dbusConnection->dbus_connection_setup_with_qt_main(conn);
++
++ return true;
++}
++
++bool DBusPasskeyAgent::registerDefaultPasskeyAgent()
++{
++ kdDebug() << "<<<<< " << __func__ << endl;
++
++ kdDebug() << __func__ << "()" << endl;
++
++ DBusMessage *reply = NULL;
++ DBusError error;
++
++ dbus_error_init(&error);
++
++ DBusMessage *msg = NULL;
++ msg = dbus_message_new_method_call(INTERFACE_BLUEZ, BLUEZ_PATH, INTERFACE_SECURITY, "RegisterDefaultPasskeyAgent");
++ if (!msg) {
++ kdDebug() << "kbluetoothd (Default Passkey Agent): Can't allocate new method call" << endl;
++ return false;
++ }
++
++ const char *path = agentpath.latin1();
++ dbus_message_append_args(msg, DBUS_TYPE_STRING, &path, DBUS_TYPE_INVALID);
++ reply = dbus_connection_send_with_reply_and_block(conn, msg, -1, &error);
++ if (!reply) {
++ if (dbus_error_is_set(&error)) {
++ kdDebug() << "kbluetoothd (Default Passkey Agent): " << __func__ << "(): " << error.message << endl;
++ dbus_error_free(&error);
++ return false;
++ }
++ }
++
++ return true;
++}
++
++bool DBusPasskeyAgent::unregisterDefaultPasskeyAgent()
++{
++ kdDebug() << "<<<<< " << __func__ << endl;
++
++ DBusMessage *reply = NULL;
++ DBusError error;
++
++ dbus_error_init(&error);
++
++ DBusMessage *msg = NULL;
++ msg = dbus_message_new_method_call(INTERFACE_BLUEZ, BLUEZ_PATH, INTERFACE_SECURITY, "UnregisterDefaultPasskeyAgent");
++ if (!msg) {
++ kdDebug() << "kbluetoothd (Unregister Default Passkey Agent): Can't allocate new method call" << endl;
++ return false;
++ }
++
++ const char *path = agentpath.latin1();
++ dbus_message_append_args(msg, DBUS_TYPE_STRING, &path, DBUS_TYPE_INVALID);
++ reply = dbus_connection_send_with_reply_and_block(conn, msg, -1, &error);
++ if (!reply) {
++ if (dbus_error_is_set(&error)) {
++ kdDebug() << "kbluetoothd (Default Passkey Agent): " << __func__ << "(): " << error.message << endl;
++ dbus_error_free(&error);
++ return false;
++ }
++ }
++
++ return true;
++}
++
++bool DBusPasskeyAgent::addHandler()
++{
++ kdDebug() << "<<<<< " << __func__ << endl;
++
++ DBusError error;
++ DBusHandleMessageFunction filter = filterFunction;
++
++ dbus_error_init(&error);
++
++ if (!dbus_connection_add_filter(conn, filter, NULL, NULL)) {
++ return false;
++ }
++
++ // TODO ... error handler
++ dbus_bus_add_match(conn, "interface=" DBUS_INTERFACE_DBUS ","
++ "member=NameOwnerChanged, arg0=" INTERFACE_BLUEZ, &error);
++ dbus_bus_add_match(conn, "type='signal',interface='" INTERFACE_SECURITY "',"
++ "path='" BLUEZ_PATH "',sender='" INTERFACE_BLUEZ "'", &error);
++ dbus_bus_add_match(conn, "type='signal',interface='" INTERFACE_MANAGER "',"
++ "path='" BLUEZ_PATH "',sender='" INTERFACE_BLUEZ "'", &error);
++
++
++ return true;
++}
++
++DBusHandlerResult DBusPasskeyAgent::filterFunction(DBusConnection * /*conn*/, DBusMessage *msg, void * /*data*/)
++{
++ kdDebug() << __func__ << "()....................." << endl;
++ const char *member = dbus_message_get_member(msg);
++
++ if (!member)
++ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
++
++ kdDebug() << __func__ << "(): " << member << endl;
++
++ if (!strcmp("Request", member)) {
++ return _ctx->requestMessage(msg);
++ } else if (!strcmp("NameOwnerChanged", member)) {
++ return _ctx->ownerChanged(msg);
++ } else if (!strcmp("AdapterAdded", member)) {
++ _ctx->registerDefaultPasskeyAgent();
++ return DBUS_HANDLER_RESULT_HANDLED;
++ }
++
++ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
++}
++
++QString DBusPasskeyAgent::getRemoteName(const char *path, const char *address)
++{
++
++ const char *remotename;
++ DBusError error;
++ dbus_error_init(&error);
++
++ DBusMessage *msg = NULL;
++ msg = dbus_message_new_method_call(INTERFACE_BLUEZ, path, "org.bluez.Adapter", "GetRemoteName");
++ if (!msg) {
++ kdDebug() << "kbluetoothd (Default Passkey Agent) " << __func__ << "(): Can't allocate new method call" << endl;
++ return false;
++ }
++
++ dbus_message_append_args(msg, DBUS_TYPE_STRING, &address, DBUS_TYPE_INVALID);
++ DBusMessage *reply = dbus_connection_send_with_reply_and_block(conn, msg, -1, &error);
++ if (!reply) {
++ if (dbus_error_is_set(&error)) {
++ kdDebug() << "kbluetoothd (Default Passkey Agent): " << __func__ << "(): " << error.message << endl;
++ dbus_error_free(&error);
++ return QString::null;
++ }
++ }
++
++ dbus_message_get_args(reply, NULL, DBUS_TYPE_STRING, &remotename, DBUS_TYPE_INVALID);
++ dbus_message_unref(reply);
++
++ return QString::fromUtf8(remotename);
++}
++
++DBusHandlerResult DBusPasskeyAgent::requestMessage(DBusMessage *msg) {
++
++ const char *path, *address;
++ QString remotename = QString::null;
++
++ _msg = msg;
++
++ dbus_message_ref(_msg);
++
++ if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &path,
++ DBUS_TYPE_STRING, &address, DBUS_TYPE_INVALID)) {
++ kdDebug() << "DBusPasskeyAgent: Invalid argumentes for Passkey Request method." << endl;
++ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
++ }
++
++ /* get address and remote name */
++
++ remotename = _ctx->getRemoteName(path, address);
++
++
++ if (remotename == QString::null)
++ remotename = QString("n/a");
++
++ _pinDialog = new PinDialog(NULL, true, false, QString(address), remotename, _ctx);
++ _pinDialog->show();
++
++ return DBUS_HANDLER_RESULT_HANDLED;
++}
++
++DBusHandlerResult DBusPasskeyAgent::ownerChanged(DBusMessage *msg) {
++ kdDebug() << __func__ << "()" << endl;
++
++ char *service, *old_owner, *new_owner;
++
++ if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &service,
++ DBUS_TYPE_STRING, &old_owner,
++ DBUS_TYPE_STRING, &new_owner,
++ DBUS_TYPE_INVALID)) {
++
++ if (!strcmp(service, INTERFACE_BLUEZ)) {
++ if (new_owner && (strlen(new_owner) > 0)) {
++ kdDebug() << __func__ << "(): rerun default passkey agent." << endl;
++ _ctx->registerDefaultPasskeyAgent();
++ }
++ }
++ }
++
++
++ return DBUS_HANDLER_RESULT_HANDLED;
++}
++
++void DBusPasskeyAgent::sendPin() {
++ kdDebug() << __func__ << "()" << endl;
++
++ QString qpasskey = _pinDialog->getPin();
++ const char *passkey = qpasskey.ascii();
++
++ DBusMessage *reply = dbus_message_new_method_return(_msg);
++ if (!reply) {
++ kdDebug() << __func__ <<" (): Reply failed." << endl;
++ goto error_free;
++ }
++
++ dbus_message_append_args(reply, DBUS_TYPE_STRING, &passkey, DBUS_TYPE_INVALID);
++
++ dbus_connection_send(conn, reply, NULL);
++ dbus_message_unref(reply);
++
++ kdDebug() << __func__ << "(): send." << endl;
++
++error_free:
++ dbus_message_unref(_msg);
++}
++
++#include "dbuspasskeyagent.moc"
+--- kdebluetooth/kdebluetooth/kbluetoothd/kbluetoothd/dbuspasskeyagent.h
++++ kdebluetooth/kdebluetooth/kbluetoothd/kbluetoothd/dbuspasskeyagent.h
+@@ -0,0 +1,91 @@
++/*
++ *
++ * BlueZ Passkey Agent Interface for kbluetoothd
++ *
++ * Copyright (C) 2006 Daniel Gollub <dgollub@suse.de>
++ *
++ *
++ * This file is part of kbluetoothd.
++ *
++ * kbluetooth is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * libkbluetooth is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with libkbluetooth; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
++ *
++ */
++
++
++#ifndef DBUSPASSKEYAGENT_H
++#define DBUSPASSKEYAGENT_H
++
++#ifndef DBUS_API_SUBJECT_TO_CHANGE
++#define DBUS_API_SUBJECT_TO_CHANGE
++#endif
++
++#include <qobject.h>
++
++#include <dbus/dbus.h>
++#include <dbus/connection.h>
++
++#include "application.h"
++#include "pindialog.h"
++
++#define BLUEZ_PATH "/org/bluez"
++#define INTERFACE_BLUEZ "org.bluez"
++#define INTERFACE_MANAGER "org.bluez.Manager"
++#define INTERFACE_SECURITY "org.bluez.Security"
++#define INTERFACE_PASSKEYAGENT "org.bluez.PasskeyAgent"
++
++class PinDialog;
++
++class DBusPasskeyAgent : public QObject
++{
++
++ Q_OBJECT
++
++ public:
++ DBusPasskeyAgent(KBluetoothdApp *app);
++ ~DBusPasskeyAgent();
++
++ public slots:
++ void sendPin();
++
++ private:
++
++ bool dbusInit();
++
++ bool registerDefaultPasskeyAgent();
++ bool unregisterDefaultPasskeyAgent();
++
++ bool addHandler();
++
++ QString getRemoteName(const char *path, const char *address);
++
++ static DBusHandlerResult filterFunction(DBusConnection *conn, DBusMessage *msg, void *data);
++ static DBusHandlerResult requestMessage(DBusMessage *msg);
++ static DBusHandlerResult ownerChanged(DBusMessage *msg);
++
++
++
++ static KBluetoothdApp *_app;
++ static DBusPasskeyAgent *_ctx;
++ static DBusMessage *_msg;
++ static PinDialog *_pinDialog;
++
++
++ QString agentpath;
++ DBusConnection *conn;
++ DBusQt::Connection *_dbusConnection;
++
++};
++
++#endif // DBUSPASSKEYAGENT_H
+--- kdebluetooth/kdebluetooth/kbluetoothd/kbluetoothd/pindialog.cpp
++++ kdebluetooth/kdebluetooth/kbluetoothd/kbluetoothd/pindialog.cpp
+@@ -30,7 +30,7 @@
+ #include <klocale.h>
+
+ PinDialog::PinDialog(QWidget* owner, bool /*bIncoming*/,
+- bool ownAuth, QString addr, QString devName) :
++ bool ownAuth, QString addr, QString devName, DBusPasskeyAgent *agent) :
+ KDialogBase(owner, "pinrequest", ownAuth, "Pin Request",
+ ownAuth?(Close):(Ok|Cancel))
+ {
+@@ -63,6 +63,8 @@
+ pinDlg->pinEdit->setFocus();
+ }
+
++ connect(this, SIGNAL (okClicked()), agent, SLOT (sendPin()));
++
+ if (ownAuth) {
+ setMainWidget(pinGenDlg);
+ pinGenDlg->goButton->setFocus();
+@@ -76,9 +78,14 @@
+ {
+ }
+
++QString PinDialog::getPin()
++{
++ return pinDlg->pinEdit->text();
++}
++
+ QString PinDialog::getPin(bool bIn, bool ownAuth, QString addr, QString name)
+ {
+- QGuardedPtr<PinDialog> dlg = new PinDialog(NULL, bIn, ownAuth, addr, name);
++ QGuardedPtr<PinDialog> dlg = new PinDialog(NULL, bIn, ownAuth, addr, name, NULL);
+ if (ownAuth == true) {
+ if (!dlg->pinGenDlg) return QString::null;
+ dlg->show();
+--- kdebluetooth/kdebluetooth/kbluetoothd/kbluetoothd/pindialog.h
++++ kdebluetooth/kdebluetooth/kbluetoothd/kbluetoothd/pindialog.h
+@@ -15,8 +15,11 @@
+ #include <kdialogbase.h>
+ #include <qguardedptr.h>
+
++#include "dbuspasskeyagent.h"
++#include "pindefdialog.h"
++
+ class PinGenerateDialog;
+-class PinDefaultDialog;
++//class PinDefaultDialog;
+ class QWidget;
+ namespace KBluetooth {
+ class HciSocket;
+@@ -29,11 +32,13 @@
+ {
+ Q_OBJECT
+ public:
+- PinDialog(QWidget* owner, bool bIn, bool ownAuth, QString addr, QString name);
++ PinDialog(QWidget* owner, bool bIn, bool ownAuth, QString addr, QString name, DBusPasskeyAgent *agent);
+ ~PinDialog();
++ QString getPin();
+ static QString getPin(bool bIn, bool ownAuth, QString addr, QString name);
++ PinDefaultDialog *pinDlg;
+ protected:
+- QGuardedPtr<PinDefaultDialog> pinDlg;
++// QGuardedPtr<PinDefaultDialog> pinDlg;
+ QGuardedPtr<PinGenerateDialog> pinGenDlg;
+ QString addr;
+ KBluetooth::HciSocket *hciSocket;
diff --git a/net-wireless/kdebluetooth/files/kdebluetooth-sdp-bitop.diff b/net-wireless/kdebluetooth/files/kdebluetooth-sdp-bitop.diff
new file mode 100644
index 000000000000..9ec9783d18e6
--- /dev/null
+++ b/net-wireless/kdebluetooth/files/kdebluetooth-sdp-bitop.diff
@@ -0,0 +1,42 @@
+--- kdebluetooth/libkbluetooth/sdpattribute.cpp
++++ kdebluetooth/libkbluetooth/sdpattribute.cpp
+@@ -121,23 +121,23 @@
+ }
+ }
+ else {
+- ret.value.uuid128.data[0] = (lo >> 0) && 0xFF;
+- ret.value.uuid128.data[1] = (lo >> 8) && 0xFF;
+- ret.value.uuid128.data[2] = (lo >> 16) && 0xFF;
+- ret.value.uuid128.data[3] = (lo >> 24) && 0xFF;
+- ret.value.uuid128.data[4] = (lo >> 32) && 0xFF;
+- ret.value.uuid128.data[5] = (lo >> 40) && 0xFF;
+- ret.value.uuid128.data[6] = (lo >> 48) && 0xFF;
+- ret.value.uuid128.data[7] = (lo >> 56) && 0xFF;
++ ret.value.uuid128.data[0] = (lo >> 0) & 0xFF;
++ ret.value.uuid128.data[1] = (lo >> 8) & 0xFF;
++ ret.value.uuid128.data[2] = (lo >> 16) & 0xFF;
++ ret.value.uuid128.data[3] = (lo >> 24) & 0xFF;
++ ret.value.uuid128.data[4] = (lo >> 32) & 0xFF;
++ ret.value.uuid128.data[5] = (lo >> 40) & 0xFF;
++ ret.value.uuid128.data[6] = (lo >> 48) & 0xFF;
++ ret.value.uuid128.data[7] = (lo >> 56) & 0xFF;
+
+- ret.value.uuid128.data[8] = (hi >> 0) && 0xFF;
+- ret.value.uuid128.data[9] = (hi >> 8) && 0xFF;
+- ret.value.uuid128.data[10] = (hi >> 16) && 0xFF;
+- ret.value.uuid128.data[11] = (hi >> 24) && 0xFF;
+- ret.value.uuid128.data[12] = (hi >> 32) && 0xFF;
+- ret.value.uuid128.data[13] = (hi >> 40) && 0xFF;
+- ret.value.uuid128.data[14] = (hi >> 48) && 0xFF;
+- ret.value.uuid128.data[15] = (hi >> 56) && 0xFF;
++ ret.value.uuid128.data[8] = (hi >> 0) & 0xFF;
++ ret.value.uuid128.data[9] = (hi >> 8) & 0xFF;
++ ret.value.uuid128.data[10] = (hi >> 16) & 0xFF;
++ ret.value.uuid128.data[11] = (hi >> 24) & 0xFF;
++ ret.value.uuid128.data[12] = (hi >> 32) & 0xFF;
++ ret.value.uuid128.data[13] = (hi >> 40) & 0xFF;
++ ret.value.uuid128.data[14] = (hi >> 48) & 0xFF;
++ ret.value.uuid128.data[15] = (hi >> 56) & 0xFF;
+
+ ret.type = SDP_UUID128;
+ }
diff --git a/net-wireless/kdebluetooth/files/kdebluetooth.diff b/net-wireless/kdebluetooth/files/kdebluetooth.diff
new file mode 100644
index 000000000000..7fe8aeb57e2f
--- /dev/null
+++ b/net-wireless/kdebluetooth/files/kdebluetooth.diff
@@ -0,0 +1,19 @@
+--- kdebluetooth/kbluetoothd/kbluetoothd/kbluetoothd.autostart.desktop
++++ kdebluetooth/kbluetoothd/kbluetoothd/kbluetoothd.autostart.desktop
+@@ -40,4 +40,4 @@
+ X-DCOP-ServiceType=Unique
+ #X-KDE-Library=klipper_panelapplet
+ #X-KDE-UniqueApplet=true
+-X-KDE-autostart-condition=kbluetoothdrc:General:AutoStart:true
++X-KDE-autostart-condition=kbluetoothdrc:General:AutoStart:false
+--- kdebluetooth/libkbluetooth/hcisocket.cpp
++++ kdebluetooth/libkbluetooth/hcisocket.cpp
+@@ -56,7 +56,7 @@
+ s = ::socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI);
+ if (s < 0)
+ {
+- kdWarning() << "HciSocket::open(): Error creating socket" << endl;
++ kdDebug() << "HciSocket::open(): Error creating socket" << endl;
+ emit error(errno, i18n("Error creating socket"));
+ return false;
+ }
diff --git a/net-wireless/kdebluetooth/kdebluetooth-1.0_beta2-r2.ebuild b/net-wireless/kdebluetooth/kdebluetooth-1.0_beta2-r2.ebuild
new file mode 100644
index 000000000000..397e47e96ca8
--- /dev/null
+++ b/net-wireless/kdebluetooth/kdebluetooth-1.0_beta2-r2.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-wireless/kdebluetooth/kdebluetooth-1.0_beta2-r2.ebuild,v 1.1 2007/04/08 11:02:24 genstef Exp $
+
+inherit kde autotools
+
+MY_PV=${PV}
+MY_P=${PN}-${MY_PV}
+S=${WORKDIR}/${MY_P}
+
+DESCRIPTION="KDE Bluetooth Framework"
+HOMEPAGE="http://bluetooth.kmobiletools.org/"
+SRC_URI="mirror://sourceforge/kde-bluetooth/${MY_P}.tar.bz2"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~hppa ~ppc sparc ~x86"
+IUSE="irmc"
+
+DEPEND=">=dev-libs/openobex-1.1
+ >=net-wireless/bluez-libs-2.15
+ >=media-libs/libvorbis-1.0
+ >=dev-libs/dbus-qt3-old-0.70
+ irmc? ( || ( >=kde-base/kitchensync-3.4_beta1 >=kde-base/kdepim-3.4_beta1 ) )"
+
+RDEPEND="${DEPEND}
+ || ( ( kde-base/kdialog kde-base/konqueror ) kde-base/kdebase )
+ net-wireless/bluez-utils"
+
+PATCHES="${FILESDIR}/better-menu-names.diff
+ ${FILESDIR}/kcm-btpaired-fix.diff
+ ${FILESDIR}/kcm-no-dcop-error.diff
+ ${FILESDIR}/kdebluetooth-dbuspasskeyagent.diff
+ ${FILESDIR}/kdebluetooth-sdp-bitop.diff
+ ${FILESDIR}/kdebluetooth.diff"
+
+
+LANGS="bg br ca cs cy da de el en_GB es et fi fr ga gl hu is it ja ka lt
+mt nb nl nn pa pl pt pt_BR ro ru rw sk sr sr@Latn sv ta tr uk zh_CN"
+
+for X in ${LANGS} ; do
+ IUSE="${IUSE} linguas_${X}"
+done
+
+need-kde 3
+
+src_unpack() {
+ kde_src_unpack
+ cd "${WORKDIR}/${P}/po"
+ for X in ${LANGS} ; do
+ use linguas_${X} || rm -rf "${X}"
+ done
+ rm -f "${S}/configure"
+ #eaclocal && eautoconf || die "autotools failed"
+}
+
+src_compile() {
+ # Change defaults to match our bluez-utils setup
+ sed -i -e 's,/etc/init\.d/bluez-utils,/etc/init\.d/bluetooth,' \
+ "${S}/kdebluetooth/kbluetoothd/kcm_btpaired/pairedtab.cpp" || die
+ local myconf="--without-xmms $(use_enable irmc irmcsynckonnector)"
+ kde_src_compile
+}
+
+pkg_postinst() {
+ einfo 'This version of kde-bluetooth provides a replacement for the'
+ einfo 'standard bluepin program "kbluepin". If you want to use this version,'
+ einfo 'you have to edit "/etc/bluetooth/hcid.conf" and change the line'
+ einfo '"pin_helper oldbluepin;" to "pin_helper /usr/lib/kdebluetooth/kbluepin;".'
+ einfo 'Then restart hcid to make the change take effect.'
+}