D10862: Konsole: Add read-only mode

Kurt Hindenburg noreply at phabricator.kde.org
Sun Mar 4 15:50:47 UTC 2018


hindenburg added a comment.


  Thanks, overall I don't see any major issues.
  
  There are some issues below which I don't think should hold up committing this.  Perhaps later you could work on them if you're interested.
  
  1. dbus methods still work on locked tabs: example qdbus $KONSOLE_DBUS_SERVICE /Sessions/3 sendText hi
  2. Certain menus should be disabled on locked tabs: (right click menu) Switch Profile, * Scrollback, Rename(?). Split View..... and more...

INLINE COMMENTS

> SessionController.cpp:461
> +    QAction *action = qobject_cast<QAction*>(sender());
> +    if (action) {
> +        bool readonly = !isReadOnly();

In general we want to compare against nullptr

> ViewContainer.cpp:307
> +    connect(_contextPopupMenu, &QMenu::aboutToHide, this, [this]() {
> +        // Remove the read-only action when the popup closes
> +        for (auto &action : _contextPopupMenu->actions()) {

Why remove this action when the menu closes?

> ViewContainer.cpp:634
> +    SessionController *sessionController = qobject_cast<SessionController*>(viewProperties(views()[_contextMenuTabIndex]));
> +    if (sessionController) {
> +        auto collection = sessionController->actionCollection();

nullptr

> ViewContainer.cpp:637
> +        auto readonlyAction = collection->action(QStringLiteral("view-readonly"));
> +        if (readonlyAction) {
> +            _contextPopupMenu->insertAction(_contextPopupMenu->actions().last(), readonlyAction);

nullptr

REPOSITORY
  R319 Konsole

REVISION DETAIL
  https://phabricator.kde.org/D10862

To: jnoack, #konsole, hindenburg
Cc: hindenburg, ngraham, #konsole
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/konsole-devel/attachments/20180304/c1e19fdc/attachment-0001.html>


More information about the konsole-devel mailing list