Commit e40bb2da authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix display text

parent 894899b1
Pipeline #138877 passed with stage
in 10 minutes and 34 seconds
......@@ -71,13 +71,18 @@ OpenUrlWithConfigureWidget::~OpenUrlWithConfigureWidget()
{
}
void OpenUrlWithConfigureWidget::displayText(const MessageViewer::OpenWithUrlInfo &r, OpenUrlWithConfigureItem *item)
{
item->setInfo(r);
item->setText(QStringLiteral("%1 (%2)").arg(r.command() + r.commandLine(), r.url()));
}
void OpenUrlWithConfigureWidget::loadSettings()
{
const QVector<MessageViewer::OpenWithUrlInfo> rules = MessageViewer::OpenUrlWithManager::self()->openWithUrlInfo();
for (const MessageViewer::OpenWithUrlInfo &r : rules) {
auto item = new OpenUrlWithConfigureItem(mListWidget);
item->setInfo(r);
item->setText(r.command());
displayText(r, item);
}
}
......@@ -114,7 +119,7 @@ void OpenUrlWithConfigureWidget::slotAddRule()
}
}
auto item = new OpenUrlWithConfigureItem(mListWidget);
item->setInfo(r);
displayText(r, item);
}
}
delete dlg;
......@@ -137,8 +142,7 @@ void OpenUrlWithConfigureWidget::slotEditRule()
r.setCommand(info.command);
r.setCommandLine(info.commandLines);
r.setUrl(info.url);
item->setInfo(r);
item->setText(info.command);
displayText(r, item);
}
}
delete dlg;
......
......@@ -9,6 +9,11 @@
#include "openurlwith_private_export.h"
#include <QWidget>
class QListWidget;
class OpenUrlWithConfigureItem;
namespace MessageViewer
{
class OpenWithUrlInfo;
}
class LIBOPENURLWITHCONFIGURE_TESTS_EXPORT OpenUrlWithConfigureWidget : public QWidget
{
Q_OBJECT
......@@ -23,5 +28,6 @@ private:
void slotAddRule();
void slotEditRule();
void slotRemoveRule();
void displayText(const MessageViewer::OpenWithUrlInfo &r, OpenUrlWithConfigureItem *item);
QListWidget *const mListWidget;
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment