Background sync changes

This commit is contained in:
LubuWest 2024-04-22 22:01:01 +02:00
parent ec102d8d66
commit b59513ab91
13 changed files with 122 additions and 89 deletions

11
BackgroundSync.patch Normal file
View file

@ -0,0 +1,11 @@
--- src/common/alarmlinux.cpp
+++ src/common/alarmlinux.cpp
@@ -67,7 +67,7 @@
stream << "Description=Run friendiqa background sync" << Qt::endl << Qt::endl;
stream << "[Service]" << Qt::endl;
stream << "Type=oneshot" << Qt::endl;
- stream << "ExecStart=/usr/bin/friendiqa -service" << Qt::endl;
+ stream << "ExecStart=flatpak run de.manic.friendiqa -service" << Qt::endl;
}
QString nameTimer ="friendiqa-sync.timer";

View file

@ -1,3 +1,9 @@
## v0.6.9
* Separate window for new messages with more formatting options
* Replaced all Fontawesome icons with system icons
* Switch between OAuth2 and Basic Auth
* Background sync with systemd-timer and removal of system tray
## v0.6.8

View file

@ -5,5 +5,4 @@ You have probably selected Friendica as your preferred social network because yo
Storing some pieces of user data on the device is necessary for some app features, other apps on your device may not access this data (keeping apps own database storage protected from other apps is guaranteed by Android). The app has been programmed so that stored information contain any personal data (only login data and id number of last seen post will be transferred to servers). Photos from the albums and contact images are stored in a public directory on the device. Other apps may access these files and the Friendiqa needs access to this directory.
To send images from the Android gallery the app needs access to picture databases on the device.
This app dont collect any usage statistics. In addition, no information is sent from your Smartphone to me as a developer or to a website associated with me.
On first start, the website https://dir.friendica.social/servers/surprise is contacted and the selected server shown in the app.
This app doesnt collect any usage statistics. In addition, no information is sent from your smartphone to me as a developer or to a website associated with me.

View file

@ -46,7 +46,6 @@ target_link_libraries(friendiqa PRIVATE Qt6::Sql)
target_link_libraries(friendiqa PRIVATE Qt6::DBus)
target_link_libraries(friendiqa PRIVATE Qt6::NetworkAuth)
target_link_libraries(friendiqa PRIVATE Qt6::Multimedia)
#target_link_libraries(friendiqa PRIVATE Qt6::Svg)
install(TARGETS friendiqa DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES assets/de.manic.Friendiqa.desktop DESTINATION share/applications)

View file

@ -1,7 +0,0 @@
[Unit]
Description=Run friendiqa background sync
[Service]
Type=oneshot
ExecStart=/usr/bin/friendiqa -service

View file

@ -1,10 +0,0 @@
[Unit]
Description=Run background sync for Friendiqa periodically
[Timer]
Unit=friendiqa-sync.service
OnBootSec=10min
OnUnitActiveSec=15min
[Install]
WantedBy=timers.target

View file

