some refactoring and disable appimage again, i have no patience for that, just use native packages and flatpak
This commit is contained in:
parent
25f35227e4
commit
2e8108aaf5
13 changed files with 83 additions and 116 deletions
|
@ -86,31 +86,31 @@ if [ $is_linux = true ]; then
|
|||
echo 'Validating AppStream metadata...'
|
||||
appstreamcli validate "$prefix/share/metainfo/$app_id.metainfo.xml"
|
||||
|
||||
## Obtain appimagetool.
|
||||
appimagetool_file=$(wget -q https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous -O - | grep "appimagetool-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2)
|
||||
wget -c "https://github.com/$appimagetool_file"
|
||||
chmod +x appimagetool-*.AppImage
|
||||
mv appimagetool-*.AppImage appimagetool.AppImage
|
||||
# ## Obtain appimagetool.
|
||||
# appimagetool_file=$(wget -q https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous -O - | grep "appimagetool-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2)
|
||||
# wget -c "https://github.com/$appimagetool_file"
|
||||
# chmod +x appimagetool-*.AppImage
|
||||
# mv appimagetool-*.AppImage appimagetool.AppImage
|
||||
|
||||
export VERSION=1.0
|
||||
# export VERSION=1.0
|
||||
|
||||
GH_TKN=$GITHUB_TOKEN
|
||||
unset GITHUB_TOKEN
|
||||
# GH_TKN=$GITHUB_TOKEN
|
||||
# unset GITHUB_TOKEN
|
||||
|
||||
./appimagetool.AppImage -s deploy AppDir/usr/share/applications/*.desktop
|
||||
./appimagetool.AppImage ./AppDir
|
||||
# ./appimagetool.AppImage -s deploy AppDir/usr/share/applications/*.desktop
|
||||
# ./appimagetool.AppImage ./AppDir
|
||||
|
||||
export GITHUB_TOKEN=$GH_TKN
|
||||
# export GITHUB_TOKEN=$GH_TKN
|
||||
|
||||
## Rename AppImaage.
|
||||
set -- R*.AppImage
|
||||
imagename="$1"
|
||||
# ## Rename AppImaage.
|
||||
# set -- R*.AppImage
|
||||
# imagename="$1"
|
||||
|
||||
if [[ "$webengine" == "ON" ]]; then
|
||||
imagenewname="rssguard-${git_tag}-${git_revision}-linux64.AppImage"
|
||||
else
|
||||
imagenewname="rssguard-${git_tag}-${git_revision}-lite-linux64.AppImage"
|
||||
fi
|
||||
# if [[ "$webengine" == "ON" ]]; then
|
||||
# imagenewname="rssguard-${git_tag}-${git_revision}-linux64.AppImage"
|
||||
# else
|
||||
# imagenewname="rssguard-${git_tag}-${git_revision}-lite-linux64.AppImage"
|
||||
# fi
|
||||
else
|
||||
# Fix .dylib linking.
|
||||
otool -L "$prefix/Contents/MacOS/rssguard"
|
||||
|
|
|
@ -356,7 +356,7 @@ void FormStandardImportExport::importFeeds() {
|
|||
RootItem* parent = m_ui->m_cmbRootNode->currentData().value<RootItem*>();
|
||||
|
||||
if (m_serviceRoot->mergeImportExportModel(m_model, parent, output_message)) {
|
||||
m_serviceRoot->requestItemExpand(parent->getSubTree(), true);
|
||||
m_serviceRoot->requestItemExpand(parent->getSubTree<RootItem>(), true);
|
||||
m_ui->m_lblResult->setStatus(WidgetWithStatus::StatusType::Ok, output_message, output_message);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -98,7 +98,7 @@ void StandardServiceRoot::start(bool freshly_activated) {
|
|||
model.checkAllItems();
|
||||
|
||||
if (mergeImportExportModel(&model, this, output_msg)) {
|
||||
requestItemExpand(getSubTree(), true);
|
||||
requestItemExpand(getSubTree<RootItem>(), true);
|
||||
}
|
||||
}
|
||||
catch (ApplicationException& ex) {
|
||||
|
|
|
@ -52,7 +52,7 @@ QMap<int, QString> DatabaseQueries::messageTableAttributes(bool only_msg_table,
|
|||
|
||||
field_names[MSG_DB_LABELS_IDS] = QSL("Messages.labels");
|
||||
|
||||
// TODO: zpomaluje zobrazení seznamu zpráv
|
||||
// TODO: zpomaluje zobrazenà seznamu zpráv
|
||||
/*
|
||||
field_names[MSG_DB_LABELS] =
|
||||
QSL("(SELECT GROUP_CONCAT(Labels.name) FROM Labels WHERE Labels.custom_id IN (SELECT "
|
||||
|
@ -2295,7 +2295,7 @@ bool DatabaseQueries::purgeLeftoverMessages(const QSqlDatabase& db, int account_
|
|||
|
||||
void DatabaseQueries::storeAccountTree(const QSqlDatabase& db, RootItem* tree_root, int account_id) {
|
||||
// Iterate all children.
|
||||
auto str = tree_root->getSubTree();
|
||||
auto str = tree_root->getSubTree<RootItem>();
|
||||
|
||||
for (RootItem* child : std::as_const(str)) {
|
||||
if (child->kind() == RootItem::Kind::Category) {
|
||||
|
|
|
@ -75,7 +75,7 @@ QString Category::additionalTooltip() const {
|
|||
"Number of disabled feeds: %3")
|
||||
.arg(QString::number(getSubTreeFeeds().size()),
|
||||
QString::number(getSubTreeCategories().size() - 1),
|
||||
QString::number(getSubTree([](const RootItem* ri) {
|
||||
QString::number(getSubTree<RootItem>([](const RootItem* ri) {
|
||||
return ri->kind() == RootItem::Kind::Feed && ri->toFeed()->isSwitchedOff();
|
||||
}).size()));
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ bool ImportantNode::cleanMessages(bool clean_read_only) {
|
|||
|
||||
if (DatabaseQueries::cleanImportantMessages(database, clean_read_only, service->accountId())) {
|
||||
service->updateCounts(true);
|
||||
service->itemChanged(service->getSubTree());
|
||||
service->itemChanged(service->getSubTree<RootItem>());
|
||||
service->requestReloadMessageList(true);
|
||||
return true;
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ bool ImportantNode::markAsReadUnread(RootItem::ReadStatus status) {
|
|||
|
||||
if (DatabaseQueries::markImportantMessagesReadUnread(database, service->accountId(), status)) {
|
||||
service->updateCounts(false);
|
||||
service->itemChanged(service->getSubTree());
|
||||
service->itemChanged(service->getSubTree<RootItem>());
|
||||
service->requestReloadMessageList(status == RootItem::ReadStatus::Read);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ bool Label::cleanMessages(bool clear_only_read) {
|
|||
|
||||
if (DatabaseQueries::cleanLabelledMessages(database, clear_only_read, this)) {
|
||||
service->updateCounts(true);
|
||||
service->itemChanged(service->getSubTree());
|
||||
service->itemChanged(service->getSubTree<RootItem>());
|
||||
service->requestReloadMessageList(true);
|
||||
return true;
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ bool Label::markAsReadUnread(RootItem::ReadStatus status) {
|
|||
|
||||
if (DatabaseQueries::markLabelledMessagesReadUnread(database, this, status)) {
|
||||
service->updateCounts(false);
|
||||
service->itemChanged(service->getSubTree());
|
||||
service->itemChanged(service->getSubTree<RootItem>());
|
||||
service->requestReloadMessageList(status == RootItem::ReadStatus::Read);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ bool RecycleBin::restore() {
|
|||
|
||||
if (DatabaseQueries::restoreBin(database, parent_root->accountId())) {
|
||||
parent_root->updateCounts(true);
|
||||
parent_root->itemChanged(parent_root->getSubTree());
|
||||
parent_root->itemChanged(parent_root->getSubTree<RootItem>());
|
||||
parent_root->requestReloadMessageList(true);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -268,81 +268,16 @@ bool RootItem::isParentOf(const RootItem* child) const {
|
|||
}
|
||||
}
|
||||
|
||||
QList<RootItem*> RootItem::getSubTree() const {
|
||||
QList<RootItem*> children;
|
||||
QList<RootItem*> traversable_items;
|
||||
|
||||
traversable_items.append(const_cast<RootItem* const>(this));
|
||||
|
||||
// Iterate all nested items.
|
||||
while (!traversable_items.isEmpty()) {
|
||||
RootItem* active_item = traversable_items.takeFirst();
|
||||
|
||||
children.append(active_item);
|
||||
traversable_items.append(active_item->childItems());
|
||||
}
|
||||
|
||||
return children;
|
||||
}
|
||||
|
||||
QList<RootItem*> RootItem::getSubTree(std::function<bool(const RootItem*)> tester) const {
|
||||
QList<RootItem*> children;
|
||||
QList<RootItem*> traversable_items;
|
||||
|
||||
traversable_items.append(const_cast<RootItem* const>(this));
|
||||
|
||||
// Iterate all nested items.
|
||||
while (!traversable_items.isEmpty()) {
|
||||
RootItem* active_item = traversable_items.takeFirst();
|
||||
|
||||
if (tester(active_item)) {
|
||||
children.append(active_item);
|
||||
}
|
||||
|
||||
traversable_items.append(active_item->childItems());
|
||||
}
|
||||
|
||||
return children;
|
||||
}
|
||||
|
||||
QList<RootItem*> RootItem::getSubTree(RootItem::Kind kind_of_item) const {
|
||||
QList<RootItem*> children;
|
||||
QList<RootItem*> traversable_items;
|
||||
|
||||
traversable_items.append(const_cast<RootItem* const>(this));
|
||||
|
||||
// Iterate all nested items.
|
||||
while (!traversable_items.isEmpty()) {
|
||||
RootItem* active_item = traversable_items.takeFirst();
|
||||
|
||||
if (int(active_item->kind() & kind_of_item) > 0) {
|
||||
children.append(active_item);
|
||||
}
|
||||
|
||||
traversable_items.append(active_item->childItems());
|
||||
}
|
||||
|
||||
return children;
|
||||
return getSubTree<RootItem>([kind_of_item](const RootItem* ri) {
|
||||
return int(ri->kind() & kind_of_item) > 0;
|
||||
});
|
||||
}
|
||||
|
||||
QList<Category*> RootItem::getSubTreeCategories() const {
|
||||
QList<Category*> children;
|
||||
QList<RootItem*> traversable_items;
|
||||
|
||||
traversable_items.append(const_cast<RootItem* const>(this));
|
||||
|
||||
// Iterate all nested items.
|
||||
while (!traversable_items.isEmpty()) {
|
||||
RootItem* active_item = traversable_items.takeFirst();
|
||||
|
||||
if (active_item->kind() == RootItem::Kind::Category) {
|
||||
children.append(active_item->toCategory());
|
||||
}
|
||||
|
||||
traversable_items.append(active_item->childItems());
|
||||
}
|
||||
|
||||
return children;
|
||||
return getSubTree<Category>([](const RootItem* ri) {
|
||||
return ri->kind() == RootItem::Kind::Category;
|
||||
});
|
||||
}
|
||||
|
||||
RootItem* RootItem::getItemFromSubTree(std::function<bool(const RootItem*)> tester) const {
|
||||
|
|
|
@ -143,8 +143,9 @@ class RSSGUARD_DLLSPEC RootItem : public QObject {
|
|||
|
||||
// Returns flat list of all items from subtree where this item is a root.
|
||||
// Returned list includes this item too.
|
||||
QList<RootItem*> getSubTree() const;
|
||||
QList<RootItem*> getSubTree(std::function<bool(const RootItem*)> tester) const;
|
||||
template <typename T>
|
||||
QList<T*> getSubTree(std::function<bool(const RootItem*)> tester = nullptr) const;
|
||||
|
||||
QList<RootItem*> getSubTree(RootItem::Kind kind_of_item) const;
|
||||
QList<Category*> getSubTreeCategories() const;
|
||||
|
||||
|
@ -240,6 +241,32 @@ class RSSGUARD_DLLSPEC RootItem : public QObject {
|
|||
RootItem* m_parentItem;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
QList<T*> RootItem::getSubTree(std::function<bool(const RootItem*)> tester) const {
|
||||
QList<T*> children;
|
||||
QList<RootItem*> traversable_items;
|
||||
|
||||
traversable_items.append(const_cast<RootItem* const>(this));
|
||||
|
||||
// Iterate all nested items.
|
||||
while (!traversable_items.isEmpty()) {
|
||||
RootItem* active_item = traversable_items.takeFirst();
|
||||
|
||||
if (tester) {
|
||||
if (tester(active_item)) {
|
||||
children.append(dynamic_cast<T*>(active_item));
|
||||
}
|
||||
}
|
||||
else {
|
||||
children.append(dynamic_cast<T*>(active_item));
|
||||
}
|
||||
|
||||
traversable_items.append(active_item->childItems());
|
||||
}
|
||||
|
||||
return children;
|
||||
}
|
||||
|
||||
inline RootItem* RootItem::parent() const {
|
||||
return m_parentItem;
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ bool Search::cleanMessages(bool clear_only_read) {
|
|||
try {
|
||||
DatabaseQueries::cleanProbedMessages(database, clear_only_read, this);
|
||||
service->updateCounts(true);
|
||||
service->itemChanged(service->getSubTree());
|
||||
service->itemChanged(service->getSubTree<RootItem>());
|
||||
service->requestReloadMessageList(true);
|
||||
return true;
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ bool Search::markAsReadUnread(RootItem::ReadStatus status) {
|
|||
try {
|
||||
DatabaseQueries::markProbeReadUnread(database, this, status);
|
||||
service->updateCounts(false);
|
||||
service->itemChanged(service->getSubTree());
|
||||
service->itemChanged(service->getSubTree<RootItem>());
|
||||
service->requestReloadMessageList(status == RootItem::ReadStatus::Read);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ bool ServiceRoot::markAsReadUnread(RootItem::ReadStatus status) {
|
|||
|
||||
if (DatabaseQueries::markAccountReadUnread(database, accountId(), status)) {
|
||||
updateCounts(false);
|
||||
itemChanged(getSubTree());
|
||||
itemChanged(getSubTree<RootItem>());
|
||||
requestReloadMessageList(status == RootItem::ReadStatus::Read);
|
||||
return true;
|
||||
}
|
||||
|
@ -229,7 +229,7 @@ CustomMessagePreviewer* ServiceRoot::customMessagePreviewer() {
|
|||
|
||||
void ServiceRoot::updateCounts(bool including_total_count) {
|
||||
QList<Feed*> feeds;
|
||||
auto str = getSubTree();
|
||||
auto str = getSubTree<RootItem>();
|
||||
|
||||
for (RootItem* child : std::as_const(str)) {
|
||||
if (child->kind() == RootItem::Kind::Feed) {
|
||||
|
@ -350,7 +350,7 @@ bool ServiceRoot::cleanFeeds(const QList<Feed*>& items, bool clean_read_only) {
|
|||
|
||||
if (DatabaseQueries::cleanFeeds(database, textualFeedIds(items), clean_read_only, accountId())) {
|
||||
getParentServiceRoot()->updateCounts(true);
|
||||
getParentServiceRoot()->itemChanged(getParentServiceRoot()->getSubTree());
|
||||
getParentServiceRoot()->itemChanged(getParentServiceRoot()->getSubTree<RootItem>());
|
||||
getParentServiceRoot()->requestReloadMessageList(true);
|
||||
return true;
|
||||
}
|
||||
|
@ -391,8 +391,13 @@ ServiceRoot::LabelOperation ServiceRoot::supportedLabelOperations() const {
|
|||
|
||||
QString ServiceRoot::additionalTooltip() const {
|
||||
return tr("Number of feeds: %1\n"
|
||||
"Number of categories: %2")
|
||||
.arg(QString::number(getSubTreeFeeds().size()), QString::number(getSubTreeCategories().size()));
|
||||
"Number of categories: %2\n"
|
||||
"Number of disabled feeds: %3")
|
||||
.arg(QString::number(getSubTreeFeeds().size()),
|
||||
QString::number(getSubTreeCategories().size()),
|
||||
QString::number(getSubTree<RootItem>([](const RootItem* ri) {
|
||||
return ri->kind() == RootItem::Kind::Feed && ri->toFeed()->isSwitchedOff();
|
||||
}).size()));
|
||||
}
|
||||
|
||||
void ServiceRoot::saveAccountDataToDatabase() {
|
||||
|
@ -720,8 +725,8 @@ void ServiceRoot::syncIn() {
|
|||
}
|
||||
|
||||
setIcon(original_icon);
|
||||
itemChanged(getSubTree());
|
||||
requestItemExpand(getSubTree(), true);
|
||||
itemChanged(getSubTree<RootItem>());
|
||||
requestItemExpand(getSubTree<RootItem>(), true);
|
||||
}
|
||||
|
||||
void ServiceRoot::performInitialAssembly(const Assignment& categories,
|
||||
|
@ -824,7 +829,7 @@ bool ServiceRoot::markFeedsReadUnread(const QList<Feed*>& items, RootItem::ReadS
|
|||
|
||||
if (DatabaseQueries::markFeedsReadUnread(database, textualFeedIds(items), accountId(), read)) {
|
||||
getParentServiceRoot()->updateCounts(false);
|
||||
getParentServiceRoot()->itemChanged(getParentServiceRoot()->getSubTree());
|
||||
getParentServiceRoot()->itemChanged(getParentServiceRoot()->getSubTree<RootItem>());
|
||||
getParentServiceRoot()->requestReloadMessageList(read == RootItem::ReadStatus::Read);
|
||||
return true;
|
||||
}
|
||||
|
@ -1130,7 +1135,7 @@ bool ServiceRoot::onAfterMessagesDelete(RootItem* selected_item, const QList<Mes
|
|||
// - labels assigned to articles (if recycle bin is NOT selected)
|
||||
|
||||
updateCounts(true);
|
||||
itemChanged(getSubTree());
|
||||
itemChanged(getSubTree<RootItem>());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1180,7 +1185,7 @@ bool ServiceRoot::onAfterMessagesRestoredFromBin(RootItem* selected_item, const
|
|||
Q_UNUSED(messages)
|
||||
|
||||
updateCounts(true);
|
||||
itemChanged(getSubTree());
|
||||
itemChanged(getSubTree<RootItem>());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ bool UnreadNode::cleanMessages(bool clean_read_only) {
|
|||
|
||||
if (DatabaseQueries::cleanUnreadMessages(database, service->accountId())) {
|
||||
service->updateCounts(true);
|
||||
service->itemChanged(service->getSubTree());
|
||||
service->itemChanged(service->getSubTree<RootItem>());
|
||||
service->requestReloadMessageList(true);
|
||||
return true;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ bool UnreadNode::markAsReadUnread(RootItem::ReadStatus status) {
|
|||
|
||||
if (DatabaseQueries::markUnreadMessagesRead(database, service->accountId())) {
|
||||
service->updateCounts(false);
|
||||
service->itemChanged(service->getSubTree());
|
||||
service->itemChanged(service->getSubTree<RootItem>());
|
||||
service->requestReloadMessageList(status == RootItem::ReadStatus::Read);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue