Skip to content

Commit

Permalink
Merge pull request #142 from HelloVolla/dev
Browse files Browse the repository at this point in the history
Fix for sorting thread collection
  • Loading branch information
wurzer authored May 10, 2023
2 parents 7603fee + c6cc669 commit 4edf29f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
22 changes: 19 additions & 3 deletions Collections.qml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,19 @@ Page {
}
}

function sortListModel() {
var n;
var i;
for (n = 0; n < currentCollectionModel.count; n++) {
for (i=n+1; i < currentCollectionModel.count; i++) {
if (currentCollectionModel.get(n).c_TSTAMP < currentCollectionModel.get(i).c_TSTAMP) {
currentCollectionModel.move(i, n, 1);
n = 0;
}
}
}
}

function loadThreads(filter) {
console.log("Collections | Will load threads")
collectionPage.threads = new Array
Expand Down Expand Up @@ -909,6 +922,7 @@ Page {
}

cThread.c_STEXT = mainView.parseTime(Number(thread["date"])) + "" + qsTr(kind)
cThread.c_TSTAMP = Number(thread["date"])

modelArr.push(cThread)
})
Expand Down Expand Up @@ -967,6 +981,8 @@ Page {
append(filteredModelDict[modelItemName])
}
}

collectionPage.sortListModel()
}

function executeSelection(item, type) {
Expand Down Expand Up @@ -1396,9 +1412,9 @@ Page {
|| currentCollectionMode === mainView.collectionMode.Threads) {
message["messages"].forEach(function (aThread, index) {
aThread["isSignal"] = true
for (const [aThreadKey, aThreadValue] of Object.entries(aThread)) {
console.log("Collections | * " + aThreadKey + ": " + aThreadValue)
}
// for (const [aThreadKey, aThreadValue] of Object.entries(aThread)) {
// console.log("Collections | * " + aThreadKey + ": " + aThreadValue)
// }
})
collectionPage.threads = collectionPage.threads.concat(message["messages"])
collectionPage.updateListModel()
Expand Down
2 changes: 1 addition & 1 deletion android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<manifest package="com.volla.launcher" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.2.3" android:versionCode="272" android:installLocation="auto">
<manifest package="com.volla.launcher" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.2.4" android:versionCode="273" android:installLocation="auto">
<uses-sdk android:minSdkVersion="28" android:targetSdkVersion="29"/>

<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
Expand Down

0 comments on commit 4edf29f

Please sign in to comment.