forked from MatsuriDayo/nekoray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGroupUpdater.hpp
34 lines (22 loc) · 929 Bytes
/
GroupUpdater.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#include "db/Database.hpp"
namespace NekoGui_sub {
class RawUpdater {
public:
void updateClash(const QString &str);
void update(const QString &str);
int gid_add_to = -1; // 导入到指定组 -1 为当前选中组
QList<std::shared_ptr<NekoGui::ProxyEntity>> updated_order; // 新增的配置,按照导入时处理的先后排序
};
class GroupUpdater : public QObject {
Q_OBJECT
public:
void AsyncUpdate(const QString &str, int _sub_gid = -1, const std::function<void()> &finish = nullptr);
void Update(const QString &_str, int _sub_gid = -1, bool _not_sub_as_url = false);
signals:
void asyncUpdateCallback(int gid);
};
extern GroupUpdater *groupUpdater;
} // namespace NekoGui_sub
// 更新所有订阅 关闭分组窗口时 更新动作继续执行
void UI_update_all_groups(bool onlyAllowed = false);