I have made the following changes intended for :
  CE:UX:MTF / lipstick

Please review and accept or decline.
BOSS has already run some checks on this request.
See the "Messages from BOSS" section below.

https://build.pub.meego.com//request/show/7236

Thank You,
Islam Amer

[This message was auto-generated]

---

Request # 7236:

Messages from BOSS:

State: review at 2012-11-01T15:16:29 by bossbot

Reviews:
       accepted by bossbot : Prechecks succeeded.
       new for CE-maintainers : Please replace this text with a review and 
approve/reject the review (not the SR). BOSS will take care of the rest

Changes:
  submit: Project:MTF:UX / lipstick -> CE:UX:MTF / lipstick
  
changes files:
--------------
--- lipstick.changes
+++ lipstick.changes
@@ -0,0 +1,5 @@
+* Thu Nov 01 2012 Robin Burchell <[email protected]> - 0.4.7
+- Provide a way to load launcher positions (from Robin)
+- Allow for system-wide fallback of launcher positions in 
/etc/lipstick.conf(from Robin)
+- Set application version based on .pro version (from Robin)
+

old:
----
  lipstick-0.4.6.tar.bz2

new:
----
  lipstick-0.4.7.tar.bz2

spec files:
-----------
--- lipstick.spec
+++ lipstick.spec
@@ -9,7 +9,7 @@
 # << macros
 
 Summary:    QML toolkit for homescreen creation
-Version:    0.4.6
+Version:    0.4.7
 Release:    1
 Group:      System/Libraries
 License:    LGPLv2.1

other changes:
--------------

++++++ lipstick-0.4.6.tar.bz2 -> lipstick-0.4.7.tar.bz2
--- .gitignore
+++ .gitignore
@@ -0,0 +1,18 @@
+Makefile
+*.o
+*gen_*.h
+*gen_*.cpp
+*gen_*.o
+*moc_*.h
+*moc_*.cpp
+*moc_*.o
+*~
+*.log
+*.log.xml
+*.gcno
+*.gcda
+*.pro.user
+configure-stamp
+build-stamp
+.project
+.cproject
--- plugin/.gitignore
+++ plugin/.gitignore
@@ -0,0 +1 @@
+liblipstickplugin.so
--- src/.gitignore
+++ src/.gitignore
@@ -0,0 +1,2 @@
+liblipstick.*
+pkgconfig
--- src/components/launchermodel.cpp
+++ src/components/launchermodel.cpp
@@ -17,6 +17,8 @@
 #include <QDir>
 #include <QFileSystemWatcher>
 #include <QDebug>
+#include <QSettings>
+
 #include "launchermodel.h"
 
 // Define this if you'd like to see debug messages from the launcher
@@ -62,6 +64,10 @@
             removeItem(item);
     }
 
+    QMap<int, LauncherItem *> itemsWithPositions;
+    QSettings launcherSettings("nemomobile", "lipstick");
+    QSettings globalSettings("/etc/lipstick.conf", QSettings::IniFormat);
+
     // Finding newly added desktop entries
     foreach (const QFileInfo &fileInfo, fileInfoList) {
         // Skip files which are not desktop entries
@@ -76,12 +82,51 @@
             LAUNCHER_DEBUG("Creating LauncherItem for desktop entry" << 
fileInfo.absoluteFilePath());
             LauncherItem *item = new LauncherItem(fileInfo.absoluteFilePath(), 
this);
 
-            if (item->isValid())
-                this->addItem(item);
-            else
+            if (!item->isValid()) {
                 delete item;
+                continue;
+            }
+
+            this->addItem(item);
+
+            QVariant pos = launcherSettings.value("LauncherOrder/" + 
item->filePath());
+
+            // fall back to vendor configuration if the user hasn't specified 
a location
+            if (!pos.isValid())
+                pos = globalSettings.value("LauncherOrder/" + 
item->filePath());
+
+            if (!pos.isValid())
+                continue;
+
+            int gridPos = pos.toInt();
+            itemsWithPositions.insert(gridPos, item);
+            LAUNCHER_DEBUG("Planned move of " << item->filePath() << " to " << 
gridPos);
         }
     }
+
+    // QMap is key-ordered, the int here is the desired position in the 
launcher we want the item to appear
+    // so, we'll iterate from the lowest desired position to the highest, and 
move the items there.
+    for (QMap<int, LauncherItem *>::ConstIterator it = 
itemsWithPositions.constBegin();
+         it != itemsWithPositions.constEnd(); ++it) {
+        LauncherItem *item = it.value();
+        int gridPos = it.key();
+        LAUNCHER_DEBUG("Moving " << item->filePath() << " to " << gridPos);
+
+        if (gridPos < 0 || gridPos >= itemCount()) {
+            qWarning() << Q_FUNC_INFO << "Invalid planned position for " << 
item->filePath();
+            continue;
+        }
+
+        int currentPos = indexOf(item);
+        Q_ASSERT(currentPos >= 0);
+        if (currentPos == -1)
+            continue;
+
+        if (gridPos == currentPos)
+            continue;
+
+        move(currentPos, gridPos);
+    }
 }
 
 QStringList LauncherModel::directories() const
--- src/homeapplication.cpp
+++ src/homeapplication.cpp
@@ -65,7 +65,7 @@
 {
     setApplicationName("Lipstick");
     // TODO: autogenerate this from tags
-    setApplicationVersion("0.4.0");
+    setApplicationVersion(VERSION);
 
     XDamageQueryExtension(QX11Info::display(), &xDamageEventBase, 
&xDamageErrorBase);
 
--- src/notifications/.gitignore
+++ src/notifications/.gitignore
@@ -0,0 +1 @@
+notificationmanageradaptor.*
--- src/src.pro
+++ src/src.pro
@@ -2,9 +2,9 @@
 
 TEMPLATE = lib
 TARGET = lipstick
-VERSION = 0.4.6
+VERSION = 0.4.7
 
-DEFINES += LIPSTICK_BUILD_LIBRARY DEBUG_NOTIFICATIONS
+DEFINES += LIPSTICK_BUILD_LIBRARY DEBUG_NOTIFICATIONS VERSION=\\\"$$VERSION\\\"
 
 CONFIG += qt
 INSTALLS = target
--- tests/ut_categorydefinitionstore/.gitignore
+++ tests/ut_categorydefinitionstore/.gitignore
@@ -0,0 +1 @@
+ut_categorydefinitionstore
--- tests/ut_lipstickdbusinterface/.gitignore
+++ tests/ut_lipstickdbusinterface/.gitignore
@@ -0,0 +1 @@
+ut_lipstickdbusinterface
--- tests/ut_lipsticksettings/.gitignore
+++ tests/ut_lipsticksettings/.gitignore
@@ -0,0 +1 @@
+ut_lipsticksettings
--- tests/ut_notification/.gitignore
+++ tests/ut_notification/.gitignore
@@ -0,0 +1 @@
+ut_notification
--- tests/ut_notificationlistmodel/.gitignore
+++ tests/ut_notificationlistmodel/.gitignore
@@ -0,0 +1 @@
+ut_notificationlistmodel
--- tests/ut_notificationmanager/.gitignore
+++ tests/ut_notificationmanager/.gitignore
@@ -0,0 +1 @@
+ut_notificationmanager
--- tests/ut_notificationpreviewpresenter/.gitignore
+++ tests/ut_notificationpreviewpresenter/.gitignore
@@ -0,0 +1 @@
+ut_notificationpreviewpresenter
--- tools/notificationtool/.gitignore
+++ tools/notificationtool/.gitignore
@@ -0,0 +1,2 @@
+notificationmanagerproxy.*
+notificationtool

++++++ lipstick.yaml
--- lipstick.yaml
+++ lipstick.yaml
@@ -1,6 +1,6 @@
 Name: lipstick
 Summary: QML toolkit for homescreen creation
-Version: 0.4.6
+Version: 0.4.7
 Release: 1
 Group: System/Libraries
 License: LGPLv2.1



Reply via email to