fix user profile crash

- 1st commit for fixing app crashes
This commit is contained in:
molan-git 2020-06-16 16:09:28 +02:00
parent 0446eda9d0
commit 674e96754b
14 changed files with 194 additions and 126 deletions

View file

Before

Width:  |  Height:  |  Size: 451 B

After

Width:  |  Height:  |  Size: 451 B

View file

@ -89,11 +89,11 @@ var tootParser = function(data){
ret.avatar_static = data.account.avatar_static
ret.favourited = data.favourited ? true : false
ret.favourites_count = data.favourites_count ? data.favourites_count : 0
ret.status_favourites_count = data.favourites_count ? data.favourites_count : 0
ret.reblog = data.reblog ? true : false
ret.reblogged = data.reblogged ? true : false
ret.reblogs_count = data.reblogs_count ? data.reblogs_count : false
ret.status_reblogs_count = data.reblogs_count ? data.reblogs_count : false
ret.muted = data.muted ? true : false
ret.sensitive = data.sensitive ? true : false

View file

@ -1,5 +1,8 @@
Qt.include("Mastodon.js")
var loadImages = true;
WorkerScript.onMessage = function(msg) {
console.log("Action > " + msg.action)
console.log("Model > " + msg.model)
@ -9,16 +12,17 @@ WorkerScript.onMessage = function(msg) {
// order notifications in ASC order
function orderNotifications(items){
for (var i = items.length-1; i > 0; i--){
for (var i = items.length-1; i > 0; i--) {
if (items[i].id > 0 ) //msg.conf.notificationLastID)
WorkerScript.sendMessage({ 'fireNotification': true, "data": items[i]})
}
}
if (!msg.conf || !msg.conf.login){
if (!msg.conf || !msg.conf.login) {
console.log("Not loggedin")
return;
}
if (typeof msg.conf['loadImages'] !== "undefined")
loadImages = msg.conf['loadImages']
@ -27,7 +31,7 @@ WorkerScript.onMessage = function(msg) {
API.post(msg.action, msg.params, function(data) {
if (msg.bgAction){
console.log(JSON.stringify(data))
} else if (msg.action === "statuses"){
} else if (msg.action === "statuses") {
// status posted
if(msg.model){
var item = parseToot(data);
@ -59,7 +63,7 @@ WorkerScript.onMessage = function(msg) {
} else if(msg.action === "notifications") {
// notification
//console.log("Is notification... parsing...")
// console.log("Is notification... parsing...")
console.log(JSON.stringify(data[i]))
item = parseNotification(data[i]);
items.push(item)
@ -90,14 +94,13 @@ WorkerScript.onMessage = function(msg) {
}
addDataToModel (msg.model, "append", items);
items = [];
} else if (data[i].hasOwnProperty("content")){
//console.log("Is toot... parsing...")
// console.log("Is toot... parsing...")
item = parseToot(data[i]);
item['id'] = item['status_id']
items.push(item)
} else {
WorkerScript.sendMessage({ 'action': msg.action, 'success': true, key: i, "data": data[i]})
WorkerScript.sendMessage({ 'action': msg.action, 'success': true, key: i, "data": data[i] })
}
}
}
@ -108,39 +111,54 @@ WorkerScript.onMessage = function(msg) {
});
}
//WorkerScript.sendMessage({ 'notifyNewItems': length - i })
function addDataToModel (model, mode, items){
function addDataToModel (model, mode, items) {
var length = items.length;
console.log("Fetched > " +length)
if (mode === "append") {
model.append(items)
} else if (mode === "prepend") {
for(var i = length-1; i >= 0 ; i--){
for(var i = length-1; i >= 0 ; i--) {
model.insert(0,items[i])
}
}
model.sync()
}
function parseAccounts(collection, prefix, data){
var res = collection;
// Get Account Data: Represents a user of Mastodon and their associated profile.
function parseAccounts(collection, prefix, data) {
var res = collection;
// Base attributes
res[prefix + 'account_id'] = data["id"]
res[prefix + 'account_username'] = data["username"]
res[prefix + 'account_acct'] = data["acct"]
res[prefix + 'account_url'] = data["url"]
// Display attributes
res[prefix + 'account_display_name'] = data["display_name"]
res[prefix + 'account_locked'] = data["locked"]
res[prefix + 'account_created_at'] = data["created_at"]
res[prefix + 'account_note'] = data["note"]
res[prefix + 'account_avatar'] = data["avatar"]
res[prefix + 'account_header'] = data["header"]
res[prefix + 'account_locked'] = data["locked"]
//res[prefix + 'account_emojis'] = data["emojis"]
res[prefix + 'account_discoverable'] = data["discoverable"]
// Statistical attributes
res[prefix + 'account_created_at'] = data["created_at"]
res[prefix + 'account_statuses_count'] = data["statuses_count"]
res[prefix + 'account_followers_count'] = data["followers_count"]
res[prefix + 'account_following_count'] = data["following_count"]
// Optional attributes
//res[prefix + 'account_fields'] = data["fields"]
res[prefix + 'account_bot'] = data["bot"]
res[prefix + 'account_source'] = data["source"]
// console.log(JSON.stringify(res))
//console.log(JSON.stringify(res))
return (res);
}
// Get Notification Data
function parseNotification(data){
//console.log(JSON.stringify(data))
var item = {
@ -153,29 +171,28 @@ function parseNotification(data){
if (!data.status) {
break;
}
item = parseToot(data.status)
item['typeIcon'] = "image://theme/icon-s-retweet"
item['typeIcon'] = "image://theme/icon-s-alarm"
item['type'] = "mention";
item['type'] = "mention"
break;
case "reblog":
if (!data.status) {
break;
}
item = parseToot(data.status)
item = parseAccounts(item, "reblog_", data["account"])
item = parseAccounts(item, "", data["status"]["account"])
item['status_reblog'] = true;
item['type'] = "reblog";
item['status_reblog'] = true
item['type'] = "reblog"
item['typeIcon'] = "image://theme/icon-s-retweet"
break;
case "favourite":
if (!data.status) {
break;
}
item = parseToot(data.status)
item = parseAccounts(item, "reblog_", data["account"])
item = parseAccounts(item, "", data["status"]["account"])
@ -184,15 +201,16 @@ function parseNotification(data){
item['type'] = "favourite";
//item['retweetScreenName'] = item['reblog_account_username'];
break;
case "follow":
item['type'] = "follow";
item = parseAccounts(item, "", data["account"])
item = parseAccounts(item, "reblog_", data["account"])
item['content'] = data['account']['note']
item['typeIcon'] = "../../images/icon-s-following.svg"
item['typeIcon'] = "../../images/icon-s-follow.svg"
item['attachments'] = []
break;
default:
item['typeIcon'] = "image://theme/icon-s-sailfish"
}
@ -215,41 +233,48 @@ function collect() {
}
return ret;
}
function getDate(dateStr){
function getDate(dateStr) {
var ts = new Date(dateStr);
return new Date(ts.getFullYear(), ts.getMonth(), ts.getDate(), 0, 0, 0)
}
function parseToot (data){
// Get Status / Toot Data
function parseToot (data) {
var i = 0;
var item = {};
item['type'] = "toot"
item['highlight'] = false
item['status_id'] = data["id"]
item['status_uri'] = data["uri"]
item['status_url'] = data["url"]
item['status_in_reply_to_id'] = data["in_reply_to_id"]
item['status_in_reply_to_account_id'] = data["in_reply_to_account_id"]
item['status_reblog'] = data["reblog"] ? true : false
item['status_content'] = data["content"]
item['status_created_at'] = item['created_at'] = new Date(data["created_at"]);
item['section'] = getDate(data["created_at"]);
item['reblogs_count'] = data["reblogs_count"]
item['favourites_count'] = data["favourites_count"]
item['reblogged'] = data["reblogged"]
item['favourited'] = data["favourited"]
item['bookmarked'] = data["bookmarked"]
item['status_created_at'] = item['created_at'] = new Date(data["created_at"])
item['status_sensitive'] = data["sensitive"]
item['status_spoiler_text'] = data["spoiler_text"]
item['status_visibility'] = data["visibility"]
item['status_language'] = data["language"]
if(item['status_reblog']){
item['status_uri'] = data["uri"]
item['status_url'] = data["url"]
item['status_replies_count'] = data["replies_count"]
item['status_reblogs_count'] = data["reblogs_count"]
item['status_favourites_count'] = data["favourites_count"]
item['status_favourited'] = data["favourited"]
item['status_reblogged'] = data["reblogged"]
item['status_bookmarked'] = data["bookmarked"]
item['status_content'] = data["content"]
item['status_in_reply_to_id'] = data["in_reply_to_id"]
item['status_in_reply_to_account_id'] = data["in_reply_to_account_id"]
item['status_reblog'] = data["reblog"] ? true : false
item['section'] = getDate(data["created_at"])
// If Toot is a Reblog
if(item['status_reblog']) {
item['type'] = "reblog";
item['typeIcon'] = "image://theme/icon-s-retweet"
item['status_id'] = data["reblog"]["id"];
item['status_spoiler_text'] = data["reblog"]["spoiler_text"]
item['status_sensitive'] = data["reblog"]["sensitive"]
item['emojis'] = data["reblog"]["emojis"];
item = parseAccounts(item, "", data['reblog']["account"])
item = parseAccounts(item, "reblog_", data["account"])
} else {
@ -262,14 +287,11 @@ function parseToot (data){
.replaceAll('class=""', '');
item['attachments'] = [];
for(i = 0; i < data['media_attachments'].length ; i++){
// Media attachements in Toots
for(i = 0; i < data['media_attachments'].length ; i++) {
var attachments = data['media_attachments'][i];
item['content'] = item['content'].replaceAll(attachments['text_url'], '')
var tmp = {
id: attachments['id'],
id: attachments['id'],
type: attachments['type'],
url: attachments['remote_url'] && typeof attachments['remote_url'] == "string" ? attachments['remote_url'] : attachments['url'] ,
@ -277,8 +299,10 @@ function parseToot (data){
}
item['attachments'].push(tmp)
}
if(item['status_reblog']){
for(i = 0; i < data['reblog']['media_attachments'].length ; i++){
// Media attachements in Reblogs
if(item['status_reblog']) {
for(i = 0; i < data['reblog']['media_attachments'].length ; i++) {
var attachments = data['reblog']['media_attachments'][i];
item['content'] = item['content'].replaceAll(attachments['text_url'], '')
var tmp = {
@ -290,18 +314,20 @@ function parseToot (data){
item['attachments'].push(tmp)
}
}
return addEmojis(item, data);
}
function addEmojis(item, data){
// Display function for custom Emojis in Toots
function addEmojis(item, data) {
var emoji, i;
for (i = 0; i < data["emojis"].length; i++){
for (i = 0; i < data["emojis"].length; i++) {
emoji = data["emojis"][i];
item['content'] = item['content'].replaceAll(":"+emoji.shortcode+":", "<img src=\"" + emoji.static_url+"\" align=\"top\" width=\"50\" height=\"50\">")
//console.log(JSON.stringify(data["emojis"][i]))
}
if (data["reblog"])
for (i = 0; i < data["reblog"]["emojis"].length; i++){
for (i = 0; i < data["reblog"]["emojis"].length; i++) {
emoji = data["reblog"]["emojis"][i];
item['content'] = item['content'].replaceAll(":"+emoji.shortcode+":", "<img src=\"" + emoji.static_url+"\" align=\"top\" width=\"50\" height=\"50\">")
}

View file

@ -170,13 +170,15 @@ Page {
+ textOperations.text.substring(textOperations.selectionEnd).trim()
toot.cursorPosition = toot.text.indexOf('@' + model.account_acct)
}
}
onCountChanged: {
positionViewAtBeginning(suggestedModel.count - 1, ListView.Beginning)
}
}
}
}
}
onCountChanged: {
if (count > 0) {
positionViewAtBeginning(suggestedModel.count - 1, ListView.Beginning)
}
}
}
}
DockedPanel {
id: panel

View file

@ -175,7 +175,14 @@ Page {
"username": model.account_acct,
"user_id": model.account_id,
"profileImage": model.account_avatar,
"profileBackground": model.account_header
"profileBackground": model.account_header,
"note": model.account_note,
"url": model.account_url,
"followers_count": model.account_followers_count,
"following_count": model.account_following_count,
"statuses_count": model.account_statuses_count,
"locked": model.account_locked,
"bot": model.account_bot
})
}
}

View file

@ -19,14 +19,11 @@ Page {
property int statuses_count
property int following_count
property int followers_count
property int favourites_count
property int reblogs_count
property int count_moments
property bool locked: false
property bool bot: false
property bool following: false
property bool requested: false
property bool followed_by: false
property bool requested: false
property bool blocking: false
property bool muting: false
property bool domain_blocking: false
@ -57,12 +54,12 @@ Page {
if(messageObject.action === "accounts/relationships/"){
console.log(JSON.stringify(messageObject))
following= messageObject.data.following
requested= messageObject.data.requested
followed_by= messageObject.data.followed_by
blocking= messageObject.data.blocking
muting= messageObject.data.muting
domain_blocking= messageObject.data.domain_blocking
following = messageObject.data.following
requested = messageObject.data.requested
followed_by = messageObject.data.followed_by
blocking = messageObject.data.blocking
muting = messageObject.data.muting
domain_blocking = messageObject.data.domain_blocking
}
switch (messageObject.key) {
case 'followers_count':
@ -119,15 +116,18 @@ Page {
if (user_id) {
msg = {
'action' : "accounts/relationships/",
'params' : [ {name: "id", data: user_id}],
'params' : [ {name: "id", data: user_id} ],
'conf' : Logic.conf
}
worker.sendMessage(msg)
msg = {
// reason for crashes when opening ProfilePage.qml
/* msg = {
'action' : "accounts/"+user_id,
'conf' : Logic.conf
}
worker.sendMessage(msg)
worker.sendMessage(msg) */
} else {
var instance = Logic.conf['instance'].split("//")
msg = {
@ -249,7 +249,7 @@ Page {
Text {
id: txtFollowers
visible: followers_count ? true : false
visible: true //followers_count ? true : false
text: followers_count+" "+
//: Will show as: "35 Followers"
qsTr("Followers")
@ -260,7 +260,7 @@ Page {
Text {
id: txtFollowing
visible: following_count ? true : false
visible: true //following_count ? true : false
text: following_count+" "+
//: Will show as: "23 Following"
qsTr("Following")
@ -271,7 +271,7 @@ Page {
Text {
id: txtStatuses
visible: statuses_count ? true : false
visible: true //statuses_count ? true : false
text: statuses_count+" "+
//: Will show as: "115 Statuses"
qsTr("Statuses")
@ -279,17 +279,6 @@ Page {
color: Theme.highlightColor
wrapMode: Text.Wrap
}
/*Text {
id: txtFavourites
visible: favourites_count ? true : false
text: favourites_count+" "+
//: Will show as: "56 Favourites"
qsTr("Favourites")
font.pixelSize: Theme.fontSizeExtraSmall
color: Theme.highlightColor
wrapMode: Text.Wrap
} */
}
Item { // dummy item for spacing

View file

@ -18,6 +18,7 @@ BackgroundItem {
anchors.left: parent.left
anchors.leftMargin: Theme.horizontalPageMargin
color: Theme.highlightDimmerColor
Image {
id: img
opacity: status === Image.Ready ? 1.0 : 0.0
@ -41,7 +42,14 @@ BackgroundItem {
"username": model.account_acct,
"user_id": model.account_id,
"profileImage": model.account_avatar,
"profileBackground": model.account_header
"profileBackground": model.account_header,
"note": model.account_note,
"url": model.account_url,
"followers_count": model.account_followers_count,
"following_count": model.account_following_count,
"statuses_count": model.account_statuses_count,
"locked": model.account_locked,
"bot": model.account_bot
})
}
}
@ -54,7 +62,7 @@ BackgroundItem {
Label {
id: display_name
text: if (model.account_display_name + " ") {
text: if (model.account_display_name === "") {
model.account_username.split("@")[0] + " "
} else model.account_display_name
color: !pressed ? Theme.primaryColor : Theme.highlightColor
@ -75,7 +83,14 @@ BackgroundItem {
"username": model.account_acct,
"user_id": model.account_id,
"profileImage": model.account_avatar,
"profileBackground": model.account_header
"profileBackground": model.account_header,
"note": model.account_note,
"url": model.account_url,
"followers_count": model.account_followers_count,
"following_count": model.account_following_count,
"statuses_count": model.account_statuses_count,
"locked": model.account_locked,
"bot": model.account_bot
} )
}

View file

@ -23,12 +23,14 @@ Item {
if (model && model.count)
count = model.count
switch(count){
case 1:
placeholder1.width = holder.width
placeholder1.height = placeholder1.width*hRatio
placeholder1.visible = true;
holder.height = placeholder1.height
break;
case 2:
placeholder1.visible = true;
placeholder2.visible = true;
@ -39,6 +41,7 @@ Item {
placeholder2.x = placeholder1.width + placeholder2.x + Theme.paddingSmall
holder.height = placeholder1.height
break;
case 3:
placeholder1.visible = true;
placeholder2.visible = true;
@ -53,8 +56,8 @@ Item {
placeholder3.height = placeholder3.width = placeholder2.height = placeholder2.width
placeholder3.x = placeholder2.x = placeholder1.x + placeholder1.width + Theme.paddingSmall;
placeholder3.y = placeholder2.y + placeholder2.height + Theme.paddingSmall;
break;
case 4:
placeholder1.visible = true;
placeholder2.visible = true;
@ -67,9 +70,9 @@ Item {
placeholder3.x = 2*(placeholder1.width)+ 2*Theme.paddingSmall;
placeholder4.x = 3*(placeholder1.width)+ 3*Theme.paddingSmall;
holder.height = placeholder1.height
break;
default:
holder.height = 0
placeholder1.visible = placeholder2.visible = placeholder3.visible = placeholder4.visible = false;
@ -86,7 +89,7 @@ Item {
type = model.get(0).type
previewURL = model.get(0).preview_url
mediaURL = model.get(0).url
height = 200
height = Theme.itemSizeLarge
return true
} else {
height = 0
@ -105,7 +108,7 @@ Item {
type = model.get(1).type
previewURL = model.get(1).preview_url
mediaURL = model.get(1).url
height = 200
height = Theme.itemSizeLarge
return true
} else {
height = 0
@ -124,7 +127,7 @@ Item {
type = model.get(2).type
previewURL = model.get(2).preview_url
mediaURL = model.get(2).url
height = 200
height = Theme.itemSizeLarge
return true
} else {
height = 0
@ -143,7 +146,7 @@ Item {
type = model.get(3).type
previewURL = model.get(3).preview_url
mediaURL = model.get(3).url
height = 200
height = Theme.itemSizeLarge
return true
} else {
height = 0

View file

@ -11,7 +11,7 @@ FullscreenContentPage {
property string mediaURL: ""
allowedOrientations: Orientation.All
Component.onCompleted: function(){
Component.onCompleted: function() {
console.log(type)
console.log(previewURL)
console.log(mediaURL)
@ -44,7 +44,7 @@ FullscreenContentPage {
Video {
id: video
anchors.fill: parent
onErrorStringChanged: function(){
onErrorStringChanged: function() {
videoError.visible = true
}
onStatusChanged: {
@ -60,7 +60,7 @@ FullscreenContentPage {
}
onPlaybackStateChanged: {
console.log(playbackState)
switch (playbackState){
switch (playbackState) {
case MediaPlayer.PlayingState:
playerIcon.icon.source = "image://theme/icon-m-pause"
return;
@ -72,7 +72,7 @@ FullscreenContentPage {
return;
}
}
onPositionChanged: function(){
onPositionChanged: function() {
//console.log(duration)
//console.log(bufferProgress)
//console.log(position)
@ -84,7 +84,7 @@ FullscreenContentPage {
}
}
onStopped: function() {
if (video.duration < 30000)
if (type != 'video')
video.play()
else
video.stop()
@ -151,7 +151,6 @@ FullscreenContentPage {
anchors.centerIn: parent
}
}
}
}
@ -288,7 +287,7 @@ FullscreenContentPage {
id: failedLoading
Text {
text: qsTr("Error loading")
font.pixelSize: Theme.fontSizeSmall;
font.pixelSize: Theme.fontSizeSmall
color: Theme.highlightColor
}
}
@ -315,11 +314,10 @@ FullscreenContentPage {
}
icon.source: "image://theme/icon-m-cloud-download"
onClicked: {
var filename = mediaURL.split("/");
FileDownloader.downloadFile(mediaURL, filename[filename.length-1]);
var filename = mediaURL.split("/")
FileDownloader.downloadFile(mediaURL, filename[filename.length-1])
}
}
VerticalScrollDecorator { flickable: imageFlickable }
}

View file

@ -26,13 +26,8 @@ Item {
Label {
id: lblRtByName
visible: type.length
anchors {
left: icon.right
leftMargin: Theme.paddingMedium
verticalCenter: icon.verticalCenter
}
text: {
var action = "";
var action = ""
switch(type){
case "reblog":
action = qsTr('boosted');
@ -47,9 +42,14 @@ Item {
miniStatus.visible = false
action = type;
}
return typeof reblog_account_username !== "undefined" ? '@' + reblog_account_username + ' ' + action : ''
return typeof reblog_account_username !== "undefined" ? "@" + reblog_account_username + " " + action : " "
}
font.pixelSize: Theme.fontSizeExtraSmall
color: Theme.highlightColor
anchors {
left: icon.right
leftMargin: Theme.paddingMedium
verticalCenter: icon.verticalCenter
}
}
}

View file

@ -84,7 +84,7 @@ SilicaListView {
}
}
delegate: VisualContainer {}
delegate: VisualContainer { }
add: Transition {
NumberAnimation { property: "opacity"; from: 0; to: 1.0; duration: 800 }

View file

@ -83,7 +83,14 @@ BackgroundItem {
"username": model.account_acct,
"user_id": model.account_id,
"profileImage": model.account_avatar,
"profileBackground": model.account_header
"profileBackground": model.account_header,
"note": model.account_note,
"url": model.account_url,
"followers_count": model.account_followers_count,
"following_count": model.account_following_count,
"statuses_count": model.account_statuses_count,
"locked": model.account_locked,
"bot": model.account_bot
} )
}
}
@ -146,6 +153,26 @@ BackgroundItem {
width: Theme.iconSizeSmall
height: width
}
MouseArea {
anchors.fill: parent
onClicked: {
pageStack.push(Qt.resolvedUrl("../ProfilePage.qml"), {
"display_name": model.reblog_account_display_name,
"username": model.reblog_account_acct,
"user_id": model.reblog_account_id,
"profileImage": model.reblog_account_avatar,
"profileBackground": model.account_header,
"note": model.reblog_account_note,
"url": model.reblog_account_url,
"followers_count": model.reblog_account_followers_count,
"following_count": model.reblog_account_following_count,
"statuses_count": model.reblog_account_statuses_count,
"locked": model.reblog_account_locked,
"bot": model.reblog_account_bot
} )
}
}
}
}
@ -247,13 +274,13 @@ BackgroundItem {
visible: if (myList.type === "notifications" && ( type === "favourite" || type === "reblog" )) {
false
} else true
model: typeof attachments !== "undefined" ? attachments : Qt.createQmlObject('import QtQuick 2.0; ListModel { }', Qt.application, 'InternalQmlObject');
model: typeof attachments !== "undefined" ? attachments : Qt.createQmlObject('import QtQuick 2.0; ListModel { }', Qt.application, 'InternalQmlObject');
height: Theme.iconSizeExtraLarge * 2
anchors {
left: lblContent.left
right: lblContent.right
top: lblContent.bottom
topMargin: Theme.paddingSmall
topMargin: Theme.paddingMedium
bottomMargin: Theme.paddingLarge
}
}
@ -275,7 +302,7 @@ BackgroundItem {
"bgAction": true,
"action" : "statuses/"+model.status_id+"/" + (status ? "unreblog" : "reblog")
})
model.reblogs_count = !status ? model.reblogs_count+1 : (model.reblogs_count > 0 ? model.reblogs_count-1 : model.reblogs_count);
model.status_reblogs_count = !status ? model.status_reblogs_count+1 : (model.status_reblogs_count > 0 ? model.status_reblogs_count-1 : model.status_reblogs_count);
model.reblogged = !model.reblogged
}
@ -292,7 +319,7 @@ BackgroundItem {
}
Label {
text: reblogs_count
text: status_reblogs_count // from API.js
font.pixelSize: Theme.fontSizeExtraSmall
color: !model.reblogged ? Theme.highlightColor : Theme.primaryColor
anchors {
@ -316,7 +343,7 @@ BackgroundItem {
"bgAction": true,
"action" : "statuses/"+model.status_id+"/" + (status ? "unfavourite" : "favourite")
})
model.favourites_count = !status ? model.favourites_count+1 : (model.favourites_count > 0 ? model.favourites_count-1 : model.favourites_count);
model.status_favourites_count = !status ? model.status_favourites_count+1 : (model.status_favourites_count > 0 ? model.status_favourites_count-1 : model.status_favourites_count);
model.favourited = !model.favourited
}
@ -333,7 +360,7 @@ BackgroundItem {
}
Label {
text: favourites_count
text: status_favourites_count // from API.js
font.pixelSize: Theme.fontSizeExtraSmall
color: !model.favourited ? Theme.highlightColor : Theme.primaryColor
anchors {
@ -386,8 +413,9 @@ BackgroundItem {
}
onPressAndHold: {
console.log(JSON.stringify(mdl.get(index)))
mnu.show(delegate)
mnu.open(delegate)
}
onDoubleClicked: {
console.log("double click")
}

View file

@ -14,7 +14,7 @@ Name: harbour-tooter
%{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: Tooter
Version: 1.0.4
Release: 1
Release: 9
Group: Qt/Qt
License: LICENSE
URL: http://example.org/

View file

@ -1,7 +1,7 @@
Name: harbour-tooter
Summary: Tooter
Version: 1.0.4
Release: 1
Release: 9
# The contents of the Group field should be one of the groups listed here:
# https://github.com/mer-tools/spectacle/blob/master/data/GROUPS
Group: Qt/Qt