Commit 027bbd03 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port deprecated method + make doctool as optional

parent 184258a6
Pipeline #113643 passed with stage
in 49 seconds
......@@ -45,7 +45,6 @@ find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
ConfigWidgets
CoreAddons
DocTools
I18n
IconThemes
KIO
......@@ -54,11 +53,16 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
WidgetsAddons
XmlGui
)
find_package(KF5DocTools ${KF5_MIN_VERSION})
set_package_properties(KF5DocTools PROPERTIES DESCRIPTION
"Tools to generate documentation"
TYPE OPTIONAL
)
add_definitions(
-DQT_DISABLE_DEPRECATED_BEFORE=0x050F00
-DQT_DEPRECATED_WARNINGS_SINCE=0x060000
#-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055800
-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055800
-DKF_DEPRECATED_WARNINGS_SINCE=0x060000
)
......@@ -67,7 +71,6 @@ if (CMAKE_UNITY_BUILD)
endif()
add_subdirectory(desktop)
add_subdirectory(doc)
add_subdirectory(pics)
add_subdirectory(src)
ecm_qt_install_logging_categories(
......@@ -75,7 +78,11 @@ ecm_qt_install_logging_categories(
FILE kdf.categories
DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
)
ki18n_install(po)
if(KF5DocTools_FOUND)
kdoctools_install(po)
add_subdirectory(doc)
endif()
kdoctools_install(po)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
......@@ -55,9 +55,9 @@ KDFConfigWidget::KDFConfigWidget(QWidget *parent, bool init)
this, &KDFConfigWidget::toggleListText );
connect( m_listWidget, &QTreeWidget::itemClicked,
this, &KDFConfigWidget::slotChanged );
iconVisible = MainBarIcon( QStringLiteral( "dialog-ok-apply" ) );
iconHidden = MainBarIcon( QStringLiteral( "dialog-cancel" ) );
const int smallIcon = qApp->style()->pixelMetric(QStyle::PM_ToolBarIconSize);
iconVisible = QIcon::fromTheme( QStringLiteral( "dialog-ok-apply" ) ).pixmap(smallIcon);
iconHidden = QIcon::fromTheme( QStringLiteral( "dialog-cancel" ) ).pixmap(smallIcon);
QTreeWidgetItem * item = new QTreeWidgetItem( m_listWidget );
for( int i=0; i < m_columnList.size(); i++ )
......
......@@ -330,15 +330,16 @@ void KDFWidget::updateDFDone( void ){
QIcon KDFWidget::generateIcon( const QString &iconName, bool mode, bool mounted)
{
QPixmap pix = SmallIcon(iconName);
const int smallIcon = qApp->style()->pixelMetric(QStyle::PM_SmallIconSize);
QPixmap pix = QIcon::fromTheme( iconName ).pixmap(smallIcon);
QPainter painter(&pix);
if( mode )
painter.drawPixmap( QRect(0,6,10,10), SmallIcon(QStringLiteral( "object-locked" )) );
painter.drawPixmap( QRect(0,6,10,10), QIcon::fromTheme(QStringLiteral( "object-locked" )).pixmap(smallIcon) );
if( mounted )
painter.drawPixmap( QRect(6,6,12,12) , SmallIcon(QStringLiteral( "emblem-mounted" )) );
painter.drawPixmap( QRect(6,6,12,12) , QIcon::fromTheme(QStringLiteral( "emblem-mounted" )).pixmap(smallIcon) );
painter.end();
return QIcon(pix);
......@@ -425,7 +426,7 @@ void KDFWidget::contextMenuRequested( const QPoint &p )
FreeItem->setText( i18n("MOUNTING") );
QStandardItem * IconItem = m_listModel->item( index.row() , IconCol );
IconItem->setIcon( SmallIcon(QLatin1String( "user-away" )) );
IconItem->setIcon( QIcon::fromTheme(QStringLiteral( "user-away" )) );
int val = disk->toggleMount();
if( val != 0 /*== false*/ )
......
......@@ -116,7 +116,7 @@ void MntConfigWidget::readDFDone( void )
DiskEntry * disk = *itr;
item = new QTreeWidgetItem( m_listWidget, QStringList() << QString() << disk->deviceName()
<< disk->mountPoint() << disk->mountCommand() << disk->umountCommand() );
item->setIcon( IconCol, SmallIcon( disk->iconName() ) );
item->setIcon( IconCol, QIcon::fromTheme( disk->iconName() ) );
}
/*
......@@ -210,7 +210,8 @@ void MntConfigWidget::iconChanged(const QString &iconName)
disk->setIconName(iconName);
mIconLineEdit->setText(iconName);
QPixmap icon = SmallIcon( iconName );
const int smallIcon = qApp->style()->pixelMetric(QStyle::PM_SmallIconSize);
const QPixmap icon = QIcon::fromTheme( iconName ).pixmap(smallIcon);
item->setIcon( IconCol, icon );
mIconButton->setIcon( icon );
......
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