Version 0.002 code cleanup and event attending

This commit is contained in:
LubuWest 2017-01-29 17:26:09 +01:00
commit d8186978e7
42 changed files with 925 additions and 968 deletions

View file

@ -1,5 +1,4 @@
import QtQuick 2.0
import QtQuick.LocalStorage 2.0
import QtQuick.Controls 1.3
import QtQml.Models 2.1
import "qrc:/js/service.js" as Service
@ -27,8 +26,7 @@ Package {
Item {
Package.name: 'album'
id: albumWrapper; width: 16.5*mm; height: 16.5*mm //-albumtext.contentHeight
id: albumWrapper; width: 16.5*mm; height: 16.5*mm
DelegateModel {
id: visualModel; delegate: PhotoComponent { }
model: photoModel
@ -55,7 +53,7 @@ Package {
}
Text {
id:albumtext
text: albumname //foreignPicture ? album.name.trim() : album
text: albumname
width:albumWrapper.width-1*mm
height: albumtext.contentHeight
wrapMode:Text.Wrap
@ -72,25 +70,21 @@ Package {
Component.onCompleted:{
try {photoModel.clear()}catch (e){print(e)}
if(foreignPicture){
//print("Albumlink"+album.link);
Service.requestFriendsPictures(albumlink,fotostab,function(obj){
if (obj) {
for (var k=0;k<obj.length;k++){
//print("Photomodel:"+obj[k].thumb+obj[k].name+obj[k].link);
photoModel.append({"imageLocation": obj[k].thumb,"photoDescription":obj[k].name,"photoLink":obj[k].link})
};
}
if (obj) {
for (var k=0;k<obj.length;k++){
photoModel.append({"imageLocation": obj[k].thumb,"photoDescription":obj[k].name,"photoLink":obj[k].link})
}
}
})}
else{
Helperjs.readData(db,"imageData",root.login.username,function(obj){
// obj.sort(function(obj1,obj2){return obj1.data-obj2.data});
if (obj) {
for (var k=0;k<obj.length;k++){
// print("Photomodel:"+obj[k].location+obj[k].filename);
photoModel.append({"imageLocation": obj[k].location+obj[k].filename,"photoDescription":obj[k].filename,"photoLink":obj[k].location+obj[k].filename})
};
}
},"album",albumname)}
if (obj) {
for (var k=0;k<obj.length;k++){
photoModel.append({"imageLocation": obj[k].location+obj[k].filename,"photoDescription":obj[k].filename,"photoLink":obj[k].location+obj[k].filename})
}
}
},"album",albumname)}
}
MouseArea {