Projects
Eulaceura:Mainline:GA
kiran-menu
_service:obs_scm:0002-fix-recent-files-list-box...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0002-fix-recent-files-list-box-Fixed-an-issue-where-recen.patch of Package kiran-menu
From 43d27f12fff46595631802ea65b400df4ce44cd8 Mon Sep 17 00:00:00 2001 From: yangfeng <yangfeng@kylinsec.com.cn> Date: Wed, 27 Dec 2023 14:41:52 +0800 Subject: [PATCH 2/5] fix(recent-files-list-box):Fixed an issue where recent documents were not sorted MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复最近文档列表没有排序的问题 Related #24803 --- src/menu/recent-files-list-box.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/menu/recent-files-list-box.cpp b/src/menu/recent-files-list-box.cpp index 3ae481e..5226123 100644 --- a/src/menu/recent-files-list-box.cpp +++ b/src/menu/recent-files-list-box.cpp @@ -17,6 +17,7 @@ #include "kiran-helper.h" #include "kiran-opacity-menu.h" #include "lib/base.h" +#include <algorithm> RecentFilesListBox::RecentFilesListBox() : filter_pattern("*") { @@ -50,7 +51,11 @@ void RecentFilesListBox::load() delete row; } - for (auto info : Gtk::RecentManager::get_default()->get_items()) + std::vector<Glib::RefPtr<Gtk::RecentInfo>> items = Gtk::RecentManager::get_default()->get_items(); + std::sort(items.begin(), items.end(), [](Glib::RefPtr<Gtk::RecentInfo> a, Glib::RefPtr<Gtk::RecentInfo> b) + { return a->get_modified() > b->get_modified(); }); + + for (auto info : items) { Gtk::ListBoxRow *row = nullptr; auto cell = create_recent_item(info); -- 2.27.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2