File indexing completed on 2024-05-12 05:27:53

0001 var retryFetch = 0
0002 
0003 function delay(delayTime, cb) {
0004     delayTimer.interval = delayTime;
0005     delayTimer.repeat = false;
0006     delayTimer.triggered.connect(cb);
0007     delayTimer.start();
0008 }
0009 
0010 function fillListModel()
0011 {
0012     sortModel.clear()
0013     var n;
0014     var systemDeps = false;
0015     var skillPlatforms
0016     var warning = ""
0017     var examples
0018     for (n=0; n < modelInstaller.rowCount(); n++) {
0019 
0020         if (modelInstaller.get(n).systemDeps === true || modelInstaller.get(n).systemDeps === "true") {
0021             systemDeps = true
0022         } else if (modelInstaller.get(n).systemDeps === false || modelInstaller.get(n).systemDeps === "false") {
0023             systemDeps = false
0024         } else {
0025             systemDeps = false
0026         }
0027 
0028         if (modelInstaller.get(n).platforms){
0029             skillPlatforms = String(modelInstaller.get(n).platforms)
0030         } else {
0031             skillPlatforms = "all"
0032         }
0033 
0034         if (modelInstaller.get(n).warning){
0035             warning = modelInstaller.get(n).warning
0036         } else {
0037             warning = ""
0038         }
0039 
0040         if (modelInstaller.get(n).examples){
0041             examples = String(modelInstaller.get(n).examples)
0042         } else {
0043             examples = ""
0044         }
0045 
0046         sortModel.append({
0047          "id": modelInstaller.get(n).id,
0048          "name": modelInstaller.get(n).name,
0049          "description": modelInstaller.get(n).description,
0050          "downloadlink1": modelInstaller.get(n).downloadlink1,
0051          "previewpic1": modelInstaller.get(n).previewpic1,
0052          "typename": modelInstaller.get(n).typename,
0053          "personid": modelInstaller.get(n).personid,
0054          "downloads": modelInstaller.get(n).downloads,
0055          "itemInstallStatus": modelInstaller.get(n).itemInstallStatus,
0056          "itemUpdateStatus": modelInstaller.get(n).itemUpdateStatus,
0057          "url": modelInstaller.get(n).url,
0058          "branch": modelInstaller.get(n).branch,
0059          "warning": warning,
0060          "desktopFile": modelInstaller.get(n).desktopFile,
0061          "examples": examples,
0062          "platforms": skillPlatforms,
0063          "systemDeps": systemDeps,
0064          "authorname": modelInstaller.get(n).authorname,
0065          "skillname": modelInstaller.get(n).skillname,
0066          "foldername": modelInstaller.get(n).foldername
0067        })
0068     }
0069 }
0070 
0071 function populateSkillInfo(backend, user)
0072 {
0073     if(backend == "osm") {
0074         var defaultFold = '/home/' + user + '/.local/share/mycroft/skills'
0075     } else {
0076         var defaultFold = '/opt/mycroft/skills'
0077     }
0078     var skillAuthorName = authorname.toLowerCase()
0079     var skillPath = defaultFold + "/" + skillname + "." + personid
0080     var skillObj = {"itemDescription": description, "itemPreviewPic": previewpic1, "itemInstallStatus": itemInstallStatus, "displayName": name, "skillName": skillname.toLowerCase(), "authorName": authorname.toLowerCase(), "folderName": foldername, "skillUrl": url, "skillInstalled": itemInstallStatus, "branch": branch, "skillFolderPath": skillPath, "warning": warning, "desktopFile": desktopFile, "examples": examples, "platforms": platforms, "systemDeps": systemDeps, "itemUpdateStatus": itemUpdateStatus}
0081     skillInfo = skillObj
0082 }