Commit 59ae8fe1 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Deprecate KToolBar::iconSizeDefault() officially in public API

And move logic to new member method of KToolBar::Private
parent f25188e0
...@@ -124,6 +124,7 @@ public: ...@@ -124,6 +124,7 @@ public:
void slotLockToolBars(bool lock); void slotLockToolBars(bool lock);
void init(bool readConfig = true, bool isMainToolBar = false); void init(bool readConfig = true, bool isMainToolBar = false);
int iconSizeDefault() const;
QString getPositionAsString() const; QString getPositionAsString() const;
QMenu *contextMenu(const QPoint &globalPos); QMenu *contextMenu(const QPoint &globalPos);
void setLocked(bool locked); void setLocked(bool locked);
...@@ -273,6 +274,11 @@ void KToolBar::Private::init(bool readConfig, bool _isMainToolBar) ...@@ -273,6 +274,11 @@ void KToolBar::Private::init(bool readConfig, bool _isMainToolBar)
q, SLOT(slotAppearanceChanged())); q, SLOT(slotAppearanceChanged()));
} }
int KToolBar::Private::iconSizeDefault() const
{
return KIconLoader::global()->currentSize(isMainToolBar ? KIconLoader::MainToolbar : KIconLoader::Toolbar);
}
QString KToolBar::Private::getPositionAsString() const QString KToolBar::Private::getPositionAsString() const
{ {
// get all of the stuff to save // get all of the stuff to save
...@@ -520,7 +526,7 @@ Qt::ToolButtonStyle KToolBar::Private::toolButtonStyleSetting() ...@@ -520,7 +526,7 @@ Qt::ToolButtonStyle KToolBar::Private::toolButtonStyleSetting()
void KToolBar::Private::loadKDESettings() void KToolBar::Private::loadKDESettings()
{ {
iconSizeSettings[Level_KDEDefault] = q->iconSizeDefault(); iconSizeSettings[Level_KDEDefault] = iconSizeDefault();
if (isMainToolBar) { if (isMainToolBar) {
toolButtonStyleSettings[Level_KDEDefault] = toolButtonStyleSetting(); toolButtonStyleSettings[Level_KDEDefault] = toolButtonStyleSetting();
...@@ -1063,10 +1069,12 @@ void KToolBar::setIconDimensions(int size) ...@@ -1063,10 +1069,12 @@ void KToolBar::setIconDimensions(int size)
d->iconSizeSettings[Level_UserSettings] = size; d->iconSizeSettings[Level_UserSettings] = size;
} }
#if KXMLGUI_BUILD_DEPRECATED_SINCE(5, 75)
int KToolBar::iconSizeDefault() const int KToolBar::iconSizeDefault() const
{ {
return KIconLoader::global()->currentSize(d->isMainToolBar ? KIconLoader::MainToolbar : KIconLoader::Toolbar); return d->iconSizeDefault();
} }
#endif
void KToolBar::slotMovableChanged(bool movable) void KToolBar::slotMovableChanged(bool movable)
{ {
......
...@@ -126,12 +126,16 @@ public: ...@@ -126,12 +126,16 @@ public:
*/ */
void setIconDimensions(int size); void setIconDimensions(int size);
#if KXMLGUI_ENABLE_DEPRECATED_SINCE(5, 75)
/** /**
* Returns the default size for this type of toolbar. * Returns the default size for this type of toolbar.
* *
* @return the default size for this type of toolbar. * @return the default size for this type of toolbar
* @deprecated Since 5.75, no known users.
*/ */
int iconSizeDefault() const; // KDE5: hide from public API. Doesn't make sense to export this, and it isn't used. KXMLGUI_DEPRECATED_VERSION(5, 75, "No known use case")
int iconSizeDefault() const;
#endif
#if KXMLGUI_ENABLE_DEPRECATED_SINCE(5, 0) #if KXMLGUI_ENABLE_DEPRECATED_SINCE(5, 0)
/** /**
......
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