Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Port away from deprecated IconSize method in the remaining dialogs.

parent ae711eb1
......@@ -93,13 +93,13 @@ ApplyProgressDialog::ApplyProgressDialog(QWidget* parent, OperationRunner& orunn
cancelButton = dialogButtonBox->addButton(QDialogButtonBox::Cancel);
detailsButton = new QPushButton;
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);
mainLayout->addWidget(dialogButtonBox);
dialogWidget().treeTasks().setColumnWidth(0, width() * 8 / 10);
detailsWidget().buttonBrowser().setIcon(QIcon::fromTheme(QStringLiteral("document-open")).pixmap(IconSize(KIconLoader::Toolbar)));
detailsWidget().buttonSave().setIcon(QIcon::fromTheme(QStringLiteral("document-save")).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(KIconLoader::global()->currentSize(KIconLoader::Toolbar)));
setupConnections();
......@@ -297,7 +297,7 @@ void ApplyProgressDialog::onJobStarted(Job* job, Operation* op)
QTreeWidgetItem* child = new QTreeWidgetItem();
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()));
item->addChild(child);
dialogWidget().treeTasks().scrollToBottom();
......@@ -309,7 +309,7 @@ void ApplyProgressDialog::onJobStarted(Job* job, Operation* op)
void ApplyProgressDialog::onJobFinished(Job* job, Operation* op)
{
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);
......@@ -324,7 +324,7 @@ void ApplyProgressDialog::onOpFinished(int num, Operation* op)
{
if (currentOpItem()) {
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);
......@@ -357,7 +357,7 @@ QString ApplyProgressDialog::opDesc(int num, const Operation& op) const
void ApplyProgressDialog::addTaskOutput(int num, const Operation& op)
{
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(1, QTime(0, 0).toString(timeFormat()));
......
......@@ -116,10 +116,10 @@ void DevicePropsDialog::setupDialog()
if (device().smartStatus().isValid()) {
if (device().smartStatus().status()) {
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 {
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 {
dialogWidget().smartStatusText().setText(xi18nc("@label", "(unknown)"));
......
......@@ -66,8 +66,8 @@ QSize FileSystemSupportDialog::sizeHint() const
void FileSystemSupportDialog::setupDialog()
{
QIcon yes = QIcon::fromTheme(QStringLiteral("dialog-ok")).pixmap(IconSize(KIconLoader::Toolbar));
QIcon no = QIcon::fromTheme(QStringLiteral("dialog-error")).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(KIconLoader::global()->currentSize(KIconLoader::Toolbar));
dialogWidget().tree().clear();
......
......@@ -29,7 +29,7 @@ class ListDeviceWidgetItem : public QListWidgetItem
{
public:
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()) {
setToolTip(d.prettyName());
setSizeHint(QSize(0, 32));
......
......@@ -41,7 +41,7 @@ void ListOperations::updateOperations(const OperationStack::Operations& ops)
listOperations().clear();
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());
listOperations().addItem(item);
}
......
......@@ -217,7 +217,7 @@ static QTreeWidgetItem* createTreeWidgetItem(const Partition& p)
item->setText(i, p.mountPoint());
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++;
item->setText(i++, p.fileSystem().label());
......@@ -258,7 +258,7 @@ void PartitionManagerWidget::updatePartitions()
deviceItem->setFont(0, font);
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));
......
......@@ -89,10 +89,10 @@ void SmartDialog::setupDialog()
if (device().smartStatus().isValid()) {
if (device().smartStatus().status()) {
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 {
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());
......
......@@ -153,7 +153,7 @@ void TreeLog::onNewLogMessage(Log::Level logLevel, const QString& s)
if (static_cast<int>(logLevel) >= Config::minLogLevel()) {
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(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