D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-08-17 Thread Nicolas Fella
nicolasfella closed this revision. REVISION DETAIL https://phabricator.kde.org/D26448 To: nicolasfella, #frameworks, dfaure Cc: broulik, elvisangelaccio, cfeck, kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-08-13 Thread David Faure
dfaure accepted this revision. dfaure added a comment. Thanks :-) BRANCH recentfilemenu REVISION DETAIL https://phabricator.kde.org/D26448 To: nicolasfella, #frameworks, dfaure Cc: broulik, elvisangelaccio, cfeck, kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-08-13 Thread Nicolas Fella
nicolasfella updated this revision to Diff 83348. nicolasfella added a comment. - Use menus font metric CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D26448?vs=83346=83348 BRANCH recentfilemenu REVISION DETAIL https://phabricator.kde.org/D26448 AFFECTED FILES

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-08-13 Thread David Faure
dfaure added inline comments. INLINE COMMENTS > krecentfilesmenu.cpp:74 > +{ > +action = new QAction(titleWithSensibleWidth(qobject_cast *>(menu->parent(; > +QObject::connect(action, ::triggered, action, [this, menu]() > { QMenu is a QWidget. Why not just pass `menu` as

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-08-11 Thread Nicolas Fella
nicolasfella updated this revision to Diff 83346. nicolasfella added a comment. - Use widgets font metrics CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D26448?vs=83338=83346 BRANCH recentfilemenu REVISION DETAIL https://phabricator.kde.org/D26448 AFFECTED FILES

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-08-08 Thread David Faure
dfaure accepted this revision. dfaure added a comment. This revision is now accepted and ready to land. A unittest would be useful too, especially if we then refactor the loading to use KIO jobs. But after 6 months, let's land this and keep working on it. Are you interested in writing

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-08-03 Thread Nicolas Fella
nicolasfella marked an inline comment as done. nicolasfella added inline comments. INLINE COMMENTS > dfaure wrote in krecentfilesmenu.cpp:150 > Depending on QtConcurrent is just fine. However QtConcurrent::filtered is for > CPU-intensive operations, not for I/O operations. 1) you don't want to

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-08-03 Thread Nicolas Fella
nicolasfella updated this revision to Diff 83338. nicolasfella marked an inline comment as done. nicolasfella added a comment. - Fix @since - Add underscore to filename - Reserve vector CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D26448?vs=83337=83338 BRANCH recentfilemenu

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-08-03 Thread Nicolas Fella
nicolasfella marked 6 inline comments as done. REVISION DETAIL https://phabricator.kde.org/D26448 To: nicolasfella, #frameworks, dfaure Cc: broulik, elvisangelaccio, cfeck, kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-08-03 Thread Nicolas Fella
nicolasfella updated this revision to Diff 83337. nicolasfella marked an inline comment as done. nicolasfella added a comment. - Make findEntry return non-const iterator - Use std::vector - Truncate entries when setting maximum CHANGES SINCE LAST UPDATE

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-08-02 Thread David Faure
dfaure added inline comments. INLINE COMMENTS > nicolasfella wrote in krecentfilesmenu.cpp:150 > I'm wondering how to best make this async without selling my soul to the > mulitthreading devil. QtConcurrent::filtered looks interesting, but depending > on QtConcurrent wouldn't be feasible,

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-07-28 Thread Nicolas Fella
nicolasfella added inline comments. INLINE COMMENTS > broulik wrote in krecentfilesmenu.cpp:150 > If we're rewriting this thing anyway, can we please make sure it does not > block application startup checking if those files exist, as can happen if you > had opened files on an NFS mount before.

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-01-11 Thread David Faure
dfaure requested changes to this revision. dfaure added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > krecentfilesmenu.cpp:99 > +setIcon(QIcon::fromTheme(QStringLiteral("document-open-recent"))); > +const QString fileName = >

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-01-09 Thread Nicolas Fella
nicolasfella marked an inline comment as not done. REPOSITORY R236 KWidgetsAddons REVISION DETAIL https://phabricator.kde.org/D26448 To: nicolasfella, #frameworks, dfaure Cc: broulik, elvisangelaccio, cfeck, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-01-09 Thread Nicolas Fella
nicolasfella updated this revision to Diff 73172. nicolasfella marked 6 inline comments as done. nicolasfella added a comment. - More comments REPOSITORY R236 KWidgetsAddons CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D26448?vs=73170=73172 BRANCH recentfilemenu REVISION

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-01-09 Thread Nicolas Fella
nicolasfella updated this revision to Diff 73170. nicolasfella marked 4 inline comments as done. nicolasfella added a comment. - Address comments REPOSITORY R236 KWidgetsAddons CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D26448?vs=72928=73170 BRANCH recentfilemenu REVISION

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-01-07 Thread Nicolas Fella
nicolasfella added inline comments. INLINE COMMENTS > dfaure wrote in krecentfilesmenu.cpp:85 > Why not std::vector? > > std::list is a linked list, so this smells like pointers to nodes containing > pointers, lots of indirection. New entries are pushed to the front, which works in constant

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-01-07 Thread Kai Uwe Broulik
broulik added inline comments. INLINE COMMENTS > krecentfilesmenu.cpp:150 > +// Don't restore if file doesn't exist anymore > +if (url.isLocalFile() && !QFile::exists(url.toLocalFile())) { > +continue; If we're rewriting this thing anyway, can we please make sure it

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-01-06 Thread David Faure
dfaure requested changes to this revision. dfaure added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > krecentfilesmenu.cpp:33 > + > +QString titleWithSensibleWidth() > +{ ... const? > krecentfilesmenu.cpp:85 > +QString m_group =

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-01-06 Thread Nicolas Fella
nicolasfella added inline comments. INLINE COMMENTS > cfeck wrote in krecentfilesmenu.h:104 > Weren't there ABI issues with std::list? > > Also, missing reference on url. We use std::list in other frameworks and IIRC no one complained REPOSITORY R236 KWidgetsAddons REVISION DETAIL

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-01-06 Thread Nicolas Fella
nicolasfella marked 8 inline comments as done. REPOSITORY R236 KWidgetsAddons REVISION DETAIL https://phabricator.kde.org/D26448 To: nicolasfella, #frameworks, dfaure Cc: elvisangelaccio, cfeck, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-01-06 Thread Nicolas Fella
nicolasfella marked 8 inline comments as not done. nicolasfella added inline comments. INLINE COMMENTS > elvisangelaccio wrote in krecentfilesmenu.cpp:31 > Why not `int` since it's what we expose in the API anyway? I'm getting a warning about signed/unsigned compare otherwise REPOSITORY R236

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-01-06 Thread Nicolas Fella
nicolasfella updated this revision to Diff 72928. nicolasfella marked 8 inline comments as done. nicolasfella added a comment. - Rework internals to do fewer allocations and file IO REPOSITORY R236 KWidgetsAddons CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D26448?vs=72844=72928

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-01-06 Thread Elvis Angelaccio
elvisangelaccio added inline comments. INLINE COMMENTS > krecentfilesmenu.cpp:31 > +QSettings *m_settings; > +size_t m_maximumItems = 10; > +}; Why not `int` since it's what we expose in the API anyway? > krecentfilesmenu.cpp:53 > +

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-01-05 Thread Christoph Feck
cfeck added a comment. Nice :) INLINE COMMENTS > krecentfilesmenu.cpp:34 > + > +KRecentFilesMenu::KRecentFilesMenu(const QString& title, QWidget* parent) > +: QMenu(title, parent) Here you switch from `Type *var` to `Type* var` > krecentfilesmenu.cpp:41 > + >

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-01-05 Thread Nicolas Fella
nicolasfella updated this revision to Diff 72844. nicolasfella added a comment. - Docs REPOSITORY R236 KWidgetsAddons CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D26448?vs=72842=72844 BRANCH recentfilemenu REVISION DETAIL https://phabricator.kde.org/D26448 AFFECTED FILES

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-01-05 Thread Nicolas Fella
nicolasfella edited the test plan for this revision. REPOSITORY R236 KWidgetsAddons REVISION DETAIL https://phabricator.kde.org/D26448 To: nicolasfella, #frameworks, dfaure Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns

D26448: Add KRecentFilesMenu to replace KRecentFileAction

2020-01-05 Thread Nicolas Fella
nicolasfella created this revision. nicolasfella added reviewers: Frameworks, dfaure. Herald added a project: Frameworks. Herald added a subscriber: kde-frameworks-devel. nicolasfella requested review of this revision. REVISION SUMMARY The way KRecentFilesAction is used has a number of