Commit c55a756e authored by Yuri Chornoivan's avatar Yuri Chornoivan
Browse files

Replace deprecated KIconLoader SmallIcon and DesktopIcon methods

parent 3bfde6ee
......@@ -189,10 +189,10 @@ namespace {
// track type
s += "<td class=\"tracktype\">(";
if( track.type() == K3b::Device::Track::TYPE_AUDIO ) {
// item->setPixmap( 0, SmallIcon( "audio-x-generic" ) );
// item->setPixmap( QIcon::fromTheme("audio-x-generic").pixmap(KIconLoader::SizeSmall) );
s += i18n("Audio");
} else {
// item->setPixmap( 0, SmallIcon( "application-x-tar" ) );
// item->setPixmap( QIcon::fromTheme("application-x-tar").pixmap(KIconLoader::SizeSmall) );
if( track.mode() == K3b::Device::Track::MODE1 )
s += i18n("Data/Mode1");
else if( track.mode() == K3b::Device::Track::MODE2 )
......
......@@ -30,8 +30,8 @@
#include <KConfig>
#include <KAboutData>
#include <KLocalizedString>
#include <KIconLoader>
#include <KLocalizedString>
#include <KIO/Global>
#include <QFile>
......@@ -53,7 +53,7 @@ K3b::StatusBarManager::StatusBarManager( K3b::MainWindow* parent )
QWidget* boxFreeTemp = new QWidget( m_mainWindow->statusBar() );
boxFreeTemp->installEventFilter( this );
m_pixFreeTemp = new QLabel( boxFreeTemp );
m_pixFreeTemp->setPixmap( SmallIcon("folder-green") );
m_pixFreeTemp->setPixmap( QIcon::fromTheme("folder-green").pixmap(KIconLoader::SizeSmall) );
m_labelFreeTemp = new QLabel( boxFreeTemp );
QHBoxLayout* boxFreeTempLayout = new QHBoxLayout( boxFreeTemp );
......@@ -115,9 +115,9 @@ void K3b::StatusBarManager::update()
// if we have less than 640 MB that is not good
if( avail < 655360 )
m_pixFreeTemp->setPixmap( SmallIcon("folder-red") );
m_pixFreeTemp->setPixmap( QIcon::fromTheme("folder-red").pixmap(KIconLoader::SizeSmall) );
else
m_pixFreeTemp->setPixmap( SmallIcon("folder-green") );
m_pixFreeTemp->setPixmap( QIcon::fromTheme("folder-green").pixmap(KIconLoader::SizeSmall) );
} else {
m_labelFreeTemp->setText(i18n("No info"));
}
......
......@@ -426,7 +426,7 @@ void K3b::WelcomeWidget::mousePressEvent ( QMouseEvent* e )
QWidget* widgetAtPos = childAt(e->pos());
if( widgetAtPos && widgetAtPos->inherits( "K3b::FlatButton" ) ) {
QMenu pop;
removeAction = pop.addAction( SmallIcon("list-remove"), i18n("Remove Button") );
removeAction = pop.addAction( QIcon::fromTheme("list-remove"), i18n("Remove Button") );
if ( addPop.actions().count() > 0 )
pop.addMenu( &addPop );
r = pop.exec( e->globalPos() );
......
......@@ -534,7 +534,7 @@ void K3b::ImageWritingDialog::setupGui()
// copies --------
QGroupBox* groupCopies = new QGroupBox( i18n("Copies"), optionTab );
QLabel* pixLabel = new QLabel( groupCopies );
pixLabel->setPixmap( SmallIcon( "tools-media-optical-copy", KIconLoader::SizeMedium ) );
pixLabel->setPixmap( QIcon::fromTheme("tools-media-optical-copy").pixmap(KIconLoader::SizeMedium) );
pixLabel->setScaledContents( false );
d->spinCopies = new QSpinBox( groupCopies );
d->spinCopies->setMinimum( 1 );
......
......@@ -106,7 +106,7 @@ K3b::MediaCopyDialog::MediaCopyDialog( QWidget *parent )
QGroupBox* groupCopies = new QGroupBox( i18n("Copies"), optionTab );
QLabel* pixLabel = new QLabel( groupCopies );
pixLabel->setPixmap( SmallIcon( "tools-media-optical-copy", KIconLoader::SizeMedium ) );
pixLabel->setPixmap( QIcon::fromTheme("tools-media-optical-copy").pixmap(KIconLoader::SizeMedium) );
pixLabel->setScaledContents( false );
m_spinCopies = new QSpinBox( groupCopies );
m_spinCopies->setRange( 1, 999 );
......
......@@ -203,13 +203,13 @@ void K3b::DataPropertiesDialog::loadItemProperties( K3b::DataItem* dataItem )
QFileInfo fileInfo( fileItem->localPath() );
qDebug() << fileItem->k3bPath() << fileItem->localPath();
if( fileItem->isSymLink() ) {
m_labelIcon->setPixmap( DesktopIcon( fileItem->mimeType().iconName(), KIconLoader::SizeLarge,
KIconLoader::DefaultState, QStringList() << "emblem-symbolic-link" ) );
m_labelIcon->setPixmap( KIconLoader::global()->loadIcon( fileItem->mimeType().iconName(), KIconLoader::NoGroup, KIconLoader::SizeLarge,
KIconLoader::DefaultState, QStringList() << "emblem-symbolic-link", nullptr, true ) );
m_labelType->setText( i18n( "Link to %1", fileItem->mimeType().comment() ) );
m_labelLocalLinkTarget->setText( fileItem->linkDest() );
}
else {
m_labelIcon->setPixmap( DesktopIcon( fileItem->mimeType().iconName(), KIconLoader::SizeLarge ) );
m_labelIcon->setPixmap( QIcon::fromTheme(fileItem->mimeType().iconName()).pixmap(KIconLoader::SizeLarge) );
m_labelType->setText( fileItem->mimeType().comment() );
m_labelLocalLinkTargetText->hide();
m_labelLocalLinkTarget->hide();
......@@ -219,7 +219,7 @@ void K3b::DataPropertiesDialog::loadItemProperties( K3b::DataItem* dataItem )
m_labelSize->setText( KIO::convertSize(dataItem->size()) );
}
else if( K3b::DirItem* dirItem = dynamic_cast<K3b::DirItem*>(dataItem) ) {
m_labelIcon->setPixmap( DesktopIcon( "folder", KIconLoader::SizeLarge ) );
m_labelIcon->setPixmap( QIcon::fromTheme("folder").pixmap(KIconLoader::SizeLarge) );
m_labelType->setText( i18n("Folder") );
m_labelLocalNameText->hide();
m_labelLocalName->hide();
......@@ -233,7 +233,7 @@ void K3b::DataPropertiesDialog::loadItemProperties( K3b::DataItem* dataItem )
i18np("and one folder", "and %1 folders", dirItem->numDirs()) + ')' );
}
else {
m_labelIcon->setPixmap( DesktopIcon("unknown", KIconLoader::SizeLarge) );
m_labelIcon->setPixmap( QIcon::fromTheme("unknown").pixmap(KIconLoader::SizeLarge) );
m_labelType->setText( i18n("Special file") );
m_labelLocalNameText->hide();
m_labelLocalName->hide();
......@@ -282,7 +282,7 @@ void K3b::DataPropertiesDialog::loadItemProperties( K3b::DataItem* dataItem )
void K3b::DataPropertiesDialog::loadListProperties( const QList<K3b::DataItem*>& items )
{
m_labelIcon->setPixmap( DesktopIcon( "document-multiple", KIconLoader::SizeLarge ) );
m_labelIcon->setPixmap( QIcon::fromTheme("document-multiple").pixmap(KIconLoader::SizeLarge) );
int files = 0;
int folders = 0;
......
......@@ -277,7 +277,7 @@ void K3b::ProjectBurnDialog::prepareGui()
QGroupBox* groupCopies = new QGroupBox( i18n("Copies"), w );
QLabel* pixLabel = new QLabel( groupCopies );
pixLabel->setPixmap( SmallIcon( "tools-media-optical-copy", KIconLoader::SizeMedium ) );
pixLabel->setPixmap( QIcon::fromTheme("tools-media-optical-copy").pixmap(KIconLoader::SizeMedium) );
pixLabel->setScaledContents( false );
m_spinCopies = new QSpinBox( groupCopies );
m_spinCopies->setRange( 1, 999 );
......
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