Re-indent.

This commit is contained in:
Glenn Y. Rolland 2015-08-10 17:00:41 +02:00
parent 9c1d1fdcda
commit c9d4c7138b

View file

@ -45,17 +45,21 @@ module Qasim
def dbus_notify title, body, icon def dbus_notify title, body, icon
bus = Qt::DBusConnection.sessionBus bus = Qt::DBusConnection.sessionBus
if !bus.connected? if !bus.connected?
$stderr.puts("Cannot connect to the D-BUS session bus.\n" \ $stderr.puts(
"To start it, run:\n" \ "Cannot connect to the D-BUS session bus.\n" \
"\teval `dbus-launch --auto-syntax`\n") "To start it, run:\n" \
"\teval `dbus-launch --auto-syntax`\n"
)
exit 1 exit 1
end end
msg = Qt::DBusMessage.create_method_call( 'org.freedesktop.Notifications', msg = Qt::DBusMessage.create_method_call(
'/org/freedesktop/Notifications', 'org.freedesktop.Notifications',
'org.freedesktop.Notifications', '/org/freedesktop/Notifications',
'Notify' ) 'org.freedesktop.Notifications',
'Notify'
)
msg.arguments = [ APP_NAME, Qt::Variant.from_value( 0, "unsigned int" ), msg.arguments = [ APP_NAME, Qt::Variant.from_value( 0, "unsigned int" ),
icon, title, body, [], {}, -1 ] icon, title, body, [], {}, -1 ]
rep = bus.call( msg ) rep = bus.call( msg )
# if rep.type == Qt::DBusMessage # if rep.type == Qt::DBusMessage
@ -103,8 +107,8 @@ module Qasim
@connect_error[map.path] = Set.new @connect_error[map.path] = Set.new
@connect_running[map.path] = 0 @connect_running[map.path] = 0
method = if map.connected? then :disconnect method = if map.connected? then :disconnect
else :connect else :connect
end end
begin begin
map.send(method) do |linkname,cmd,cmd_args| map.send(method) do |linkname,cmd,cmd_args|
@ -231,7 +235,7 @@ module Qasim
FileUtils.mkdir_p APP_CONFIG_DIR unless File.exist? APP_CONFIG_DIR FileUtils.mkdir_p APP_CONFIG_DIR unless File.exist? APP_CONFIG_DIR
lockfname = File.join APP_CONFIG_DIR, "lock" lockfname = File.join APP_CONFIG_DIR, "lock"
fd = IO::sysopen( lockfname, fd = IO::sysopen( lockfname,
Fcntl::O_WRONLY | Fcntl::O_EXCL | Fcntl::O_CREAT) Fcntl::O_WRONLY | Fcntl::O_EXCL | Fcntl::O_CREAT)
f = IO.open(fd) f = IO.open(fd)
f.syswrite( "#{Process.pid}\n" ) f.syswrite( "#{Process.pid}\n" )
f.close f.close
@ -247,7 +251,7 @@ module Qasim
end end
end end
fd = IO::sysopen( lockfname, fd = IO::sysopen( lockfname,
Fcntl::O_WRONLY | Fcntl::O_EXCL ) Fcntl::O_WRONLY | Fcntl::O_EXCL )
f = IO.open(fd) f = IO.open(fd)
f.syswrite( "#{Process.pid}\n" ) f.syswrite( "#{Process.pid}\n" )
f.close f.close