[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/containments/desktop
From:       Christopher Blauvelt <cblauvelt () gmail ! com>
Date:       2008-01-20 0:20:31
Message-ID: 1200788431.916168.10129.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 763643 by cblauvelt:

Not all the icons appear in the first position when putting icons on the desktop.



 M  +5 -4      iconloader.cpp  
 M  +0 -1      iconloader.h  


--- trunk/KDE/kdebase/workspace/plasma/containments/desktop/iconloader.cpp #763642:763643
@@ -163,9 +163,8 @@
     Plasma::Applet *newApplet = m_desktop->addApplet(QString("icon"),args,0);
     if (newApplet) {
         //kDebug() << "putting" << url.path() << "into the map";
-        if (m_gridAlign) {
-            alignToGrid(newApplet);
-        }
+        //alignToGrid even if m_alignGrid is not set.  Otherwise all the applets appear at point 0,0
+        alignToGrid(newApplet);
         m_iconMap[url.path()] =  newApplet;
     }
 }
@@ -274,7 +273,9 @@
 bool IconLoader::intersectsWithItems(const QRectF item, const QList<Plasma::Applet*> &items) const
 {
     foreach (Plasma::Applet* testItem, items) {
-        if (item.intersects(testItem->sceneBoundingRect())) {
+        //do not use testItem->sceneBoundingRect().  If the item is not drawn yet a size of
+        //0x0 is returned which breaks the algorithm
+        if (item.intersects(QRectF(testItem->scenePos(), testItem->size()))) {
             return true;
         }
     }
--- trunk/KDE/kdebase/workspace/plasma/containments/desktop/iconloader.h #763642:763643
@@ -138,7 +138,6 @@
     bool intersectsWithItems(const QRectF item, const QList<Plasma::Applet*> &items) const;
     QRectF advanceAlongGrid(QRectF rect);
     //bool shiftIcon(Plasma::Applet *icon, Plasma::Applet*);
-    bool isFreePlace(const QPointF &p);
     inline QRectF availableGeometry() const;
 
     KDirLister m_desktopDir;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic