From 642110309ace0ec0da270615464d7d04944d5dcf Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 20 Dec 2006 19:10:39 +0000 Subject: Let the user chose whether view properties should be remembered for each directory or whether they should be valid globally. Per default the view properties are remembered for each directory. For testing purposes the MIME type information is shown per default in the icons mode (thanks to Fredrik for the cool implementation in KFileItemDelegate!). svn path=/trunk/playground/utils/dolphin/; revision=615232 --- src/dolphinsettings.cpp | 69 ------------------------------------------------- 1 file changed, 69 deletions(-) (limited to 'src/dolphinsettings.cpp') diff --git a/src/dolphinsettings.cpp b/src/dolphinsettings.cpp index f60bf0189..c3dc5fbee 100644 --- a/src/dolphinsettings.cpp +++ b/src/dolphinsettings.cpp @@ -84,75 +84,6 @@ void DolphinSettings::save() manager->save(false); } -void DolphinSettings::calculateGridSize(int hint) -{ - // TODO: remove in KDE4 - const int previewSize = m_iconsModeSettings->previewSize(); - const int iconSize = m_iconsModeSettings->iconSize(); - const int maxSize = (previewSize > iconSize) ? previewSize : iconSize; - const Q3IconView::Arrangement arrangement = (m_iconsModeSettings->arrangement() == "LeftToRight") ? - Q3IconView::LeftToRight : Q3IconView::TopToBottom; - - int gridWidth = 0; - int gridHeight = 0; - if (arrangement == Q3IconView::LeftToRight) { - int widthUnit = maxSize + (maxSize / 2); - if (widthUnit < K3Icon::SizeLarge) { - widthUnit = K3Icon::SizeLarge; - } - - gridWidth = widthUnit + hint * K3Icon::SizeLarge; - - gridHeight = iconSize; - if (gridHeight <= K3Icon::SizeMedium) { - gridHeight = gridHeight * 2; - } - else { - gridHeight += maxSize / 2; - } - } - else { - assert(arrangement == Q3IconView::TopToBottom); - gridWidth = maxSize + (hint + 1) * (8 * m_iconsModeSettings->fontSize()); - - // The height-setting is ignored yet by KFileIconView if the TopToBottom - // arrangement is active. Anyway write the setting to have a defined value. - gridHeight = maxSize; - } - - m_iconsModeSettings->setGridWidth(gridWidth); - m_iconsModeSettings->setGridHeight(gridHeight); -} - -int DolphinSettings::textWidthHint() const -{ - // TODO: remove in KDE4 - const int previewSize = m_iconsModeSettings->previewSize(); - const int iconSize = m_iconsModeSettings->iconSize(); - const Q3IconView::Arrangement arrangement = (m_iconsModeSettings->arrangement() == "LeftToRight") ? - Q3IconView::LeftToRight : Q3IconView::TopToBottom; - - const int gridWidth = m_iconsModeSettings->gridWidth(); - - const int maxSize = (previewSize > iconSize) ? previewSize : iconSize; - int hint = 0; - if (arrangement == Q3IconView::LeftToRight) { - int widthUnit = maxSize + (maxSize / 2); - if (widthUnit < K3Icon::SizeLarge) { - widthUnit = K3Icon::SizeLarge; - } - hint = (gridWidth - widthUnit) / K3Icon::SizeLarge; - } - else { - assert(arrangement == Q3IconView::TopToBottom); - hint = (gridWidth - maxSize) / (8 * m_iconsModeSettings->fontSize()) - 1; - if (hint > 2) { - hint = 2; - } - } - return hint; -} - DolphinSettings::DolphinSettings() { m_generalSettings = new GeneralSettings(); -- cgit v1.3