Friendiqa v0.3

This commit is contained in:
LubuWest 2018-07-01 15:09:21 +02:00
commit bda2d9f7b5
63 changed files with 2746 additions and 1357 deletions

View file

@ -37,7 +37,7 @@ Item {
id: contactLargeComponent
x:mm
y:mm
property var contact:{}
property var contact:({})
property var createdAtDate: new Date(contact.created_at)
property string connectUrl: (contact.network!=="dfrn")||(contact.isFriend!=0)?"":( "<a href='"+contact.url.replace("profile","dfrn_request") +"'>"+qsTr("Connect")+"</a><br>")
@ -63,7 +63,7 @@ Rectangle {
x: mm
width: root.width-6*mm //friendsTabView.width-4*mm
height: 3*mm
text:Qt.atob(contact.name)+" (@"+contact.screen_name+")"
text:contact.name+" (@"+contact.screen_name+")"
elide:Text.ElideRight
anchors.topMargin: 0
anchors.left: photoImage.left
@ -91,7 +91,7 @@ Rectangle{
font.pixelSize: 3*mm
textFormat:Text.RichText
wrapMode: Text.Wrap
text:"<b>"+qsTr("Description")+": </b> "+Qt.atob(contact.description)+"<br> <b>"+qsTr("Location")+":</b> "+contact.location+"<br> <b>"+qsTr("Posts")+":</b> "+contact.statuses_count+
text:"<b>"+qsTr("Description")+": </b> "+contact.description+"<br> <b>"+qsTr("Location")+":</b> "+contact.location+"<br> <b>"+qsTr("Posts")+":</b> "+contact.statuses_count+
"<br> <b>"+qsTr("URL")+":</b> <a href='"+ contact.url+"'>"+contact.url+"</a><br>"+
connectUrl+ "<b>"+qsTr("Created at")+":</b> "+createdAtDate.toLocaleString(Qt.locale())
onLinkActivated: {
@ -123,7 +123,7 @@ Rectangle{
text: "\uf0e6" //"Messages"
onClicked:{
root.currentIndex=0;
newstab.active=true;
//newstab.active=true;
root.messageSignal(contact) ;
contactLargeComponent.destroy();
}
@ -135,7 +135,7 @@ Rectangle{
text: "\uf040" //"DM"
onClicked:{
root.currentIndex=0;
newstab.active=true;
//newstab.active=true;
root.directmessageSignal(contact.screen_name);
contactLargeComponent.destroy();
}

View file

@ -126,6 +126,8 @@ Rectangle {
try {friendsModel.clear()} catch(e){print(e)};
Helperjs.readData(root.db,"contacts",login.username,function(friendsobject){
for (var i=0;i<friendsobject.length;i++){
friendsobject[i].description=Qt.atob(friendsobject[i].description);
friendsobject[i].name=Qt.atob(friendsobject[i].name);
if(Helperjs.getCount(db,login,"contacts","screen_name",friendsobject[i].screen_name)>1){
friendsobject[i].screen_name=friendsobject[i].screen_name+"+"+friendsobject[i].cid
}
@ -205,6 +207,8 @@ Rectangle {
try {contactsModel.clear()} catch(e){print(e)};
Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){
for (var j=0;j<contactsobject.length;j++){
contactsobject[j].description=Qt.atob(contactsobject[j].description);
contactsobject[j].name=Qt.atob(contactsobject[j].name);
contactsModel.append({"contact":contactsobject[j]});
}
},"isFriend",0,"screen_name ASC");
@ -220,6 +224,8 @@ Rectangle {
try {contactsModel.clear()} catch(e){print(e)};
Helperjs.readData(db, "contacts",root.login.username,function(contactsobject){
for (var j=0;j<contactsobject.length;j++){
contactsobject[j].description=Qt.atob(contactsobject[j].description);
contactsobject[j].name=Qt.atob(contactsobject[j].name);
contactsModel.append({"contact":contactsobject[j]});
}
},"isFriend",0,"screen_name ASC");