Re-indent.
This commit is contained in:
parent
9c1d1fdcda
commit
c9d4c7138b
1 changed files with 16 additions and 12 deletions
|
@ -45,17 +45,21 @@ module Qasim
|
|||
def dbus_notify title, body, icon
|
||||
bus = Qt::DBusConnection.sessionBus
|
||||
if !bus.connected?
|
||||
$stderr.puts("Cannot connect to the D-BUS session bus.\n" \
|
||||
"To start it, run:\n" \
|
||||
"\teval `dbus-launch --auto-syntax`\n")
|
||||
$stderr.puts(
|
||||
"Cannot connect to the D-BUS session bus.\n" \
|
||||
"To start it, run:\n" \
|
||||
"\teval `dbus-launch --auto-syntax`\n"
|
||||
)
|
||||
exit 1
|
||||
end
|
||||
msg = Qt::DBusMessage.create_method_call( 'org.freedesktop.Notifications',
|
||||
'/org/freedesktop/Notifications',
|
||||
'org.freedesktop.Notifications',
|
||||
'Notify' )
|
||||
msg = Qt::DBusMessage.create_method_call(
|
||||
'org.freedesktop.Notifications',
|
||||
'/org/freedesktop/Notifications',
|
||||
'org.freedesktop.Notifications',
|
||||
'Notify'
|
||||
)
|
||||
msg.arguments = [ APP_NAME, Qt::Variant.from_value( 0, "unsigned int" ),
|
||||
icon, title, body, [], {}, -1 ]
|
||||
icon, title, body, [], {}, -1 ]
|
||||
rep = bus.call( msg )
|
||||
# if rep.type == Qt::DBusMessage
|
||||
|
||||
|
@ -103,8 +107,8 @@ module Qasim
|
|||
@connect_error[map.path] = Set.new
|
||||
@connect_running[map.path] = 0
|
||||
method = if map.connected? then :disconnect
|
||||
else :connect
|
||||
end
|
||||
else :connect
|
||||
end
|
||||
|
||||
begin
|
||||
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
|
||||
lockfname = File.join APP_CONFIG_DIR, "lock"
|
||||
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.syswrite( "#{Process.pid}\n" )
|
||||
f.close
|
||||
|
@ -247,7 +251,7 @@ module Qasim
|
|||
end
|
||||
end
|
||||
fd = IO::sysopen( lockfname,
|
||||
Fcntl::O_WRONLY | Fcntl::O_EXCL )
|
||||
Fcntl::O_WRONLY | Fcntl::O_EXCL )
|
||||
f = IO.open(fd)
|
||||
f.syswrite( "#{Process.pid}\n" )
|
||||
f.close
|
||||
|
|
Loading…
Reference in a new issue