Skip to content

Commit

Permalink
blueman-sendto: Do not try to send a file during discovery
Browse files Browse the repository at this point in the history
It looks like there are controllers that cause a fail in that situation, so we need to wait until the discovery is done.

Fixes #463
  • Loading branch information
cschramm committed Feb 29, 2016
1 parent 27bad4d commit f7c0f6a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 2-0-stable (unreleased)

### Changes

* Do not try to send a file during a discovery

## 2.0.3

Fix privilege escalation
Expand Down
10 changes: 10 additions & 0 deletions apps/blueman-sendto
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ from blueman.Constants import *
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
from gi.repository import GLib

from blueman.bluez.Adapter import Adapter
from blueman.bluez.obex.ObjectPush import ObjectPush
Expand Down Expand Up @@ -130,6 +131,15 @@ class Sender(GObject.GObject):
self.window.show()

def create_session(self):
def check():
if self.adapter.get_properties()['Discovering']:
return True
else:
self._do_create_session()
return False
GLib.timeout_add(1000, check)

def _do_create_session(self):
dprint("Creating session")
props = self.adapter.get_properties()
self.client.create_session(self.device.Address, props["Address"])
Expand Down

0 comments on commit f7c0f6a

Please sign in to comment.