More small fixes for Github.qml/About.qml
This commit is contained in:
parent
f8ec879270
commit
bad205f5f6
2 changed files with 13 additions and 7 deletions
|
|
@ -11,7 +11,7 @@ ColumnLayout {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property string latestVersion: GitHub.latestVersion
|
property string latestVersion: GitHub.latestVersion
|
||||||
property string currentVersion: "v2.0.0" // Fallback version
|
property string currentVersion: "Unknown" // Fallback version
|
||||||
property var contributors: GitHub.contributors
|
property var contributors: GitHub.contributors
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ Singleton {
|
||||||
property var contributors: []
|
property var contributors: []
|
||||||
|
|
||||||
FileView {
|
FileView {
|
||||||
objectName: "githubDataFileView"
|
id: githubDataFileView
|
||||||
path: githubDataFile
|
path: githubDataFile
|
||||||
watchChanges: true
|
watchChanges: true
|
||||||
onFileChanged: reload()
|
onFileChanged: reload()
|
||||||
|
|
@ -80,12 +80,16 @@ Singleton {
|
||||||
// --------------------------------
|
// --------------------------------
|
||||||
function saveData() {
|
function saveData() {
|
||||||
data.timestamp = Time.timestamp
|
data.timestamp = Time.timestamp
|
||||||
|
console.log("[GitHub] Saving data to cache file:", githubDataFile)
|
||||||
|
console.log("[GitHub] Data to save - version:", data.version, "contributors:", data.contributors.length)
|
||||||
|
|
||||||
|
// Ensure cache directory exists
|
||||||
|
Quickshell.execDetached(["mkdir", "-p", Settings.cacheDir])
|
||||||
|
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
// Access the FileView's writeAdapter method
|
// Use direct ID reference to the FileView
|
||||||
var fileView = root.children.find(child => child.objectName === "githubDataFileView")
|
githubDataFileView.writeAdapter()
|
||||||
if (fileView) {
|
console.log("[GitHub] Cache file written successfully")
|
||||||
fileView.writeAdapter()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -140,8 +144,10 @@ Singleton {
|
||||||
onStreamFinished: {
|
onStreamFinished: {
|
||||||
try {
|
try {
|
||||||
const response = text
|
const response = text
|
||||||
|
console.log("[GitHub] Raw contributors response length:", response ? response.length : 0)
|
||||||
if (response && response.trim()) {
|
if (response && response.trim()) {
|
||||||
const data = JSON.parse(response)
|
const data = JSON.parse(response)
|
||||||
|
console.log("[GitHub] Parsed contributors data type:", typeof data, "length:", Array.isArray(data) ? data.length : "not array")
|
||||||
root.data.contributors = data || []
|
root.data.contributors = data || []
|
||||||
root.contributors = root.data.contributors
|
root.contributors = root.data.contributors
|
||||||
console.log("[GitHub] Contributors fetched from GitHub:", root.contributors.length)
|
console.log("[GitHub] Contributors fetched from GitHub:", root.contributors.length)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue