Git commit 448b15d58b9fdd5617846821a9ba58ce093b54b9 by Nate Graham, on behalf 
of Tomáš Hnyk.
Committed on 09/09/2026 at 18:24.
Pushed by ngraham into branch 'master'.

Klipper: Move and clarify what the default action does

"Include MIME actions" was very cryptic and misplaced. Now it plainly
says what it does (acts on URLs and files) and is placed in the Actions
Configuration page, as it is an action.

A sentence on the page that was almost verbatim copy of a sentence in
the "Add action..." dialog was removed.

And the option to trimp whitespace was renamed to shorter version so
that it does not mention selection and browsers being confused by
whitespace, which they are not.

The docs were also made up to date with how the feature actually works.

BUG: 473882

M  +36   -40   doc/klipper/index.docbook
M  +13   -21   klipper/configdialog.cpp
M  +1    -1    klipper/configdialog.h
M  +4    -4    klipper/klipper.kcfg

https://invent.kde.org/plasma/plasma-workspace/-/commit/448b15d58b9fdd5617846821a9ba58ce093b54b9

diff --git a/doc/klipper/index.docbook b/doc/klipper/index.docbook
index 37b6cc8dd3..f84777f8cb 100644
--- a/doc/klipper/index.docbook
+++ b/doc/klipper/index.docbook
@@ -96,28 +96,27 @@ the search field.
 <title>Actions</title>
 
 <para>&klipper; can perform actions on the contents of the clipboard,
-based on whether they match a particular regular expression. For
-example, any clipboard contents starting with <quote>http://</quote> can
-be passed to Firefox or &konqueror; as &URL;s to open. In addition, if the
-contents matches a path, similar actions can be performed according to the 
file's
-type. &eg;, if the path to a <acronym>PDF</acronym> file is copied to the 
clipboard, the file can be
-viewed in &okular;.</para>
-
-<para>To use this feature, just select a &URL; or path. <!-- starting with 
slash ?-->
-If there is a matching regular expression in &klipper;'s
-list, a menu will appear showing you the programs for your selection.
-Use the mouse or cursor keys to select a program, and &klipper; will run
-this program, opening the address pointed to by the
-selection.</para>
-
-<para>You can change the time that the menu remains for in the settings dialog,
-with the option <guilabel>Show action popup menu</guilabel> under the
-<guilabel>General</guilabel> page. You can separately disable the  file path
-part using the option <guilabel>Include MIME actions</guilabel> under the
-<guilabel>Action Menu</guilabel> page.</para>
-
-<para>Actions can be disabled completely by pressing
-the shortcut <keycombo 
action="simul">&Ctrl;&Alt;<keycap>X</keycap></keycombo>.</para>
+based on whether they match a particular regular expression. There is a 
built-in action
+that acts on web addresses and files. It allows you to pass a web address that 
starts with
+<quote>http://</quote> or <quote>https://</quote> to a web browser, or a file, 
for example a
+<acronym>PDF</acronym>, to a compatible application like &okular;.</para>
+
+<para>
+You can write your own actions in the <guilabel>Actions 
Configuration</guilabel>
+page of the <link linkend="preferences">settings dialog</link>,
+where you can also disable the built-in action with
+<guilabel>Offer applications for copied links and files</guilabel>.
+</para>
+
+<para>You can always access the matching action menu
+with a button next to the item in your history. You can also choose
+to have an action menu pop up any time
+a match is placed on the clipboard by using the
+<guilabel>Automatic Action Popup Menu</guilabel> shortcut that you can set up
+on the <guilabel>Shortcuts</guilabel> page, or by checking
+<guilabel>Immediately on selection</guilabel> under <guilabel>Show action popup
+menu</guilabel> on the <guilabel>Action Menu</guilabel> page. There, with the 
option <guilabel>Automatic action menu time</guilabel>, you can also change how 
long it takes the automatic
+menu to close on its own if you do not act up on it.</para>
 
 <para>Clipboard contents which match a regular expression can also be
 edited before performing an action on them. Select <guimenuitem>Edit
@@ -218,14 +217,7 @@ Screenshots saved by &spectacle; will also be saved when 
configured so there.
 <variablelist>
 
 <varlistentry>
-<term><guilabel>Show action popup menu</guilabel></term>
-<listitem><para>Set the time that a popup menu will remain for if you do
-nothing with it.</para></listitem>
-</varlistentry>
-
-<varlistentry>
-<term><guilabel>Replay actions on an item selected from
-history</guilabel></term>
+<term><guilabel>For an item chosen from history</guilabel></term>
 <listitem><para>If this is switched on, selecting an item from the history
 causes &klipper; to display the actions pop-up on that item, if
 appropriate.</para>
@@ -233,19 +225,15 @@ appropriate.</para>
 </varlistentry>
 
 <varlistentry>
-<term><guilabel>Remove white space when executing actions</guilabel></term>
-<listitem><para>If selected, any white space (spaces, tabs, &etc;) at the
-beginning and end of the clipboard contents will be removed before passing the
-clipboard contents to an application. This is useful, for example, if the
-clipboard contains a &URL; with spaces which, if opened by a web browser, would
-cause an error.</para>
-</listitem>
+<term><guilabel>Automatic action menu time</guilabel></term>
+<listitem><para>Set how long it takes the automatic menu to close on its own 
if you do not act up on it.</para></listitem>
 </varlistentry>
 
 <varlistentry>
-<term><guilabel>Include MIME actions</guilabel></term>
-<listitem><para>If selected, include applications that can accept its
-&MIME; type of a file name or URL selected in the popup menu.</para>
+<term><guilabel> Trim whitespace</guilabel></term>
+<listitem><para>If selected, any white space (spaces, tabs, &etc;) at the
+beginning and end of the clipboard contents will be removed before passing the
+clipboard contents to an application. The text saved in history is not 
affected.</para>
 </listitem>
 </varlistentry>
 </variablelist>
@@ -255,6 +243,14 @@ cause an error.</para>
 <title>Actions Configuration</title>
 
 <variablelist>
+<varlistentry>
+<term><guilabel>Offer applications for copied links and files</guilabel></term>
+<listitem><para>If selected, the popup menu offers applications that can
+open a copied file, or a copied link starting with <quote>http://</quote>
+or <quote>https://</quote>, even when no action of your own matches.</para>
+</listitem>
+</varlistentry>
+
 <varlistentry>
 <term>Editing Expressions/Actions</term>
 <listitem><para>On the <guilabel>Actions</guilabel> page, double-click
diff --git a/klipper/configdialog.cpp b/klipper/configdialog.cpp
index 32b8ce34e9..0e00ddfe7a 100644
--- a/klipper/configdialog.cpp
+++ b/klipper/configdialog.cpp
@@ -203,13 +203,6 @@ PopupWidget::PopupWidget(QWidget *parent)
     layout->addRow(i18n("Options:"), m_stripWhitespaceCb);
     layout->addRow(QString(), ConfigDialog::createHintLabel(item, this));
 
-    // MIME actions
-    item = KlipperSettings::self()->enableMagicMimeActionsItem();
-    m_mimeActionsCb = new QCheckBox(item->label(), this);
-    
m_mimeActionsCb->setObjectName(QLatin1String("kcfg_EnableMagicMimeActions"));
-    layout->addRow(QString(), m_mimeActionsCb);
-    layout->addRow(QString(), ConfigDialog::createHintLabel(item, this));
-
     layout->addRow(QString(), new QLabel(this));
 }
 
@@ -222,35 +215,34 @@ ActionsWidget::ActionsWidget(QWidget *parent)
 {
     auto *layout = new QGridLayout(this);
 
-    // General information label
-    QLabel *hint = ConfigDialog::createHintLabel(xi18nc("@info",
-                                                        "When a 
<interface>match pattern</interface> "
-                                                        "matches the clipboard 
contents, its <interface>commands</interface> "
-                                                        "appear in the Klipper 
popup menu and can be executed."),
-                                                 this);
-    layout->addWidget(hint, 0, 0, 1, -1);
+    // MIME actions - handlers for URLs and files that Klipper provides by 
itself
+    const KConfigSkeletonItem *item = 
KlipperSettings::self()->enableMagicMimeActionsItem();
+    m_mimeActionsCb = new QCheckBox(item->label(), this);
+    
m_mimeActionsCb->setObjectName(QLatin1String("kcfg_EnableMagicMimeActions"));
+    layout->addWidget(m_mimeActionsCb, 0, 0, 1, -1);
+    layout->addWidget(ConfigDialog::createHintLabel(item, this), 1, 0, 1, -1);
 
     // Scrolling list
     m_actionsTree = new ActionsTreeWidget(this);
     m_actionsTree->setColumnCount(2);
     m_actionsTree->setHeaderLabels({i18nc("@title:column", "Match pattern and 
commands"), i18nc("@title:column", "Description")});
 
-    layout->addWidget(m_actionsTree, 1, 0, 1, -1);
-    layout->setRowStretch(1, 1);
+    layout->addWidget(m_actionsTree, 2, 0, 1, -1);
+    layout->setRowStretch(2, 1);
 
     // Action buttons
     m_addActionButton = new 
QPushButton(QIcon::fromTheme(QStringLiteral("list-add")), i18n("Add 
Action..."), this);
     connect(m_addActionButton, &QPushButton::clicked, this, 
&ActionsWidget::onAddAction);
-    layout->addWidget(m_addActionButton, 2, 0);
+    layout->addWidget(m_addActionButton, 3, 0);
 
     m_editActionButton = new 
QPushButton(QIcon::fromTheme(QStringLiteral("document-edit")), i18n("Edit 
Action..."), this);
     connect(m_editActionButton, &QPushButton::clicked, this, 
&ActionsWidget::onEditAction);
-    layout->addWidget(m_editActionButton, 2, 1);
+    layout->addWidget(m_editActionButton, 3, 1);
     layout->setColumnStretch(2, 1);
 
     m_deleteActionButton = new 
QPushButton(QIcon::fromTheme(QStringLiteral("list-remove")), i18n("Delete 
Action"), this);
     connect(m_deleteActionButton, &QPushButton::clicked, this, 
&ActionsWidget::onDeleteAction);
-    layout->addWidget(m_deleteActionButton, 2, 3);
+    layout->addWidget(m_deleteActionButton, 3, 3);
 
     // Where to configure the action options
     if (KlipperSettings::actionsInfoMessageShown()) {
@@ -266,11 +258,11 @@ ActionsWidget::ActionsWidget(QWidget *parent)
         connect(msg, &KMessageWidget::hideAnimationFinished, this, []() {
             KlipperSettings::setActionsInfoMessageShown(false);
         });
-        layout->addWidget(msg, 3, 0, 1, -1);
+        layout->addWidget(msg, 4, 0, 1, -1);
     }
 
     // Add some vertical space between our buttons and the dialogue buttons
-    layout->setRowMinimumHeight(4, 16);
+    layout->setRowMinimumHeight(5, 16);
 
     KConfigGroup oldConfig = 
KSharedConfig::openConfig()->group(u"ActionsWidget"_s);
     KConfigGroup state = 
KSharedConfig::openStateConfig()->group(u"klipper"_s).group(u"ActionsWidget"_s);
diff --git a/klipper/configdialog.h b/klipper/configdialog.h
index d9452da1b0..ddda41d3ff 100644
--- a/klipper/configdialog.h
+++ b/klipper/configdialog.h
@@ -51,7 +51,6 @@ private:
     QCheckBox *m_enablePopupCb;
     QCheckBox *m_historyPopupCb;
     QCheckBox *m_stripWhitespaceCb;
-    QCheckBox *m_mimeActionsCb;
 
     QSpinBox *m_actionTimeoutSb;
 };
@@ -84,6 +83,7 @@ private:
     void updateActionListView();
 
 private:
+    QCheckBox *m_mimeActionsCb;
     ActionsTreeWidget *m_actionsTree;
     QPushButton *m_addActionButton;
     QPushButton *m_editActionButton;
diff --git a/klipper/klipper.kcfg b/klipper/klipper.kcfg
index 5b949a810f..4f15ae7beb 100644
--- a/klipper/klipper.kcfg
+++ b/klipper/klipper.kcfg
@@ -68,9 +68,9 @@
 
   <group name="Actions">
     <entry name="StripWhiteSpace" type="Bool">
-      <label>Trim whitespace from selection</label>
+      <label>Trim whitespace</label>
       <default>true</default>
-      <whatsthis>Remove any whitespace from the start and end of selected 
text, before performing an action. For example, this ensures that a URL pasted 
in a browser is interpreted as expected. The text saved on the clipboard is not 
affected.</whatsthis>
+      <whatsthis>Remove any whitespace from the start and end of the text 
passed to an action. The text saved in history is not affected.</whatsthis>
     </entry>
     <entry name="ReplayActionInHistory" type="Bool">
       <label>For an item chosen from history</label>
@@ -78,9 +78,9 @@
       <tooltip>Show the popup menu of applicable actions if an entry is chosen 
from the clipboard history.</tooltip>
     </entry>
     <entry name="EnableMagicMimeActions" type="Bool">
-      <label>Include MIME actions</label>
+      <label>Offer applications for copied links and files</label>
       <default>true</default>
-      <whatsthis>If a file name or URL is selected, include applications that 
can accept its MIME type in the popup menu.</whatsthis>
+      <whatsthis>For a link starting with &lt;i&gt;http://&lt;/i&gt; or 
&lt;i&gt;https://&lt;/i&gt; or for files, applications that can open them will 
be offered alongside your matching actions, if any.</whatsthis>
     </entry>
   </group>
 

Reply via email to