Port away from deprecated IconSize method in the remaining dialogs.

parent ae711eb1
...@@ -93,13 +93,13 @@ ApplyProgressDialog::ApplyProgressDialog(QWidget* parent, OperationRunner& orunn ...@@ -93,13 +93,13 @@ ApplyProgressDialog::ApplyProgressDialog(QWidget* parent, OperationRunner& orunn
cancelButton = dialogButtonBox->addButton(QDialogButtonBox::Cancel); cancelButton = dialogButtonBox->addButton(QDialogButtonBox::Cancel);
detailsButton = new QPushButton; detailsButton = new QPushButton;
detailsButton->setText(xi18nc("@action:button", "&Details") + QStringLiteral(" >>")); detailsButton->setText(xi18nc("@action:button", "&Details") + QStringLiteral(" >>"));
detailsButton->setIcon(QIcon::fromTheme(QStringLiteral("help-about")).pixmap(IconSize(KIconLoader::Toolbar))); detailsButton->setIcon(QIcon::fromTheme(QStringLiteral("help-about")).pixmap(KIconLoader::global()->currentSize(KIconLoader::Toolbar)));
dialogButtonBox->addButton(detailsButton, QDialogButtonBox::ActionRole); dialogButtonBox->addButton(detailsButton, QDialogButtonBox::ActionRole);
mainLayout->addWidget(dialogButtonBox); mainLayout->addWidget(dialogButtonBox);
dialogWidget().treeTasks().setColumnWidth(0, width() * 8 / 10); dialogWidget().treeTasks().setColumnWidth(0, width() * 8 / 10);
detailsWidget().buttonBrowser().setIcon(QIcon::fromTheme(QStringLiteral("document-open")).pixmap(IconSize(KIconLoader::Toolbar))); detailsWidget().buttonBrowser().setIcon(QIcon::fromTheme(QStringLiteral("document-open")).pixmap(KIconLoader::global()->currentSize(KIconLoader::Toolbar)));
detailsWidget().buttonSave().setIcon(QIcon::fromTheme(QStringLiteral("document-save")).pixmap(IconSize(KIconLoader::Toolbar))); detailsWidget().buttonSave().setIcon(QIcon::fromTheme(QStringLiteral("document-save")).pixmap(KIconLoader::global()->currentSize(KIconLoader::Toolbar)));
setupConnections(); setupConnections();
...@@ -297,7 +297,7 @@ void ApplyProgressDialog::onJobStarted(Job* job, Operation* op) ...@@ -297,7 +297,7 @@ void ApplyProgressDialog::onJobStarted(Job* job, Operation* op)
QTreeWidgetItem* child = new QTreeWidgetItem(); QTreeWidgetItem* child = new QTreeWidgetItem();
child->setText(0, job->description()); child->setText(0, job->description());
child->setIcon(0, QIcon::fromTheme(job->statusIcon()).pixmap(IconSize(KIconLoader::Small))); child->setIcon(0, QIcon::fromTheme(job->statusIcon()).pixmap(KIconLoader::global()->currentSize(KIconLoader::Small)));
child->setText(1, QTime(0, 0).toString(timeFormat())); child->setText(1, QTime(0, 0).toString(timeFormat()));
item->addChild(child); item->addChild(child);
dialogWidget().treeTasks().scrollToBottom(); dialogWidget().treeTasks().scrollToBottom();
...@@ -309,7 +309,7 @@ void ApplyProgressDialog::onJobStarted(Job* job, Operation* op) ...@@ -309,7 +309,7 @@ void ApplyProgressDialog::onJobStarted(Job* job, Operation* op)
void ApplyProgressDialog::onJobFinished(Job* job, Operation* op) void ApplyProgressDialog::onJobFinished(Job* job, Operation* op)
{ {
if (currentJobItem()) if (currentJobItem())
currentJobItem()->setIcon(0, QIcon::fromTheme(job->statusIcon()).pixmap(IconSize(KIconLoader::Small))); currentJobItem()->setIcon(0, QIcon::fromTheme(job->statusIcon()).pixmap(KIconLoader::global()->currentSize(KIconLoader::Small)));
setCurrentJobItem(nullptr); setCurrentJobItem(nullptr);
...@@ -324,7 +324,7 @@ void ApplyProgressDialog::onOpFinished(int num, Operation* op) ...@@ -324,7 +324,7 @@ void ApplyProgressDialog::onOpFinished(int num, Operation* op)
{ {
if (currentOpItem()) { if (currentOpItem()) {
currentOpItem()->setText(0, opDesc(num, *op)); currentOpItem()->setText(0, opDesc(num, *op));
currentOpItem()->setIcon(0, QIcon::fromTheme(op->statusIcon()).pixmap(IconSize(KIconLoader::Small))); currentOpItem()->setIcon(0, QIcon::fromTheme(op->statusIcon()).pixmap(KIconLoader::global()->currentSize(KIconLoader::Small)));
} }
setCurrentOpItem(nullptr); setCurrentOpItem(nullptr);
...@@ -357,7 +357,7 @@ QString ApplyProgressDialog::opDesc(int num, const Operation& op) const ...@@ -357,7 +357,7 @@ QString ApplyProgressDialog::opDesc(int num, const Operation& op) const
void ApplyProgressDialog::addTaskOutput(int num, const Operation& op) void ApplyProgressDialog::addTaskOutput(int num, const Operation& op)
{ {
QTreeWidgetItem* item = new QTreeWidgetItem(); QTreeWidgetItem* item = new QTreeWidgetItem();
item->setIcon(0, QIcon::fromTheme(op.statusIcon()).pixmap(IconSize(KIconLoader::Small))); item->setIcon(0, QIcon::fromTheme(op.statusIcon()).pixmap(KIconLoader::global()->currentSize(KIconLoader::Small)));
item->setText(0, opDesc(num, op)); item->setText(0, opDesc(num, op));
item->setText(1, QTime(0, 0).toString(timeFormat())); item->setText(1, QTime(0, 0).toString(timeFormat()));
......
...@@ -116,10 +116,10 @@ void DevicePropsDialog::setupDialog() ...@@ -116,10 +116,10 @@ void DevicePropsDialog::setupDialog()
if (device().smartStatus().isValid()) { if (device().smartStatus().isValid()) {
if (device().smartStatus().status()) { if (device().smartStatus().status()) {
dialogWidget().smartStatusText().setText(xi18nc("@label SMART disk status", "good")); dialogWidget().smartStatusText().setText(xi18nc("@label SMART disk status", "good"));
dialogWidget().smartStatusIcon().setPixmap(QIcon::fromTheme(QStringLiteral("dialog-ok")).pixmap(IconSize(KIconLoader::Small))); dialogWidget().smartStatusIcon().setPixmap(QIcon::fromTheme(QStringLiteral("dialog-ok")).pixmap(KIconLoader::global()->currentSize(KIconLoader::Small)));
} else { } else {
dialogWidget().smartStatusText().setText(xi18nc("@label SMART disk status", "BAD")); dialogWidget().smartStatusText().setText(xi18nc("@label SMART disk status", "BAD"));
dialogWidget().smartStatusIcon().setPixmap(QIcon::fromTheme(QStringLiteral("dialog-warning")).pixmap(IconSize(KIconLoader::Small))); dialogWidget().smartStatusIcon().setPixmap(QIcon::fromTheme(QStringLiteral("dialog-warning")).pixmap(KIconLoader::global()->currentSize(KIconLoader::Small)));
} }
} else { } else {
dialogWidget().smartStatusText().setText(xi18nc("@label", "(unknown)")); dialogWidget().smartStatusText().setText(xi18nc("@label", "(unknown)"));
......
...@@ -66,8 +66,8 @@ QSize FileSystemSupportDialog::sizeHint() const ...@@ -66,8 +66,8 @@ QSize FileSystemSupportDialog::sizeHint() const
void FileSystemSupportDialog::setupDialog() void FileSystemSupportDialog::setupDialog()
{ {
QIcon yes = QIcon::fromTheme(QStringLiteral("dialog-ok")).pixmap(IconSize(KIconLoader::Toolbar)); QIcon yes = QIcon::fromTheme(QStringLiteral("dialog-ok")).pixmap(KIconLoader::global()->currentSize(KIconLoader::Toolbar));
QIcon no = QIcon::fromTheme(QStringLiteral("dialog-error")).pixmap(IconSize(KIconLoader::Toolbar)); QIcon no = QIcon::fromTheme(QStringLiteral("dialog-error")).pixmap(KIconLoader::global()->currentSize(KIconLoader::Toolbar));
dialogWidget().tree().clear(); dialogWidget().tree().clear();
......
...@@ -29,7 +29,7 @@ class ListDeviceWidgetItem : public QListWidgetItem ...@@ -29,7 +29,7 @@ class ListDeviceWidgetItem : public QListWidgetItem
{ {
public: public:
ListDeviceWidgetItem(const Device& d) : ListDeviceWidgetItem(const Device& d) :
QListWidgetItem(QIcon::fromTheme(d.iconName()).pixmap(IconSize(KIconLoader::Desktop)), d.prettyName()), QListWidgetItem(QIcon::fromTheme(d.iconName()).pixmap(KIconLoader::global()->currentSize(KIconLoader::Desktop)), d.prettyName()),
deviceNode(d.deviceNode()) { deviceNode(d.deviceNode()) {
setToolTip(d.prettyName()); setToolTip(d.prettyName());
setSizeHint(QSize(0, 32)); setSizeHint(QSize(0, 32));
......
...@@ -41,7 +41,7 @@ void ListOperations::updateOperations(const OperationStack::Operations& ops) ...@@ -41,7 +41,7 @@ void ListOperations::updateOperations(const OperationStack::Operations& ops)
listOperations().clear(); listOperations().clear();
for (const auto &op : ops) { for (const auto &op : ops) {
QListWidgetItem* item = new QListWidgetItem(QIcon::fromTheme(op->iconName()).pixmap(IconSize(KIconLoader::Small)), op->description()); QListWidgetItem* item = new QListWidgetItem(QIcon::fromTheme(op->iconName()).pixmap(KIconLoader::global()->currentSize(KIconLoader::Small)), op->description());
item->setToolTip(op->description()); item->setToolTip(op->description());
listOperations().addItem(item); listOperations().addItem(item);
} }
......
...@@ -217,7 +217,7 @@ static QTreeWidgetItem* createTreeWidgetItem(const Partition& p) ...@@ -217,7 +217,7 @@ static QTreeWidgetItem* createTreeWidgetItem(const Partition& p)
item->setText(i, p.mountPoint()); item->setText(i, p.mountPoint());
if (p.isMounted()) if (p.isMounted())
item->setIcon(i, QIcon::fromTheme(QStringLiteral("object-locked")).pixmap(IconSize(KIconLoader::Panel))); item->setIcon(i, QIcon::fromTheme(QStringLiteral("object-locked")).pixmap(KIconLoader::global()->currentSize(KIconLoader::Panel)));
i++; i++;
item->setText(i++, p.fileSystem().label()); item->setText(i++, p.fileSystem().label());
...@@ -258,7 +258,7 @@ void PartitionManagerWidget::updatePartitions() ...@@ -258,7 +258,7 @@ void PartitionManagerWidget::updatePartitions()
deviceItem->setFont(0, font); deviceItem->setFont(0, font);
deviceItem->setText(0, selectedDevice()->prettyName()); deviceItem->setText(0, selectedDevice()->prettyName());
deviceItem->setIcon(0, QIcon::fromTheme(selectedDevice()->iconName()).pixmap(IconSize(KIconLoader::Desktop))); deviceItem->setIcon(0, QIcon::fromTheme(selectedDevice()->iconName()).pixmap(KIconLoader::global()->currentSize(KIconLoader::Desktop)));
deviceItem->setSizeHint(0, QSize(0, 32)); deviceItem->setSizeHint(0, QSize(0, 32));
......
...@@ -89,10 +89,10 @@ void SmartDialog::setupDialog() ...@@ -89,10 +89,10 @@ void SmartDialog::setupDialog()
if (device().smartStatus().isValid()) { if (device().smartStatus().isValid()) {
if (device().smartStatus().status()) { if (device().smartStatus().status()) {
dialogWidget().statusText().setText(xi18nc("@label SMART disk status", "good")); dialogWidget().statusText().setText(xi18nc("@label SMART disk status", "good"));
dialogWidget().statusIcon().setPixmap(QIcon::fromTheme(QStringLiteral("dialog-ok")).pixmap(IconSize(KIconLoader::Small))); dialogWidget().statusIcon().setPixmap(QIcon::fromTheme(QStringLiteral("dialog-ok")).pixmap(KIconLoader::global()->currentSize(KIconLoader::Small)));
} else { } else {
dialogWidget().statusText().setText(xi18nc("@label SMART disk status", "BAD")); dialogWidget().statusText().setText(xi18nc("@label SMART disk status", "BAD"));
dialogWidget().statusIcon().setPixmap(QIcon::fromTheme(QStringLiteral("dialog-warning")).pixmap(IconSize(KIconLoader::Small))); dialogWidget().statusIcon().setPixmap(QIcon::fromTheme(QStringLiteral("dialog-warning")).pixmap(KIconLoader::global()->currentSize(KIconLoader::Small)));
} }
dialogWidget().modelName().setText(device().smartStatus().modelName()); dialogWidget().modelName().setText(device().smartStatus().modelName());
......
...@@ -153,7 +153,7 @@ void TreeLog::onNewLogMessage(Log::Level logLevel, const QString& s) ...@@ -153,7 +153,7 @@ void TreeLog::onNewLogMessage(Log::Level logLevel, const QString& s)
if (static_cast<int>(logLevel) >= Config::minLogLevel()) { if (static_cast<int>(logLevel) >= Config::minLogLevel()) {
QTreeWidgetItem* item = new QTreeWidgetItem(); QTreeWidgetItem* item = new QTreeWidgetItem();
item->setIcon(0, QIcon::fromTheme(icons[static_cast<int>(logLevel)]).pixmap(IconSize(KIconLoader::Small))); item->setIcon(0, QIcon::fromTheme(icons[static_cast<int>(logLevel)]).pixmap(KIconLoader::global()->currentSize(KIconLoader::Small)));
item->setText(1, QDateTime::currentDateTime().toString(QStringLiteral("yyyy-MM-dd hh:mm:ss"))); item->setText(1, QDateTime::currentDateTime().toString(QStringLiteral("yyyy-MM-dd hh:mm:ss")));
item->setText(2, s); item->setText(2, s);
......
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