Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class XmmsConnectToQt4 < Qt::Object
- def initialize(connection)
- unless @running
- @client = connection
- @fd = @client.io_fd
- @reader = Qt::SocketNotifier.new(@fd, Qt::SocketNotifier::Read)
- @writer = Qt::SocketNotifier.new(@fd, Qt::SocketNotifier::Write)
- @client.io_on_need_out do |flag| # Why flag is not boolean again?
- @writer.enabled = (flag != 0)
- end
- @reader.connect(SIGNAL 'activated(int)') { @client.io_in_handle }
- @writer.connect(SIGNAL 'activated(int)') do
- if @client.io_want_out
- @client.io_out_handle
- end
- end
- @reader.enabled = true
- @writer.enabled = true
- end
- @running ||= true
- self
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement