Browse Source

mconnect/utils: put helper code inside Utils namespace

bboozzoo/dbus-support-fileshare
Maciek Borzecki 8 years ago
parent
commit
bb02424799
5 changed files with 19 additions and 12 deletions
  1. +8
    -6
      src/mconnect/device.vala
  2. +1
    -1
      src/mconnect/devicechannel.vala
  3. +4
    -4
      src/mconnect/discovereddevice.vala
  4. +1
    -1
      src/mconnect/transfer-download.vala
  5. +5
    -0
      src/mconnect/utils.vala

+ 8
- 6
src/mconnect/device.vala View File

@ -178,15 +178,17 @@ class Device : Object {
* Generates a unique string for this device
*/
public string to_unique_string() {
return make_unique_device_string(this.device_id,
this.device_name,
this.device_type,
this.protocol_version);
return Utils.make_unique_device_string(this.device_id,
this.device_name,
this.device_type,
this.protocol_version);
}
public string to_string() {
return make_device_string(this.device_id, this.device_name,
this.device_type, this.protocol_version);
return Utils.make_device_string(this.device_id,
this.device_name,
this.device_type,
this.protocol_version);
}
/**


+ 1
- 1
src/mconnect/devicechannel.vala View File

@ -49,7 +49,7 @@ class DeviceChannel : Object {
}
private static void fixup_socket(Socket sock) {
socket_set_keepalive(sock);
Utils.socket_set_keepalive(sock);
}
private void replace_streams(InputStream input, OutputStream output) {


+ 4
- 4
src/mconnect/discovereddevice.vala View File

@ -73,10 +73,10 @@ class DiscoveredDevice : Object {
}
public string to_unique_string() {
return make_unique_device_string(this.device_id,
this.device_name,
this.device_type,
this.protocol_version);
return Utils.make_unique_device_string(this.device_id,
this.device_name,
this.device_type,
this.protocol_version);
}
}

+ 1
- 1
src/mconnect/transfer-download.vala View File

@ -57,7 +57,7 @@ class DownloadTransfer : Object {
this.conn = sc.connect_async.end(res);
var sock = this.conn.get_socket();
socket_set_keepalive(sock);
Utils.socket_set_keepalive(sock);
this.start_transfer();
} catch (Error e) {


+ 5
- 0
src/mconnect/utils.vala View File

@ -17,6 +17,9 @@
* AUTHORS
* Maciek Borzecki <maciek.borzecki (at] gmail.com>
*/
namespace Utils {
using Posix;
/**
@ -87,3 +90,5 @@ void socket_set_keepalive(Socket sock) {
// enable keepalive
sock.set_keepalive(true);
}
}

Loading…
Cancel
Save