Fix desktop icon wandering once and for all!

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1177990 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent b3227b675d
commit d02bf7a4ff

@ -237,11 +237,11 @@ void KDIconView::initDotDirectories()
for ( TQStringList::ConstIterator it = dirs.begin() ; it != dirs.end() ; ++it ) for ( TQStringList::ConstIterator it = dirs.begin() ; it != dirs.end() ; ++it )
{ {
kdDebug(1204) << "KDIconView::initDotDirectories found dir " << *it << endl; kdDebug(1204) << "KDIconView::initDotDirectories found dir " << *it << endl;
TQString dotFileName = *it + "/.directory"; TQString localDotFileName = *it + "/.directory";
if (TQFile::exists(dotFileName)) if (TQFile::exists(localDotFileName))
{ {
KSimpleConfig dotDir(dotFileName, true); // Read only KSimpleConfig dotDir(localDotFileName, true); // Read only
TQStringList groups = dotDir.groupList(); TQStringList groups = dotDir.groupList();
TQStringList::ConstIterator gIt = groups.begin(); TQStringList::ConstIterator gIt = groups.begin();
@ -1019,6 +1019,11 @@ void KDIconView::slotNewItems( const KFileItemList & entries )
KFileItemListIterator it(entries); KFileItemListIterator it(entries);
KFileIVI* fileIVI = 0L; KFileIVI* fileIVI = 0L;
// Ensure that the saved positions had a chance to be loaded
if (!m_dotDirectory) {
initDotDirectories();
}
if (m_nextItemPos.isNull() && !m_dotDirectory) { if (m_nextItemPos.isNull() && !m_dotDirectory) {
// Not found, we'll need to save the new pos // Not found, we'll need to save the new pos
kdDebug(1214)<<"Neither a drop position stored nor m_dotDirectory set"<<endl; kdDebug(1214)<<"Neither a drop position stored nor m_dotDirectory set"<<endl;
@ -1496,9 +1501,6 @@ void KDIconView::updateWorkArea( const TQRect &wr )
if (( iconArea() == wr ) && (m_needDesktopAlign == false)) return; // nothing changed; avoid repaint/saveIconPosition ... if (( iconArea() == wr ) && (m_needDesktopAlign == false)) return; // nothing changed; avoid repaint/saveIconPosition ...
m_needDesktopAlign = false;
lineupIcons();
TQRect oldArea = iconArea(); TQRect oldArea = iconArea();
setIconArea( wr ); setIconArea( wr );
@ -1554,6 +1556,9 @@ void KDIconView::updateWorkArea( const TQRect &wr )
saveIconPositions(); saveIconPositions();
} }
} }
m_needDesktopAlign = false;
lineupIcons();
} }
void KDIconView::setupSortKeys() void KDIconView::setupSortKeys()

Loading…
Cancel
Save