From d02bf7a4ff7f823e15ea2c148f5bdf0b4727a74b Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 21 Sep 2010 21:50:42 +0000 Subject: 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 --- kdesktop/kdiconview.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/kdesktop/kdiconview.cc b/kdesktop/kdiconview.cc index 4124a3e8e..fa7a9d7d0 100644 --- a/kdesktop/kdiconview.cc +++ b/kdesktop/kdiconview.cc @@ -237,11 +237,11 @@ void KDIconView::initDotDirectories() for ( TQStringList::ConstIterator it = dirs.begin() ; it != dirs.end() ; ++it ) { 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::ConstIterator gIt = groups.begin(); @@ -1019,6 +1019,11 @@ void KDIconView::slotNewItems( const KFileItemList & entries ) KFileItemListIterator it(entries); KFileIVI* fileIVI = 0L; + // Ensure that the saved positions had a chance to be loaded + if (!m_dotDirectory) { + initDotDirectories(); + } + if (m_nextItemPos.isNull() && !m_dotDirectory) { // Not found, we'll need to save the new pos kdDebug(1214)<<"Neither a drop position stored nor m_dotDirectory set"<