diff options
| author | Peter Penz <[email protected]> | 2006-12-20 19:10:39 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2006-12-20 19:10:39 +0000 |
| commit | 642110309ace0ec0da270615464d7d04944d5dcf (patch) | |
| tree | 173d3fefbcf1adfe93667348c243e3cb7fbc3bf0 /src/dolphinsettings.cpp | |
| parent | 3396d0dbee4e609fa5f7608912b4ac5badd36f72 (diff) | |
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
Diffstat (limited to 'src/dolphinsettings.cpp')
| -rw-r--r-- | src/dolphinsettings.cpp | 69 |
1 files changed, 0 insertions, 69 deletions
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(); |