@ -52,6 +52,39 @@ void ALARM::setAlarm(int interval)
int intDisable = processDisable.execute("systemctl", QStringList() <<"--user"<<"disable"<<"--now"<<"friendiqa-sync.timer");
qDebug() << " intEnable "<<intDisable;
}else{
QString path = QDir::homePath() + "/.config/systemd/user/";
QDir dir(path);
if(!dir.exists()) {
dir.mkpath(path);
}
QString nameService ="friendiqa-sync.service";
QFile fileService(path+nameService);
fileService.remove();
if (fileService.open(QIODevice::ReadWrite)) {
QTextStream stream(&fileService);
stream << "[Unit]" << Qt::endl;
stream << "Description=Run friendiqa background sync" << Qt::endl << Qt::endl;
stream << "[Service]" << Qt::endl;
stream << "Type=oneshot" << Qt::endl;
stream << "ExecStart=/usr/bin/friendiqa -service" << Qt::endl;
}
QString nameTimer ="friendiqa-sync.timer";
QFile fileTimer(path+nameTimer);
fileTimer.remove();
if (fileTimer.open(QIODevice::ReadWrite)) {
QTextStream stream(&fileTimer);
stream << "[Unit]" << Qt::endl;
stream << "Description=Run background sync for Friendiqa periodically" << Qt::endl << Qt::endl;
stream << "[Timer]" << Qt::endl;
stream << "Unit=friendiqa-sync.service" << Qt::endl;
stream << "OnBootSec=10min" << Qt::endl;
stream << "OnUnitActiveSec=15min" << Qt::endl << Qt::endl;
stream << "[Install]" << Qt::endl;
stream << "WantedBy=timers.target" << Qt::endl;
}
QProcess processReload;
int intReload = processReload.execute("systemctl", QStringList()<<"--user"<<"daemon-reload");
QProcess processEnable;

View file

@ -230,7 +230,7 @@ Page{
MButton {
anchors.right: parent.right; anchors.rightMargin: mm;
anchors.right: parent.right; anchors.rightMargin: root.fontFactor*osSettings.bigFontSize;
anchors.top: parent.top
anchors.topMargin: 3*root.fontFactor*osSettings.bigFontSize
//width: 2*root.fontFactor*osSettings.bigFontSize;

View file

@ -118,7 +118,7 @@ Page{
anchors.top: parent.top
anchors.topMargin:2*root.fontFactor*osSettings.bigFontSize
anchors.right: parent.right
anchors.rightMargin: 1*mm
anchors.rightMargin: root.fontFactor*osSettings.bigFontSize
text: qsTr("Close")
display: AbstractButton.IconOnly
icon.name: "dialog-close"

View file

@ -43,7 +43,7 @@ QtObject{
property int systemFontSize: root.font.pointSize*1.1
property int bigFontSize: systemFontSize*1.3
property string imagePickQml: "ImagePicker"
property string imagePicker:'import QtQuick 2.0; import "qrc:/qml/genericqml";'+
property string imagePicker:'import QtQuick 6.3; import "qrc:/qml/genericqml";'+
imagePickQml+'{multiple : true;onReady: {attachImageURLs.push(imageUrl);'+
'attachImage(imageUrl)}}'

View file

@ -164,6 +164,7 @@ Rectangle{
function search(term){
if (term!=""){
newsBusy.running=true;
newsSwipeview.stacktype="Search";
updateMethodNews="refresh";
xhr.setAccount(login);
xhr.setApi("/api/search/tweets");

View file

@ -154,7 +154,8 @@ Item {
onLinkActivated:{
if(link.startsWith(root.login.server+"\/search\?tag=")){
newstab.newstabstatus="Search";
root.searchSignal(link.substring(root.login.server.length+12,link.length))
//root.searchSignal(link.substring(root.login.server.length+12,link.length))
search((link.substring(root.login.server.length+12,link.length)))
}
else{Qt.openUrlExternally(link)}
}

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de">
<TS version="2.1" language="de_DE">
<context>
<name>AcceptRules</name>
<message>
@ -189,7 +189,7 @@
</message>
<message>
<source>Default News Tabs</source>
<translation type="unfinished"></translation>
<translation>Standard-Tabs für Posts</translation>
</message>
</context>
<context>
@ -228,7 +228,7 @@
</message>
<message>
<source>Close</source>
<translation type="unfinished"></translation>
<translation>Schließen</translation>
</message>
</context>
<context>
@ -527,18 +527,18 @@
</message>
<message>
<source>Direct Message</source>
<translation type="unfinished">Direktnachricht</translation>
<translation>Direktnachricht</translation>
</message>
<message>
<source>Close</source>
<translation type="unfinished"></translation>
<translation>Schließen</translation>
</message>
</context>
<context>
<name>Contactlist</name>
<message>
<source>Close</source>
<translation type="unfinished"></translation>
<translation>Schließen</translation>
</message>
</context>
<context>
@ -557,7 +557,7 @@
</message>
<message>
<source>Close</source>
<translation type="unfinished"></translation>
<translation>Schließen</translation>
</message>
</context>
<context>
@ -644,7 +644,7 @@
</message>
<message>
<source>Close</source>
<translation type="unfinished"></translation>
<translation>Schließen</translation>
</message>
</context>
<context>
@ -753,27 +753,27 @@
</message>
<message>
<source>Close</source>
<translation type="unfinished"></translation>
<translation>Schließen</translation>
</message>
<message>
<source>Start date</source>
<translation type="unfinished"></translation>
<translation>Veranstaltungsbeginn</translation>
</message>
<message>
<source>Start time</source>
<translation type="unfinished"></translation>
<translation>Startzeit</translation>
</message>
<message>
<source>End date</source>
<translation type="unfinished"></translation>
<translation>Veranstaltungsende</translation>
</message>
<message>
<source>End time</source>
<translation type="unfinished"></translation>
<translation>Endzeitpunkt</translation>
</message>
<message>
<source>Accept time</source>
<translation type="unfinished"></translation>
<translation>Zeitpunkt akzeptieren</translation>
</message>
</context>
<context>
@ -788,7 +788,7 @@
</message>
<message>
<source>Close</source>
<translation type="unfinished"></translation>
<translation>Schließen</translation>
</message>
</context>
<context>
@ -802,7 +802,7 @@
<name>FriendicaActivities</name>
<message>
<source>Close</source>
<translation type="unfinished"></translation>
<translation>Schließen</translation>
</message>
</context>
<context>
@ -825,7 +825,7 @@
</message>
<message>
<source>refresh</source>
<translation type="unfinished"></translation>
<translation>Aktualisieren</translation>
</message>
</context>
<context>
@ -859,18 +859,18 @@
</message>
<message>
<source>Close</source>
<translation type="unfinished"></translation>
<translation>Schließen</translation>
</message>
<message>
<source>Members</source>
<translation type="unfinished"></translation>
<translation>Mitglieder</translation>
</message>
</context>
<context>
<name>GroupsListTab</name>
<message>
<source>refresh</source>
<translation type="unfinished"></translation>
<translation>Aktualisieren</translation>
</message>
</context>
<context>
@ -909,14 +909,14 @@
</message>
<message>
<source>Close</source>
<translation type="unfinished"></translation>
<translation>Schließen</translation>
</message>
</context>
<context>
<name>InfoBox</name>
<message>
<source>Close</source>
<translation type="unfinished"></translation>
<translation>Schließen</translation>
</message>
</context>
<context>
@ -946,7 +946,7 @@
</message>
<message>
<source>Add</source>
<translation type="unfinished"></translation>
<translation>Neu</translation>
</message>
</context>
<context>
@ -983,103 +983,103 @@
</message>
<message>
<source>Answer to</source>
<translation type="unfinished"></translation>
<translation>Antwort an</translation>
</message>
<message>
<source>New message</source>
<translation type="unfinished"></translation>
<translation>Neue Nachricht</translation>
</message>
<message>
<source>Copy</source>
<translation type="unfinished"></translation>
<translation>Kopieren</translation>
</message>
<message>
<source>Cut</source>
<translation type="unfinished"></translation>
<translation>Ausschneiden</translation>
</message>
<message>
<source>Paste</source>
<translation type="unfinished"></translation>
<translation>Einfügen</translation>
</message>
<message>
<source>Text</source>
<translation type="unfinished"></translation>
<translation>Text</translation>
</message>
<message>
<source>Bold</source>
<translation type="unfinished"></translation>
<translation>Fett</translation>
</message>
<message>
<source>Format</source>
<translation type="unfinished"></translation>
<translation>Formatieren</translation>
</message>
<message>
<source>Italic</source>
<translation type="unfinished"></translation>
<translation>Kursiv</translation>
</message>
<message>
<source>Create list</source>
<translation type="unfinished"></translation>
<translation>Liste erstellen</translation>
</message>
<message>
<source>Format as code</source>
<translation type="unfinished"></translation>
<translation>Als Code formatieren</translation>
</message>
<message>
<source>Rendered</source>
<translation type="unfinished"></translation>
<translation>gerendert</translation>
</message>
<message>
<source>MD</source>
<translation type="unfinished"></translation>
<translation>MD</translation>
</message>
<message>
<source>Show Markdown code</source>
<translation type="unfinished"></translation>
<translation>Zeige Markdown Text</translation>
</message>
<message>
<source>Edit</source>
<translation type="unfinished"></translation>
<translation>Bearbeiten</translation>
</message>
<message>
<source>emojies</source>
<translation type="unfinished"></translation>
<translation>Emojis</translation>
</message>
<message>
<source>Insert smiley</source>
<translation type="unfinished"></translation>
<translation>Smiley einfügen</translation>
</message>
<message>
<source>Insert previous hashtag</source>
<translation type="unfinished"></translation>
<translation>Bestehenden Hashtag einfügen</translation>
</message>
<message>
<source>Image</source>
<translation type="unfinished">Bild</translation>
<translation>Bild</translation>
</message>
<message>
<source>Insert images</source>
<translation type="unfinished"></translation>
<translation>Bild einfügen</translation>
</message>
<message>
<source>Cancel message</source>
<translation type="unfinished"></translation>
<translation>Nachricht abbrechen</translation>
</message>
<message>
<source>Close</source>
<translation type="unfinished"></translation>
<translation>Schließen</translation>
</message>
<message>
<source>Format message</source>
<translation type="unfinished"></translation>
<translation>Nachricht Formatieren</translation>
</message>
<message>
<source>Send message</source>
<translation type="unfinished"></translation>
<translation>Nachricht senden</translation>
</message>
<message>
<source>Send</source>
<translation type="unfinished"></translation>
<translation>Senden</translation>
</message>
</context>
<context>
@ -1093,7 +1093,7 @@
<name>NewsPhotolist</name>
<message>
<source>Close</source>
<translation type="unfinished"></translation>
<translation>Schließen</translation>
</message>
</context>
<context>
@ -1108,7 +1108,7 @@
</message>
<message>
<source>Close</source>
<translation type="unfinished"></translation>
<translation>Schließen</translation>
</message>
</context>
<context>
@ -1250,7 +1250,7 @@
<name>NewsVideoLarge</name>
<message>
<source>Close</source>
<translation type="unfinished"></translation>
<translation>Schließen</translation>
</message>
</context>
<context>
@ -1349,19 +1349,19 @@
</message>
<message>
<source>Like</source>
<translation type="unfinished"></translation>
<translation>Ich mag das</translation>
</message>
<message>
<source>Dislike</source>
<translation type="unfinished"></translation>
<translation>Ich mag das nicht</translation>
</message>
<message>
<source>Favorite</source>
<translation type="unfinished"></translation>
<translation>Markieren</translation>
</message>
<message>
<source>Menu</source>
<translation type="unfinished"></translation>
<translation>Menü</translation>
</message>
</context>
<context>
@ -1376,11 +1376,11 @@
</message>
<message>
<source>save</source>
<translation type="unfinished"></translation>
<translation>Speichern</translation>
</message>
<message>
<source>apply</source>
<translation type="unfinished"></translation>
<translation>Anwenden</translation>
</message>
</context>
<context>
@ -1407,15 +1407,15 @@
</message>
<message>
<source>upload</source>
<translation type="unfinished"></translation>
<translation>Hochladen</translation>
</message>
<message>
<source>download</source>
<translation type="unfinished"></translation>
<translation>Herunterladen</translation>
</message>
<message>
<source>Close</source>
<translation type="unfinished"></translation>
<translation>Schließen</translation>
</message>
</context>
<context>
@ -1602,7 +1602,7 @@
</message>
<message>
<source>refresh</source>
<translation type="unfinished"></translation>
<translation>Aktualisieren</translation>
</message>
</context>
<context>
@ -1648,7 +1648,7 @@
</message>
<message>
<source>Close</source>
<translation type="unfinished"></translation>
<translation>Schließen</translation>
</message>
</context>
<context>
@ -1674,7 +1674,7 @@
</message>
<message>
<source>Backgound Sync</source>
<translation type="unfinished"></translation>
<translation>Hintergrund-Aktualisierung</translation>
</message>
</context>
<context>
@ -1751,7 +1751,7 @@ Rechtsklick oder Mittelklick zum Schliessen</translation>
</message>
<message>
<source>Images</source>
<translation type="unfinished"></translation>
<translation>Bilder</translation>
</message>
</context>
<context>
@ -1850,7 +1850,7 @@ Rechtsklick oder Mittelklick zum Schliessen</translation>
</message>
<message>
<source>years</source>
<translation type="unfinished">Jahre</translation>
<translation>Jahre</translation>
</message>
</context>
<context>