forked from Shinonome/dots-hyprland
Resolve conflicting merge issues
This commit is contained in:
@@ -11,15 +11,15 @@ import "root:/modules/common"
|
||||
Singleton {
|
||||
id: root
|
||||
// 10 minute
|
||||
readonly property int fetchInterval: ConfigOptions.bar.weather.fetchInterval * 60 * 1000
|
||||
readonly property string city: ConfigOptions.bar.weather.city
|
||||
readonly property bool useUSCS: ConfigOptions.bar.weather.useUSCS
|
||||
readonly property bool gpsActive: ConfigOptions.bar.weather.enableGPS
|
||||
readonly property int fetchInterval: Config.options.bar.weather.fetchInterval * 60 * 1000
|
||||
readonly property string city: Config.options.bar.weather.city
|
||||
readonly property bool useUSCS: Config.options.bar.weather.useUSCS
|
||||
readonly property bool gpsActive: Config.options.bar.weather.enableGPS
|
||||
|
||||
property var location: ({
|
||||
valid: false,
|
||||
lat: 0,
|
||||
lon: 0,
|
||||
lon: 0
|
||||
})
|
||||
|
||||
property var data: ({
|
||||
@@ -90,10 +90,10 @@ Singleton {
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if(!root.gpsActive) return
|
||||
|
||||
console.info("[WeatherService] Starting the GPS service.")
|
||||
positionSource.start()
|
||||
if (!root.gpsActive)
|
||||
return;
|
||||
console.info("[WeatherService] Starting the GPS service.");
|
||||
positionSource.start();
|
||||
}
|
||||
|
||||
Process {
|
||||
@@ -124,23 +124,23 @@ Singleton {
|
||||
if (position.latitudeValid && position.longitudeValid) {
|
||||
root.location.lat = position.coordinate.latitude;
|
||||
root.location.long = position.coordinate.longitude;
|
||||
root.location.valid = true
|
||||
root.location.valid = true;
|
||||
// console.info(`📍 Location: ${position.coordinate.latitude}, ${position.coordinate.longitude}`);
|
||||
root.getData();
|
||||
// if can't get initialized with valid location deactivate the GPS
|
||||
} else {
|
||||
root.gpsActive = root.location.valid ? true : false
|
||||
}
|
||||
// if can't get initialized with valid location deactivate the GPS
|
||||
} else {
|
||||
root.gpsActive = root.location.valid ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
onValidityChanged: {
|
||||
if(!valid) {
|
||||
positionSource.stop()
|
||||
root.location.valid = false
|
||||
root.gpsActive = false
|
||||
Quickshell.execDetached(["bash", "-c", `notify-send WeatherService 'Failed to load the GPS service. Using the fallback method instead.'`])
|
||||
console.error("[WeatherService] Could not aquire a valid backend plugin.")
|
||||
}
|
||||
if (!valid) {
|
||||
positionSource.stop();
|
||||
root.location.valid = false;
|
||||
root.gpsActive = false;
|
||||
Quickshell.execDetached(["bash", "-c", `notify-send WeatherService 'Failed to load the GPS service. Using the fallback method instead.'`]);
|
||||
console.error("[WeatherService] Could not aquire a valid backend plugin.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ Singleton {
|
||||
running: !root.gpsActive
|
||||
repeat: true
|
||||
interval: root.fetchInterval
|
||||
triggeredOnStart: !root.gpsActive
|
||||
triggeredOnStart: !root.gpsActive
|
||||
onTriggered: root.getData()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user