Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

Commit

Permalink
Fix code errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Bajoja committed May 14, 2017
1 parent f3d0be9 commit b993f65
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/DeviceIndicator.vala
Original file line number Diff line number Diff line change
Expand Up @@ -232,20 +232,20 @@ namespace KDEConnectIndicator {
if (device.is_reachable) {
if (device.is_trusted) {
status_item.label = _("Device Reachable and Trusted");
InOut.write_status (device.id, device.name);
KDEConnectIndicator.InOut.write_status (device.id, device.name);
}
else {
status_item.label = _("Device Reachable but Not Trusted");
InOut.delete_status (device.id, device.name);
KDEConnectIndicator.InOut.delete_status (device.id, device.name);
}
} else {
if (device.is_trusted) {
status_item.label = _("Device Trusted but not Reachable");
InOut.delete_status (device.id, device.name);
KDEConnectIndicator.InOut.delete_status (device.id, device.name);
}
else {
status_item.label = _("Device Not Reachable and Not Trusted");
InOut.delete_status (device.id, device.name);
KDEConnectIndicator.InOut.delete_status (device.id, device.name);
// is this even posible?
}
}
Expand Down
8 changes: 3 additions & 5 deletions src/KDEConnectManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace KDEConnectIndicator {
private DBusConnection conn;
private SList<DeviceIndicator> device_list;
private SList<uint> subs_identifier;
private string visible_devices = "/tmp/devices";
//private string visible_devices = "/tmp/devices";

public KDEConnectManager () {
try {
Expand All @@ -33,7 +33,7 @@ namespace KDEConnectIndicator {
message ("KDE Connect daemon found");


var file = File.new_for_path (visible_devices);
var file = File.new_for_path (KDEConnectIndicator.InOut.visible_devices);

try {
if (!file.query_exists ())
Expand Down Expand Up @@ -122,7 +122,7 @@ namespace KDEConnectIndicator {
conn.signal_unsubscribe (i);

try {
var file = File.new_for_path (visible_devices);
var file = File.new_for_path (KDEConnectIndicator.InOut.visible_devices);
if (file.query_exists ())
file.delete ();
} catch (Error e) {
Expand Down Expand Up @@ -157,8 +157,6 @@ namespace KDEConnectIndicator {
var kdeconnect_path = GLib.Environment.get_system_config_dirs()[0]+
"/autostart/kdeconnectd.desktop";



string std_out;

try{
Expand Down
6 changes: 3 additions & 3 deletions src/settings/InOut.vala
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

namespace KDEConnectIndicator {
class InOut{
private static string visible_devices = "/tmp/devices";
public static unowned string visible_devices = "/tmp/devices";

public static int write_status (string id, string name) {
var file = File.new_for_path (visible_devices);
var file = File.new_for_path (InOut.visible_devices);

if (!file.query_exists ()) {
message ("File '%s' doesn't exist.\n", file.get_path ());
Expand Down Expand Up @@ -65,7 +65,7 @@ namespace KDEConnectIndicator {
}

public static int delete_status (string id, string name) {
var file = File.new_for_path (visible_devices);
var file = File.new_for_path (InOut.visible_devices);

if (!file.query_exists ()) {
message ("File '%s' doesn't exist.\n", file.get_path ());
Expand Down

0 comments on commit b993f65

Please sign in to comment.