forked from Shinonome/dots-hyprland
chore(Weather): make things more clear
This commit is contained in:
@@ -14,7 +14,7 @@ Singleton {
|
|||||||
readonly property int fetchInterval: Config.options.bar.weather.fetchInterval * 60 * 1000
|
readonly property int fetchInterval: Config.options.bar.weather.fetchInterval * 60 * 1000
|
||||||
readonly property string city: Config.options.bar.weather.city
|
readonly property string city: Config.options.bar.weather.city
|
||||||
readonly property bool useUSCS: Config.options.bar.weather.useUSCS
|
readonly property bool useUSCS: Config.options.bar.weather.useUSCS
|
||||||
readonly property bool gpsActive: Config.options.bar.weather.enableGPS
|
property bool gpsActive: Config.options.bar.weather.enableGPS
|
||||||
|
|
||||||
property var location: ({
|
property var location: ({
|
||||||
valid: false,
|
valid: false,
|
||||||
@@ -130,15 +130,16 @@ Singleton {
|
|||||||
// if can't get initialized with valid location deactivate the GPS
|
// if can't get initialized with valid location deactivate the GPS
|
||||||
} else {
|
} else {
|
||||||
root.gpsActive = root.location.valid ? true : false;
|
root.gpsActive = root.location.valid ? true : false;
|
||||||
|
console.error("[WeatherService] Failed to get the GPS location.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onValidityChanged: {
|
onValidityChanged: {
|
||||||
if (!valid) {
|
if (!positionSource.valid) {
|
||||||
positionSource.stop();
|
positionSource.stop();
|
||||||
root.location.valid = false;
|
root.location.valid = false;
|
||||||
root.gpsActive = false;
|
root.gpsActive = false;
|
||||||
Quickshell.execDetached(["bash", "-c", `notify-send WeatherService 'Failed to load the GPS service. Using the fallback method instead.'`]);
|
Quickshell.execDetached(["bash", "-c", `notify-send WeatherService 'Can not find a GPS service. Using the fallback method instead.'`]);
|
||||||
console.error("[WeatherService] Could not aquire a valid backend plugin.");
|
console.error("[WeatherService] Could not aquire a valid backend plugin.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user