mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-19 14:40:09 +08:00
Merge 4586b729c6 into adef6cd4af
This commit is contained in:
commit
103e1978c1
@ -14,6 +14,14 @@ namespace NekoGui {
|
||||
_add(new configItem("groups", &groupsTabOrder, itemType::integerList));
|
||||
}
|
||||
|
||||
QList<std::shared_ptr<ProxyEntity>> ProfileManager::Profiles() const {
|
||||
QList<std::shared_ptr<ProxyEntity>> ret;
|
||||
for (const auto &[_, profile]: profiles) {
|
||||
ret += profile;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
QList<int> filterIntJsonFile(const QString &path) {
|
||||
QList<int> result;
|
||||
QDir dr(path);
|
||||
|
||||
@ -28,6 +28,8 @@ namespace NekoGui {
|
||||
|
||||
[[nodiscard]] static std::shared_ptr<Group> NewGroup();
|
||||
|
||||
QList<std::shared_ptr<ProxyEntity>> Profiles() const;
|
||||
|
||||
bool AddProfile(const std::shared_ptr<ProxyEntity> &ent, int gid = -1);
|
||||
|
||||
void DeleteProfile(int id);
|
||||
|
||||
@ -1359,11 +1359,12 @@ void MainWindow::on_menu_select_all_triggered() {
|
||||
ui->proxyListTable->selectAll();
|
||||
}
|
||||
|
||||
void MainWindow::on_menu_delete_repeat_triggered() {
|
||||
void MainWindow::on_menu_delete_repeat_triggered(bool const search_across_all_profiles) {
|
||||
QList<std::shared_ptr<NekoGui::ProxyEntity>> out;
|
||||
QList<std::shared_ptr<NekoGui::ProxyEntity>> out_del;
|
||||
|
||||
NekoGui::ProfileFilter::Uniq(NekoGui::profileManager->CurrentGroup()->Profiles(), out, true, false);
|
||||
auto const profiles = search_across_all_profiles ? NekoGui::profileManager->Profiles() : NekoGui::profileManager->CurrentGroup()->Profiles();
|
||||
NekoGui::ProfileFilter::Uniq(profiles, out, true, false);
|
||||
NekoGui::ProfileFilter::OnlyInSrc_ByPointer(NekoGui::profileManager->CurrentGroup()->Profiles(), out, out_del);
|
||||
|
||||
int remove_display_count = 0;
|
||||
@ -1385,6 +1386,10 @@ void MainWindow::on_menu_delete_repeat_triggered() {
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_menu_delete_duplicates_global_triggered() {
|
||||
return on_menu_delete_repeat_triggered(true);
|
||||
}
|
||||
|
||||
bool mw_sub_updating = false;
|
||||
|
||||
void MainWindow::on_menu_update_subscription_triggered() {
|
||||
|
||||
@ -121,7 +121,9 @@ private slots:
|
||||
|
||||
void on_menu_select_all_triggered();
|
||||
|
||||
void on_menu_delete_repeat_triggered();
|
||||
void on_menu_delete_repeat_triggered(bool const search_across_all_profiles = false);
|
||||
|
||||
void on_menu_delete_duplicates_global_triggered();
|
||||
|
||||
void on_menu_remove_unavailable_triggered();
|
||||
|
||||
|
||||
@ -555,6 +555,7 @@
|
||||
<addaction name="separator"/>
|
||||
<addaction name="menu_remove_unavailable"/>
|
||||
<addaction name="menu_delete_repeat"/>
|
||||
<addaction name="menu_delete_duplicates_global"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="menu_update_subscription"/>
|
||||
</widget>
|
||||
@ -742,6 +743,14 @@
|
||||
<string notr="true">Ctrl+Alt+D</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="menu_delete_duplicates_global">
|
||||
<property name="text">
|
||||
<string>Remove Duplicates Across All Groups</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string notr="true"></string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionfake">
|
||||
<property name="text">
|
||||
<string>fake</string>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user