Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 251809 Details for
Bug 342479
kde-base/plasma-apps-4.5.2: Icon positions in folderview
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Folderview patch, based on filfe for 4.5.3
plasma-apps-4.5.2-folderview.patch (text/plain), 7.39 KB, created by
S. Lorsbach
on 2010-10-24 16:10:52 UTC
(
hide
)
Description:
Folderview patch, based on filfe for 4.5.3
Filename:
MIME Type:
Creator:
S. Lorsbach
Created:
2010-10-24 16:10:52 UTC
Size:
7.39 KB
patch
obsolete
>--- plasma/applets/folderview/folderview.cpp 2010-09-30 23:20:10.000000000 +0200 >+++ plasma/applets/folderview//folderview.cpp 2010-10-24 17:30:48.077000018 +0200 >@@ -21,10 +21,7 @@ > #include "folderview.h" > > #include <QClipboard> >-#include <QDebug> >-#include <QDesktopServices> > #include <QDesktopWidget> >-#include <QDrag> > #include <QGraphicsLinearLayout> > #include <QGraphicsView> > #include <QGraphicsSceneDragDropEvent> >@@ -41,16 +38,15 @@ > #include <kfileplacesmodel.h> > #include <kfilepreviewgenerator.h> > #include <KGlobalSettings> >-#include <KMenu> >-#include <KStandardDirs> > #include <KStandardShortcut> > #include <KStringHandler> > #include <KTemporaryFile> >+#include <KStandardDirs> >+#include <KMenu> > > #include <kio/copyjob.h> > #include <kio/fileundomanager.h> > #include <kio/paste.h> >-#include <KParts/BrowserExtension> > > #include <kfileitemactions.h> > #include <kfileitemlistproperties.h> >@@ -360,7 +356,7 @@ > m_model->setMimeTypeFilterList(m_filterFilesMimeList); > m_model->setFileNameFilter(m_filterFiles); > m_model->setSortDirectoriesFirst(m_sortDirsFirst); >- m_model->setDynamicSortFilter(true); >+ m_model->setDynamicSortFilter(m_sortColumn != -1); > m_model->sort(m_sortColumn != -1 ? m_sortColumn : KDirModel::Name, Qt::AscendingOrder); > > DirLister *lister = new DirLister(this); >@@ -420,10 +416,120 @@ > > void FolderView::configChanged() > { >- //TODO: reload all other config values there > KConfigGroup cg = config(); >- setUrl(cg.readEntry("url", m_url)); >- m_dirModel->dirLister()->openUrl(m_url); >+ >+ //Declare some variables that are used afterwards >+ bool needReload = false; >+ bool preserveIconPositions = false; >+ >+ //Reload m_customLabel values >+ QString label = m_customLabel; >+ m_customLabel = cg.readEntry("customLabel", m_customLabel); >+ if (label != m_customLabel) { >+ needReload = true; >+ } >+ >+ //Reload m_customIconSize values >+ const int size = m_customIconSize; >+ m_customIconSize = cg.readEntry("customIconSize", m_customIconSize); >+ if (size != iconSize().width()) { >+ needReload = true; >+ >+ } >+ >+ m_showPreviews = cg.readEntry("showPreviews", m_showPreviews); >+ m_drawShadows = cg.readEntry("drawShadows", m_drawShadows); >+ m_iconsLocked = cg.readEntry("iconsLocked", m_iconsLocked); >+ m_alignToGrid = cg.readEntry("alignToGrid", m_alignToGrid); >+ m_numTextLines = cg.readEntry("numTextLines", m_numTextLines); >+ >+ const int filterType = m_filterType; >+ m_filterType = cg.readEntry("filter", m_filterType); >+ if (filterType != m_filterType) { >+ needReload = true; >+ } >+ >+ QColor color = m_textColor; >+ m_textColor = cg.readEntry("textColor", m_textColor); >+ if (color != m_textColor) { >+ needReload = true; >+ } >+ >+ m_previewPlugins = cg.readEntry("previewPlugins", m_previewPlugins); >+ >+ if (m_previewGenerator && m_previewPlugins != m_previewGenerator->enabledPlugins()) { >+ m_previewGenerator->setEnabledPlugins(m_previewPlugins); >+ >+ //Changing the preview plugins will also need a reload to work, so we need to preserve >+ //the icons position >+ needReload = true; >+ preserveIconPositions = true; >+ } >+ >+ m_sortDirsFirst = cg.readEntry("sortDirsFirst", m_sortDirsFirst); >+ toggleDirectoriesFirst(m_sortDirsFirst); >+ >+ const int sortColumn = m_sortColumn; >+ m_sortColumn = cg.readEntry("sortColumn", m_sortColumn); >+ if (m_sortColumn != sortColumn) { >+ if (m_sortColumn != -1) { >+ m_model->invalidate(); >+ m_model->sort(m_sortColumn, Qt::AscendingOrder); >+ m_model->setDynamicSortFilter(true); >+ } else if (m_iconView) { >+ m_iconView->setCustomLayout(true); >+ m_model->setDynamicSortFilter(false); >+ } >+ updateSortActionsState(); >+ } >+ >+ const QString filterFiles = m_filterFiles; >+ m_filterFiles = cg.readEntry("filterFiles", m_filterFiles); >+ >+ if (filterFiles != m_filterFiles) { >+ needReload = true; >+ } >+ >+ const QStringList mimeFilter = m_filterFilesMimeList; >+ m_filterFilesMimeList = cg.readEntry("mimeFilter", m_filterFilesMimeList); >+ >+ if (mimeFilter != m_filterFilesMimeList) { >+ needReload = true; >+ } >+ >+ const KUrl url = m_url; >+ m_url = cg.readEntry("url", m_url); >+ if (url != m_url) { >+ setUrl(m_url); >+ needReload = true; >+ } >+ >+ >+ if (m_iconView) { >+ updateIconViewState(); >+ } >+ >+ if (m_listView) { >+ updateListViewState(); >+ } >+ >+ if (needReload) { >+ //Manually save and restore the icon positions if we need it >+ QStringList iconPositionsData; >+ if (preserveIconPositions && m_iconView) { >+ iconPositionsData = m_iconView->iconPositionsData(); >+ >+ } >+ >+ >+ if (preserveIconPositions && m_iconView) { >+ m_iconView->setIconPositionsData(iconPositionsData); >+ } >+ // So the KFileItemActions will be recreated for the new URL. >+ delete m_itemActions; >+ m_itemActions = 0; >+ m_dirModel->dirLister()->openUrl(m_url); >+ } > } > > FolderView::~FolderView() >@@ -712,8 +818,10 @@ > if (m_sortColumn != -1) { > m_model->invalidate(); > m_model->sort(m_sortColumn, Qt::AscendingOrder); >+ m_model->setDynamicSortFilter(true); > } else if (m_iconView) { > m_iconView->setCustomLayout(true); >+ m_model->setDynamicSortFilter(false); > } > updateSortActionsState(); > cg.writeEntry("sortColumn", m_sortColumn); >@@ -999,19 +1107,20 @@ > > void FolderView::iconSettingsChanged(int group) > { >- if (group == KIconLoader::Desktop && m_iconView) >- { >+ if (group == KIconLoader::Desktop && m_iconView) { > const int size = (m_customIconSize != 0) ? > m_customIconSize : KIconLoader::global()->currentSize(KIconLoader::Desktop); > > m_iconView->setIconSize(QSize(size, size)); >- } >- else if (group == KIconLoader::Panel && m_listView) >- { >+ m_iconView->markAreaDirty(m_iconView->visibleArea()); >+ m_iconView->update(); >+ } else if (group == KIconLoader::Panel && m_listView) { > const int size = (m_customIconSize != 0) ? > m_customIconSize : KIconLoader::global()->currentSize(KIconLoader::Panel); > > m_listView->setIconSize(QSize(size, size)); >+ m_listView->markAreaDirty(m_listView->visibleArea()); >+ m_listView->update(); > } > } > >@@ -1409,6 +1518,8 @@ > > // Create the new menu > m_newMenu = new KNewFileMenu(&m_actionCollection, "new_menu", QApplication::desktop()); >+// m_newMenu->setModal(false); >+ > connect(m_newMenu->menu(), SIGNAL(aboutToShow()), this, SLOT(aboutToShowCreateNew())); > > m_actionCollection.addAction("lock_icons", lockIcons); >@@ -1583,6 +1694,7 @@ > if (column != m_sortColumn) { > m_model->invalidate(); > m_model->sort(column, Qt::AscendingOrder); >+ m_model->setDynamicSortFilter(true); > m_sortColumn = column; > config().writeEntry("sortColumn", m_sortColumn); > emit configNeedsSaving(); >@@ -1683,6 +1795,7 @@ > // If the user has rearranged the icons, the view is no longer sorted > if (m_sortColumn != -1) { > m_sortColumn = -1; >+ m_model->setDynamicSortFilter(false); > updateSortActionsState(); > config().writeEntry("sortColumn", m_sortColumn); > emit configNeedsSaving();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 342479
:
251807
| 251809