Resolve conflicting merge issues

This commit is contained in:
Hasan A. Tekeoğlu
2025-07-01 05:20:41 +03:00
parent a18791ef16
commit c17db4bfb1
4 changed files with 38 additions and 201 deletions
+22 -22
View File
@@ -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()
}
}