[meego-commits] 11112: Changes to devel:qt-mtf/libmeegotouch
Miroslav Safr
no_reply at build.meego.com
Tue Dec 21 11:36:39 UTC 2010
Hi,
I have made the following changes to libmeegotouch in project devel:qt-mtf. Please review and accept ASAP.
Thank You,
Miroslav Safr
[This message was auto-generated]
---
Request #11112:
submit: home:msafr/libmeegotouch(r29) -> devel:qt-mtf/libmeegotouch
Message:
* Thu Dec 21 2010 Miroslav Safr <miroslav.safr at tieto.com.com> 0.20.66-2
- removed dbus-1 dependency
- update to 0.20.66-2
- added temporary_enable_qdbus_link.patch to fix QDBus dependency
State: new 2010-12-21T03:36:29 msafr
Comment: None
changes files:
--------------
--- libmeegotouch.changes
+++ libmeegotouch.changes
@@ -0,0 +1,5 @@
+* Thu Dec 21 2010 Miroslav Safr <miroslav.safr at tieto.com.com> 0.20.66-2
+- removed dbus-1 dependency
+- update to 0.20.66-2
+- added temporary_enable_qdbus_link.patch to fix QDBus dependency
+
new:
----
temporary_enable_qdbus_link.patch
spec files:
-----------
--- libmeegotouch.spec
+++ libmeegotouch.spec
@@ -19,6 +19,7 @@
Source100: libmeegotouch.yaml
Patch0: arm_ftbfs_egl.patch
Patch1: arm_egl_visibility.patch
+Patch2: temporary_enable_qdbus_link.patch
Requires: meegotouch-theme >= 0.20.63
Requires: libmeegotouch-l10n-en
Requires(post): /sbin/ldconfig
@@ -27,7 +28,6 @@
Requires(postun): /sbin/ldconfig
BuildRequires: pkgconfig(QtOpenGL)
BuildRequires: pkgconfig(contextprovider-1.0)
-BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(gconf-2.0)
BuildRequires: pkgconfig(gstreamer-0.10)
BuildRequires: pkgconfig(gstreamer-base-0.10)
@@ -192,6 +192,8 @@
%patch0 -p1
# arm_egl_visibility.patch
%patch1 -p1
+# temporary_enable_qdbus_link.patch
+%patch2 -p1
# >> setup
# << setup
other changes:
--------------
++++++ libmeegotouch-0.20.66.tar.bz2
--- debian/control
+++ debian/control
@@ -179,7 +179,7 @@
Package: meegotouch-demos-widgetsgallery-tests
Section: devel
Architecture: any
-Depends: ${shlibs:Depends}, meegotestrunner, meegotouch-demos-widgetsgallery (= ${Source-Version})
+Depends: ${shlibs:Depends}, meegotouch-demos-widgetsgallery (= ${Source-Version})
Description: Demo application for MeeGo Touch
Package: meegotouch-demos-appletinstallationsource
@@ -209,7 +209,7 @@
Package: libmeegotouch-tests
Section: extra
Architecture: any
-Depends: ${shlibs:Depends}, testrunner, locales, gstreamer0.10-plugins-base, gstreamer0.10-plugins-good
+Depends: ${shlibs:Depends}, locales, gstreamer0.10-plugins-base, gstreamer0.10-plugins-good
Description: libmeegotouch unit tests
Unit testing binaries and shellscripts for testing libmeegotouch library
--- demos/widgetsgallery/bannerspage.cpp
+++ demos/widgetsgallery/bannerspage.cpp
@@ -125,7 +125,6 @@
{
MBanner *banner = new MBanner();
banner->setStyleName("InformationBanner");
- banner->setIconID("icon-m-camera-scene-landscape-selected");
banner->setTitle("You have 6 meetings in your Agenda");
banner->appear(scene(), MSceneWindow::DestroyWhenDone);
}
@@ -134,6 +133,7 @@
{
MBanner *systemBanner = new MBanner();
systemBanner->setStyleName("SystemBanner");
+ systemBanner->setIconID("icon-m-common-usb");
systemBanner->setTitle("Unable to continue video editing. USB disconnected.");
systemBanner->appear(scene(), MSceneWindow::DestroyWhenDone);
}
--- doc/src/mainclasses.dox
+++ doc/src/mainclasses.dox
@@ -29,7 +29,7 @@
<li>MMessageBox
</ul>
<li>MImageWidget
-<li>MInfoBanner
+<li>MBanner
<li>MLabel
<li>MList
<ul>
--- mapplicationextensionrunner/main.cpp
+++ mapplicationextensionrunner/main.cpp
@@ -93,12 +93,15 @@
return ERROR_APPLICATION_EXTENSION_INIT_FAILED;
}
- MApplication app(argc, argv, metadata.resourceIdentifier(), new MyApplicationService());
+ MApplication *app = new MApplication(argc, argv, metadata.resourceIdentifier(), new MyApplicationService());
MApplicationExtensionRunner runner;
if (!runner.init(argv[1], metadata)) {
qWarning() << "Application extension initialization failed";
return ERROR_APPLICATION_EXTENSION_INIT_FAILED;
}
- return app.exec();
+ int returnValue = app->exec();
+
+ delete app;
+ return returnValue;
}
--- src/corelib/core/mapplication.cpp
+++ src/corelib/core/mapplication.cpp
@@ -507,35 +507,36 @@
void MApplicationPrivate::handleXVisibilityEvent(XVisibilityEvent *xevent)
{
- static const bool wmRunning = MComponentData::isMeeGoWindowManagerRunning();
-
- // Listen only to synthetic events if window
- // manager is running.
- if (xevent->send_event || !wmRunning) {
-
- MWindow * window = MApplicationPrivate::windowForId(xevent->window);
-
- switch (xevent->state) {
- case VisibilityFullyObscured:
+ switch (xevent->state) {
+ case VisibilityFullyObscured:
+ // Listen only to synthetic events by compositor
+ if (xevent->send_event)
+ {
+ MWindow * window = MApplicationPrivate::windowForId(xevent->window);
if (window) {
window->d_ptr->fullyObscured = true;
if (!window->d_ptr->visibleInSwitcher) {
setWindowVisibility(window, false);
}
}
- break;
+ }
+ break;
- case VisibilityUnobscured:
- case VisibilityPartiallyObscured:
+ // Always listen to these events, because if compositor is not running
+ // we are not getting any synthetic events at all and the window would never get
+ // the display entered signal.
+ case VisibilityUnobscured:
+ case VisibilityPartiallyObscured:
+ {
+ MWindow * window = MApplicationPrivate::windowForId(xevent->window);
if (window) {
window->d_ptr->fullyObscured = false;
setWindowVisibility(window, true);
}
- break;
-
- default:
- break;
}
+ break;
+ default:
+ break;
}
}
--- src/corelib/core/mcomponentdata.cpp
+++ src/corelib/core/mcomponentdata.cpp
@@ -56,12 +56,10 @@
#include "mgraphicssystemhelper.h"
#ifdef Q_WS_X11
-#include <QX11Info>
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
#ifdef HAVE_XDAMAGE
+#include <QX11Info>
#include <X11/extensions/Xfixes.h>
-#endif // HAVE_XDAMAGE
+#endif // HAVE_XFIXES
#endif // Q_WS_X11
namespace
@@ -1174,62 +1172,6 @@
}
#ifdef Q_WS_X11
-static int handleXError(Display *, XErrorEvent *)
-{
- return 0;
-}
-#endif // Q_WS_X11
-
-bool MComponentData::isMeeGoWindowManagerRunning()
-{
- bool retValue = false;
-
-#ifdef Q_WS_X11
-
- Display *dpy = QX11Info::display();
- Window rootw = RootWindow(dpy, XDefaultScreen(dpy));
- Atom wmSupportAtom = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False);
- Atom type;
- int format;
- unsigned long numItems;
- unsigned long bytesAfter;
- unsigned char *data = 0;
-
- if (XGetWindowProperty(dpy, rootw, wmSupportAtom, 0, 1, False, XA_WINDOW,
- &type, &format, &numItems, &bytesAfter, &data) == Success) {
- if (data) {
-
- Window wid = *(reinterpret_cast<Window *>(data));
- XFree(data);
- data = 0;
-
- Atom wmNameAtom = XInternAtom(dpy, "WM_NAME", False);
-
- // Set error handler because window wid we got might not exist and
- // the following name query would fail.
- int (*previousHandler)(Display *, XErrorEvent *) = XSetErrorHandler(handleXError);
-
- if (XGetWindowProperty(dpy, wid, wmNameAtom, 0, 16, False, XA_STRING,
- &type, &format, &numItems, &bytesAfter, &data) == Success) {
- if (data) {
- if (strcmp(reinterpret_cast<const char *>(data), "MCompositor") == 0) {
- retValue = true;
- }
-
- XFree(data);
- data = 0;
- }
- }
-
- XSetErrorHandler(previousHandler);
- }
- }
-#endif // Q_WS_X11
-
- return retValue;
-}
-
-#ifdef Q_WS_X11
QStack<MComponentData::ChainData> MComponentDataPrivate::chainData;
void MComponentData::pushChainData(const ChainData &newChainData)
--- src/corelib/core/mcomponentdata.h
+++ src/corelib/core/mcomponentdata.h
@@ -186,9 +186,6 @@
//! Sets whether MComponentData should automatically load m input context
static void setLoadMInputContext(bool enable);
- //! Returns whether MCompositor is present
- static bool isMeeGoWindowManagerRunning();
-
//! \internal
static M::OrientationAngle forcedOrientationAngle();
--- src/corelib/core/minputmethodstate.cpp
+++ src/corelib/core/minputmethodstate.cpp
@@ -175,8 +175,12 @@
}
ToolbarInfo *toolbar = d->toolbars[id];
- toolbar->items[item][attribute] = value;
- emit toolbarItemAttributeChanged(id, item, attribute, value);
+ bool changed = (value != toolbar->items[item][attribute]);
+
+ if (changed) {
+ toolbar->items[item][attribute] = value;
+ emit toolbarItemAttributeChanged(id, item, attribute, value);
+ }
}
QString MInputMethodState::toolbar(int id) const
--- src/corelib/core/minputwidgetrelocator.cpp
+++ src/corelib/core/minputwidgetrelocator.cpp
@@ -28,12 +28,13 @@
#include "mrelocatorstyle.h"
#include "mscrollchain.h"
-#include <QDebug>
#include <QGraphicsScene>
#include <QGraphicsWidget>
-#include <QTimer>
namespace {
+
+ const char * const BottomDockingProperty = "dockBottom";
+
bool widgetDoesNotWantToBeScrolled(const QGraphicsWidget *widget)
{
// We don't know where to scroll QGraphicsWebView. We would only make things worse by trying.
@@ -133,9 +134,11 @@
const QRect microRect(microFocusRect(inputWidget));
if (microRect.isValid() && newChain->count() > 0) {
+ const bool widgetWasDocked = scrollDockedWidget(newChain, inputWidget, microRect);
- // Check whether we need to do anything.
- if (needsRelocation(inputWidget, microRect)) {
+ // If widget was not docked then use the regular rules with nogo zones
+ // and an anchor point.
+ if (!widgetWasDocked && needsRelocation(inputWidget, microRect)) {
// Calculate anchor point in root coordinates
const QPoint anchorPoint(rootElement->mapFromItem(inputWidget, microRect.topLeft()).x(),
@@ -334,7 +337,68 @@
{
// Widget can be clipped by a nested pannable viewport.
return !widget->isClipped()
- || widget->clipPath().contains(localRect);
+ || widget->clipPath().boundingRect().contains(localRect);
+}
+
+bool MInputWidgetRelocator::scrollDockedWidget(MScrollChain *chain,
+ const QGraphicsWidget *inputWidget,
+ const QRect µRect)
+{
+ // Find if we have scroller that wants to be docked to bottom.
+ const QGraphicsWidget *dockWidget = 0;
+ int dockWidgetId = -1;
+ for (int i = 0; i < chain->count(); ++i) {
+ QVariant dockBottom(chain->widgetAt(i)->property(BottomDockingProperty));
+ if (dockBottom.isValid()
+ && dockBottom.toBool()) {
+ dockWidgetId = i;
+ dockWidget = chain->widgetAt(i);
+ break;
+ }
+ }
+
+ if (!dockWidget) {
+ return false;
+ }
+
+ // This is the rectangle we need to dock and preferably even keep it fully visible.
+ const QRect dockWidgetRect(dockWidget->rect().toRect());
+
+ // Origin of the rectangle has to be given to the chain in inputWidget coordinates.
+ const QPoint originPoint = inputWidget->mapFromItem(dockWidget,
+ dockWidgetRect.topLeft()).toPoint();
+
+ // Calculate target rectangle for the widget to be docked.
+ QRect targetRect = rootElement->mapRectFromItem(dockWidget, dockWidgetRect).toRect();
+
+ bool chainChanged = false;
+
+ // Dock the widget if only it's not already at correct position.
+ if (targetRect.bottom() != exposedContentRect().bottom()
+ || !isWidgetRectFullyVisible(dockWidget, dockWidgetRect)) {
+
+ // Move it to bottom of exposed content rectangle.
+ targetRect.moveBottom(exposedContentRect().bottom());
+
+ // Docking is done by parents of the dockWidget, therefore start at the next scroller.
+ chain->addBottomUpScroll(targetRect, originPoint, dockWidgetId + 1);
+
+ chainChanged = true;
+ }
+
+ // We still need to bring cursor visible, although we cannot guarantee it because
+ // docking at a right place is of higher priority. Use dockWidget and its children
+ // scrollers to scroll cursor rectangle visible. Don't touch parents of dockWidget.
+ if (!isWidgetRectFullyVisible(inputWidget, microRect)) {
+ chain->addMinimalScroll(microRect, 0, dockWidgetId);
+ chainChanged = true;
+ }
+
+ if (chainChanged) {
+ chain->applyScrolling();
+ }
+
+ return true;
}
void MInputWidgetRelocator::centerContextWidgetToAnchorPoint(MScrollChain *newChain,
@@ -345,6 +409,7 @@
const int yTarget = qMax<int>(exposedContentRect().top(),
anchorPoint.y() - contextWidget->size().height() / 2);
const QRect targetRect(QPoint(anchorPoint.x(), yTarget), contextWidget->size().toSize());
+
const QPoint originPoint(contextWidget->mapToItem(inputWidget, 0, 0).toPoint());
newChain->addBottomUpScroll(targetRect, originPoint, 1);
}
--- src/corelib/core/minputwidgetrelocator.h
+++ src/corelib/core/minputwidgetrelocator.h
@@ -133,6 +133,12 @@
bool isWidgetRectFullyVisible(const QGraphicsWidget *widget,
const QRect &localRect) const;
+ //! If chain contains a dockable widget, dock it and return true.
+ //! Otherwise return false.
+ bool scrollDockedWidget(MScrollChain *chain,
+ const QGraphicsWidget *inputWidget,
+ const QRect µRect);
+
void centerContextWidgetToAnchorPoint(MScrollChain *newChain,
const QPoint &anchorPoint,
const QGraphicsWidget *inputWidget);
--- src/corelib/core/mpannableviewportscroller.cpp
+++ src/corelib/core/mpannableviewportscroller.cpp
@@ -24,35 +24,40 @@
QPoint MPannableViewportScroller::queryScrollingAmount(const QGraphicsWidget *widget,
const QRect &targetRect,
const QPoint &originPoint,
- const QPoint &)
+ const QPoint ¤tOffset)
{
const MPannableViewport *viewport = static_cast<const MPannableViewport *>(widget);
- if (viewport->panDirection() == 0) {
+ if (viewport->verticalPanningPolicy() == MPannableViewport::PanningAlwaysOff) {
return QPoint(); // unable to scroll
}
+ // We won't be scrolling horizontally currently to prevent movement caused by
+ // errors in container widget margins etc. It's straightforward to add if needed.
+
// First ensure that target rectangle is inside of area of the pannable viewport.
// Note: We might even move against the wanted direction but this is required to
// ensure the visibility of the area marked by target rectangle.
QRect visibleTargetRect(targetRect);
- moveRectInsideArea(viewport->contentsRect().toRect(), visibleTargetRect);
+ moveRectInsideArea(viewport->rect().toRect(), visibleTargetRect);
// Calculate how much pannable contents should be translated.
const QPoint contentsOffset(visibleTargetRect.topLeft() - originPoint);
+ // Take into consideration how much we have already promised to scroll.
+ const QPointF currentPosition = viewport->position() - currentOffset;
+
// Calculate the new panning position, i.e. position of the pannable viewport
// in panned widget coordinates.
- QPointF panningPos(viewport->position() - contentsOffset);
+ QPointF panningPos(currentPosition - contentsOffset);
// Get allowed range for position to be used with MPannableWidget::setPosition().
QRectF posRange = viewport->range();
// ...and limit our panning accordingly.
- panningPos.rx() = qBound(posRange.left(), panningPos.x(), posRange.right());
panningPos.ry() = qMax(posRange.top(), panningPos.y()); // We can extend bottom limit.
- const QPoint translation((viewport->position() - panningPos).toPoint());
+ const QPoint translation(0, currentPosition.y() - panningPos.y());
return translation;
}
--- src/corelib/core/mscrollchain.cpp
+++ src/corelib/core/mscrollchain.cpp
@@ -61,6 +61,24 @@
}
}
+void MScrollChain::addMinimalScroll(const QRect &localRect,
+ int startingIndex,
+ int untilIndex)
+{
+ untilIndex = qBound<int>(0, untilIndex, chainItems.count() - 1);
+ startingIndex = qBound<int>(0, startingIndex, untilIndex);
+
+ for (int i = startingIndex; i <= untilIndex; ++i) {
+ ScrollChainItem &chainItem(chainItems[i]);
+
+ // Map target rectangle and origin point to delegate widget's local coordinates.
+ QRect delegateRect = mapToChainItemFromScrollTarget(chainItem, localRect);
+
+ // Scroll the chain item.
+ chainItem.calculateScrolling(delegateRect, delegateRect.topLeft());
+ }
+}
+
void MScrollChain::applyScrolling()
{
for (ChainItemList::iterator item = chainItems.begin(); item != chainItems.end(); ++item) {
@@ -198,6 +216,15 @@
return mappedPoint;
}
+
+QRect MScrollChain::mapToChainItemFromScrollTarget(const ScrollChainItem &item,
+ const QRect &rect)
+{
+ QRect moved = rect;
+ moved.moveTo(mapToChainItemFromScrollTarget(item, rect.topLeft()));
+ return moved;
+}
+
QSharedPointer<MAbstractScroller> MScrollChain::findScrollerDelegate(const QGraphicsWidget *widget) const
{
QSharedPointer<MAbstractScroller> result;
--- src/corelib/core/mscrollchain.h
+++ src/corelib/core/mscrollchain.h
@@ -73,6 +73,15 @@
const QPoint &originPoint,
int startingIndex = 0);
+ /*! \brief Scrolls the chain with minimal change in child-to-parent order.
+ *
+ * Calling this ensures that the given \localRect is made visible with
+ * minimal scrolling.
+ */
+ void addMinimalScroll(const QRect &localRect,
+ int startingIndex,
+ int untilIndex);
+
/*! \brief Applies the planned scrolling
*
* Widgets are not expected to have finished their scrolling when this returns.
@@ -142,6 +151,8 @@
QRect mapToChainItemFromRoot(const ScrollChainItem &item, const QRect &rect) const;
QPoint mapToChainItemFromRoot(const ScrollChainItem &item, const QPoint &point) const;
QPoint mapToChainItemFromScrollTarget(const ScrollChainItem &item, const QPoint &point);
+ QRect mapToChainItemFromScrollTarget(const ScrollChainItem &item,
+ const QRect &rect);
private:
typedef QMap<const QMetaObject *, QSharedPointer<MAbstractScroller> > ScrollerDelegateMap;
--- src/corelib/scene/mscenemanager.cpp
+++ src/corelib/scene/mscenemanager.cpp
@@ -870,7 +870,7 @@
data[0] = statusBarGeometry.x();
data[1] = statusBarGeometry.y();
data[2] = statusBarGeometry.width();
- data[3] = statusBarGeometry.height();
+ data[3] = statusBar->property("sharedPixmapHeight").value<qreal>();
}
Display *dpy = QX11Info::display();
--- src/corelib/style/mstylesheetparser.cpp
+++ src/corelib/style/mstylesheetparser.cpp
@@ -39,7 +39,7 @@
#include <sys/stat.h>
namespace {
- const unsigned int FILE_VERSION = 16;
+ const unsigned int FILE_VERSION = 17;
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -51,7 +51,7 @@
QChar read(QFile &stream, const QByteArray &delimeters, QByteArray &out);
QChar peek(QFile &stream, const QByteArray &delimeters, QByteArray &out);
- bool load(const QFileInfo &fileInfo, QHash<QByteArray, QByteArray>* constants);
+ bool load(const QString &filename, QHash<QByteArray, QByteArray>* constants, bool toplevel);
/**
\brief Parse a stylesheet \a file.
@@ -69,26 +69,26 @@
/**
\brief Get the \a file name for a binary stylesheet cache file corresponding to the
original stylesheet file.
- \param fileInfo a QFileInfo for the filename, reused if possible to avoid unnecessary file IO.
*/
- QString createBinaryFilename(const QFileInfo &fileInfo) const;
+ QString createBinaryFilename(const QString &filename) const;
QList<MStyleSheetParser::StylesheetFileInfo *> fileInfoList;
MStyleSheetParser::StylesheetFileInfo *privateFileInfo;
/**
\brief Load a previously-cached binary version of the style.
- \param cssFileInfo The file info of the opened stylesheet file.
\param binaryFilename The binary stylesheet file.
*/
- bool loadBinary(const QFileInfo &cssFileInfo, const QString &binaryFilename);
+ bool loadBinary(const QString &binaryFilename);
/**
- \brief Write the binary stylesheet data to a file on disk.
- \param info The parsed stylesheet data.
+ \brief Write all binary stylesheet data to a file on disk.
\param binaryFilename The file to create.
*/
- bool dump(const MStyleSheetParser::StylesheetFileInfo &info, const QString &binaryFilename);
+ bool dump(const QString &binaryFilename);
+
+ void writeStylesheetFileInfo(MStyleSheetParser::StylesheetFileInfo *selector, QDataStream &stream);
+ MStyleSheetParser::StylesheetFileInfo * readStylesheetFileInfo(QDataStream &stream);
MStyleSheetSelector *readSelector(const QByteArray &file, QDataStream &stream);
void writeSelector(MStyleSheetSelector *selector, QDataStream &stream);
@@ -125,6 +125,18 @@
};
+// faster than QFileInfo::lastModified().toTime_t()
+time_t modificationTime(const char* filename)
+{
+ struct stat fileInfo;
+ int result = stat(filename, &fileInfo);
+ if (result != 0) {
+ return 0;
+ } else {
+ return fileInfo.st_mtime;
+ }
+}
+
QSet<QByteArray> MStyleSheetParserPrivate::stringCache;
#endif
@@ -365,27 +377,28 @@
return result;
}
-bool MStyleSheetParserPrivate::load(const QFileInfo &fileInfo, QHash<QByteArray, QByteArray>* constants)
+bool MStyleSheetParserPrivate::load(const QString &filename, QHash<QByteArray, QByteArray>* constants, bool toplevel)
{
globalConstants = constants;
- const QString binaryFilename = createBinaryFilename(fileInfo);
+ const QString binaryFilename = createBinaryFilename(filename);
if (binaryFileMode) {
// If binary file mode is enabled, we'll check if there's binary
// file available instead of the ASCII css to speed-up the loading process
- if (fileInfo.exists() && loadBinary(fileInfo, binaryFilename))
+ if (toplevel && loadBinary(binaryFilename)) {
return true;
+ }
}
- QFile file(fileInfo.filePath());
+ QFile file(filename);
if (file.open(QFile::ReadOnly)) {
//mDebug("MStyleSheetParserPrivate") << "Loading ASCII css file" << filename;
privateFileInfo = new MStyleSheetParser::StylesheetFileInfo;
- privateFileInfo->filename = qPrintable(fileInfo.filePath());
+ privateFileInfo->filename = qPrintable(filename);
- bool result = parse(file, fileInfo);
+ bool result = parse(file, filename);
file.close();
if (result || syntaxMode == MStyleSheetParser::RelaxedSyntax) {
@@ -393,8 +406,10 @@
// dump this file to the disk for faster access in future?
if (binaryFileMode) {
- privateFileInfo->time_t = fileInfo.lastModified().toTime_t();
- dump(*privateFileInfo, binaryFilename);
+ privateFileInfo->time_t = modificationTime(qPrintable(filename));
+ if (toplevel) {
+ dump(binaryFilename);
+ }
}
privateFileInfo = NULL;
@@ -406,7 +421,7 @@
}
}
- mWarning("MStyleSheetParserPrivate") << "Failed to open stylesheet file:" << fileInfo.filePath();
+ mWarning("MStyleSheetParserPrivate") << "Failed to open stylesheet file:" << filename;
return false;
}
@@ -603,14 +618,14 @@
}
// add imported file to include list
QByteArray includeFileName = parsedFileInfo.absolutePath().toAscii() + QDir::separator().toAscii() + filename;
- uint lastModified = QFileInfo(includeFileName).lastModified().toTime_t();
+ uint lastModified = modificationTime(includeFileName.constData());
privateFileInfo->includes.push_back(QPair<QByteArray, uint>(includeFileName, lastModified));
// parse the file
MStyleSheetParserPrivate parser(logicalValues);
parser.binaryDirectory = binaryDirectory;
parser.binaryFileMode = binaryFileMode;
- if (parser.load(QFileInfo(parsedFileInfo.absolutePath() + QDir::separator() + filename), globalConstants) ||
+ if (parser.load(parsedFileInfo.absolutePath() + QDir::separator() + filename, globalConstants, false) ||
syntaxMode == MStyleSheetParser::RelaxedSyntax) {
// add all the new file infos into the list of parsed files
while (parser.fileInfoList.count() > 0) {
@@ -921,10 +936,10 @@
return QPair<QByteArray, MStyleSheetAttribute *> ("", NULL);
}
-QString MStyleSheetParserPrivate::createBinaryFilename(const QFileInfo &fileInfo) const
+QString MStyleSheetParserPrivate::createBinaryFilename(const QString &filename) const
{
QString binaryFilename(binaryDirectory);
- QString absoluteFilePathEncoded(fileInfo.absoluteFilePath());
+ QString absoluteFilePathEncoded(filename);
absoluteFilePathEncoded.replace('_', "__");
absoluteFilePathEncoded.replace('/', "_.");
binaryFilename += absoluteFilePathEncoded;
@@ -985,7 +1000,7 @@
Q_D(MStyleSheetParser);
QHash<QByteArray, QByteArray> constants;
- bool result = d->load(QFileInfo(filename), &constants);
+ bool result = d->load(filename, &constants, true);
// uncomment for debug output
//d->debugOutput();
return result;
@@ -1023,20 +1038,13 @@
return d->syntaxMode;
}
-bool MStyleSheetParserPrivate::loadBinary(const QFileInfo &cssFileInfo, const QString &binaryFilename)
+bool MStyleSheetParserPrivate::loadBinary(const QString &binaryFilename)
{
- // Check that the file exists:
if (!QFile::exists(binaryFilename))
return false;
- // all ok, proceed to loading phase
QFile file(binaryFilename);
if (file.open(QFile::ReadOnly)) {
-
- //mDebug("MStyleSheetParserPrivate") << "Loading binary css file" << binaryFilename;
- bool result = false;
-
- // Create readable datastream
QDataStream stream(&file);
unsigned int file_version;
@@ -1044,131 +1052,136 @@
if (file_version == FILE_VERSION) {
// read fileinfo
- MStyleSheetParser::StylesheetFileInfo *fileinfo = new MStyleSheetParser::StylesheetFileInfo;
- stream >> fileinfo->time_t;
- if (fileinfo->time_t != cssFileInfo.lastModified().toTime_t()) {
- // date of binary file does not match the one of the css
- // binary file needs to be recreated
- return false;
+ QList<QPair<QByteArray, qint64> > timestamps;
+ stream >> timestamps;
+ QListIterator<QPair<QByteArray, qint64> > it(timestamps);
+
+ while (it.hasNext()) {
+ QPair<QByteArray, qint64> ts = it.next();
+
+ time_t current = modificationTime(ts.first.constData());
+ if (current != ts.second) {
+ mDebug("MStyleSheetParserPrivate") << "Timestamp for" << ts.first << "changed. Recreating" << binaryFilename;
+ return false;
+ }
}
- stream >> fileinfo->filename;
- stream >> fileinfo->includes;
- stream >> fileinfo->constants;
-
QList<uint> logicalTimestamps;
stream >> logicalTimestamps;
- if (logicalValues && logicalTimestamps.length() > 0 && logicalTimestamps != logicalValues->timestamps()) {
+ if (logicalValues && logicalTimestamps != logicalValues->timestamps()) {
// the logical values have been updated. our constants may have changed
+ mDebug("MStyleSheetParserPrivate") << "Recreating" << binaryFilename << "as constants changed";
return false;
}
-
- // load includes
- const int includesCount = fileinfo->includes.count();
- for (int i = 0; i < includesCount; ++i) {
- fileinfo->includes[i].first = cachedString(fileinfo->includes[i].first);
- QFileInfo fileInfo(fileinfo->includes[i].first);
- if (fileinfo->includes[i].second != fileInfo.lastModified().toTime_t()) {
- // timestamp of included file changed, contants may have changed.
- return false;
- }
- load(fileInfo, globalConstants);
- }
- QHashIterator<QByteArray, QByteArray> i(fileinfo->constants);
- while (i.hasNext()) {
- i.next();
- if (globalConstants->contains(i.key())) {
- outputParseWarning(fileinfo->filename, "Multiple definition of constant \"" + i.key() + "\". Ignoring redefinition.", 0);
- } else {
- globalConstants->insert(cachedString(i.key()), cachedString(i.value()));
- }
+ int nrOfFiles;
+ stream >> nrOfFiles;
+ for (int i = 0; i < nrOfFiles; ++i) {
+ MStyleSheetParser::StylesheetFileInfo *fi = readStylesheetFileInfo(stream);
+ fileInfoList.append(fi);
}
-
- // parse the rest of the file
- int selectorCount;
-
- // read all selectors
- stream >> selectorCount;
- for (int i = 0; i < selectorCount; ++i) {
- MStyleSheetSelector *selector = readSelector(fileinfo->filename, stream);
- fileinfo->selectors.push_back(selector);
- }
-
- // read all selectors with parent
- stream >> selectorCount;
- for (int i = 0; i < selectorCount; ++i) {
- MStyleSheetSelector *selector = readSelector(fileinfo->filename, stream);
- fileinfo->parentSelectors.push_back(selector);
- }
-
- fileInfoList.push_back(fileinfo);
-
- result = true;
+ return true;
}
file.close();
-
- return result;
+ return true;
}
- mWarning("MStyleSheetParserPrivate") << "Failed to load binary stylesheet file:" << cssFileInfo.filePath();
-
+ mWarning("MStyleSheetParserPrivate") << "Failed to load binary stylesheet file:" << binaryFilename;
return false;
}
-bool MStyleSheetParserPrivate::dump(const MStyleSheetParser::StylesheetFileInfo &info, const QString &binaryFilename)
+bool MStyleSheetParserPrivate::dump(const QString &binaryFilename)
{
QFile file(binaryFilename);
if (!file.open(QFile::WriteOnly)) {
//Maybe it failed because the directory doesn't exist
- QDir().mkpath( QFileInfo(binaryFilename).absolutePath() );
+ QDir().mkpath(QFileInfo(binaryFilename).absolutePath() );
if (!file.open(QFile::WriteOnly)) {
- mDebug("MStyleSheetParserPrivate") << "Failed to dump stylesheet file:" << info.filename << "to" << binaryFilename;
+ mDebug("MStyleSheetParserPrivate") << "Failed to dump stylesheet file:" << binaryFilename;
return false;
}
}
- // Create writable datastream
- QDataStream stream(&file);
+ // collect timestamps
+ QList<QPair<QByteArray, qint64> > timestamps;
+ QList<MStyleSheetParser::StylesheetFileInfo *>::const_iterator fileInfoListEnd = fileInfoList.constEnd();
+ for (QList<MStyleSheetParser::StylesheetFileInfo *>::const_iterator fi = fileInfoList.constBegin();
+ fi != fileInfoListEnd;
+ ++fi) {
+ timestamps.append(QPair<QByteArray, qint64>((*fi)->filename, (*fi)->time_t));
+ }
+ QDataStream stream(&file);
stream << FILE_VERSION;
- stream << info.time_t;
- stream << info.filename;
- stream << info.includes;
- stream << info.constants;
+ stream << timestamps;
if (logicalValues) {
stream << logicalValues->timestamps();
} else {
stream << QList<uint>();
}
+ stream << fileInfoList.count();
+
+ for (QList<MStyleSheetParser::StylesheetFileInfo *>::const_iterator fi = fileInfoList.constBegin();
+ fi != fileInfoListEnd;
+ ++fi) {
+ writeStylesheetFileInfo(*fi, stream);
+ }
+
+ return true;
+}
- // write number of selectors
- stream << info.selectors.count();
+void MStyleSheetParserPrivate::writeStylesheetFileInfo(MStyleSheetParser::StylesheetFileInfo *fi, QDataStream &stream)
+{
+ stream << fi->filename;
+ stream << fi->time_t;
- // write all selectors
- QList<MStyleSheetSelector *>::const_iterator infoSelectorsEnd = info.selectors.constEnd();
- for (QList<MStyleSheetSelector *>::const_iterator iterator = info.selectors.constBegin();
+ stream << fi->selectors.count();
+ // write all selectors without parent
+ QList<MStyleSheetSelector *>::const_iterator infoSelectorsEnd = fi->selectors.constEnd();
+ for (QList<MStyleSheetSelector *>::const_iterator iterator = fi->selectors.constBegin();
iterator != infoSelectorsEnd;
++iterator) {
writeSelector(*iterator, stream);
}
// write all selectors with parent
- stream << info.parentSelectors.count();
- infoSelectorsEnd = info.parentSelectors.constEnd();
- for (QList<MStyleSheetSelector *>::const_iterator iterator = info.parentSelectors.constBegin();
+ stream << fi->parentSelectors.count();
+ infoSelectorsEnd = fi->parentSelectors.constEnd();
+ for (QList<MStyleSheetSelector *>::const_iterator iterator = fi->parentSelectors.constBegin();
iterator != infoSelectorsEnd;
++iterator) {
writeSelector(*iterator, stream);
}
-
- file.close();
- return true;
}
+MStyleSheetParser::StylesheetFileInfo * MStyleSheetParserPrivate::readStylesheetFileInfo(QDataStream &stream)
+{
+ MStyleSheetParser::StylesheetFileInfo *fi = new MStyleSheetParser::StylesheetFileInfo;
+
+ stream >> fi->filename;
+ stream >> fi->time_t;
+
+ int selectorCount;
+ stream >> selectorCount;
+ // read all selectors without parent
+ for (int i = 0; i < selectorCount; ++i) {
+ MStyleSheetSelector *selector = readSelector(fi->filename, stream);
+ fi->selectors.push_back(selector);
+ }
+
+ // read all selectors with parent
+ stream >> selectorCount;
+ for (int i = 0; i < selectorCount; ++i) {
+ MStyleSheetSelector *selector = readSelector(fi->filename, stream);
+ fi->parentSelectors.push_back(selector);
+ }
+
+ return fi;
+}
+
MStyleSheetSelector *MStyleSheetParserPrivate::readSelector(const QByteArray &file, QDataStream &stream)
{
QByteArray parentName, parentObjectName, objectName, className, classType, mode;
@@ -1276,7 +1289,6 @@
return MStyleSheetSelector::UndefinedOrientation;
}
-
void MStyleSheetParser::operator += (const MStyleSheetParser &stylesheet)
{
Q_D(MStyleSheetParser);
--- src/corelib/theme/mtheme.cpp
+++ src/corelib/theme/mtheme.cpp
@@ -714,6 +714,7 @@
MThemePrivate::MThemePrivate(const QString &applicationName, MTheme::ThemeService themeService) :
applicationName(applicationName),
customStylesheet(NULL),
+ invalidPixmap(0),
application(new MAssembly(applicationName)),
palette(logicalValues),
fonts(logicalValues)
@@ -743,9 +744,6 @@
} break;
}
- invalidPixmap = new QPixmap(50, 50);
- invalidPixmap->fill(QColor(255, 64, 64, 255));
-
// this loads the current theme
reloadThemeLibraries(themeDaemon->themeLibraryNames());
refreshLocalThemeConfiguration(themeDaemon->themeInheritanceChain());
@@ -948,6 +946,10 @@
if (!pixmapHandle.isValid()) {
mWarning("MThemePrivate") << "pixmapChangedSlot - pixmap reload failed (null handle):" << identifier;
+ if (!invalidPixmap) {
+ invalidPixmap = new QPixmap(50, 50);
+ invalidPixmap->fill(QColor(255, 64, 64, 255));
+ }
*pixmap = *invalidPixmap;
pixmapRequestFinished();
--- src/corelib/widgets/mapplicationwindow.cpp
+++ src/corelib/widgets/mapplicationwindow.cpp
@@ -109,17 +109,27 @@
MApplicationWindowPrivate::~MApplicationWindowPrivate()
{
- delete dockWidget;
- dockWidget = 0;
- delete toolBar;
- toolBar = 0;
- delete menu;
- menu = 0;
- delete navigationBar;
- navigationBar = 0;
- delete homeButtonPanel;
- homeButtonPanel = 0;
-
+ if (dockWidget) {
+ delete dockWidget;
+ dockWidget = 0;
+ }
+ if (toolBar) {
+ delete toolBar;
+ toolBar = 0;
+ }
+
+ if (menu) {
+ delete menu;
+ menu = 0;
+ }
+ if (navigationBar) {
+ delete navigationBar;
+ navigationBar = 0;
+ }
+ if (homeButtonPanel) {
+ delete homeButtonPanel;
+ homeButtonPanel = 0;
+ }
if (statusBar) {
delete statusBar;
statusBar = 0;
--- src/corelib/widgets/mapplicationwindow_p.h
+++ src/corelib/widgets/mapplicationwindow_p.h
@@ -56,11 +56,11 @@
virtual ~MApplicationWindowPrivate();
QPointer<MApplicationPage> page;
- MNavigationBar *navigationBar;
- MToolBar *toolBar;
- MDockWidget *dockWidget;
- MHomeButtonPanel *homeButtonPanel;
- MApplicationMenu *menu;
+ QPointer<MNavigationBar> navigationBar;
+ QPointer<MToolBar> toolBar;
+ QPointer<MDockWidget> dockWidget;
+ QPointer<MHomeButtonPanel> homeButtonPanel;
+ QPointer<MApplicationMenu> menu;
QPointer<MSceneWindow> statusBar;
QTimer autoHideComponentsTimer;
QList<MSceneWindow *> componentsOnAutoHide;
--- src/corelib/widgets/mbanner.h
+++ src/corelib/widgets/mbanner.h
@@ -38,8 +38,8 @@
Although we haven't defined different views for the MBanner, we consider those three types:
\li An event banner is a MBanner with an icon, title and subtitle.
- \li An information banner is a MBanner with a title and icon
- \li An system banner is a MBanner with a title (only one label)
+ \li An information banner is a MBanner with a title
+ \li An system banner is a MBanner with a title and an icon
You should set the stylename through setStyleName() with one of the following names:
@@ -113,7 +113,6 @@
\code
MBanner *infoBanner = new MBanner();
infoBanner->setStyleName("InformationBanner");
- infoBanner->setIconID("icon-m-telephony-call-answer");
infoBanner->setTitle("Info banner with so much information that the text wraps in portrait");
infoBanner->appear(scene(), MSceneWindow::DestroyWhenDone);
\endcode
@@ -122,6 +121,7 @@
\code
MBanner *systemBanner = new MBanner();
systemBanner->setStyleName("SystemBanner");
+ systemBanner->setIconID("icon-m-common-usb");
systemBanner->setTitle("System banner");
systemBanner->appear(scene(), MSceneWindow::DestroyWhenDone);
\endcode
--- src/corelib/widgets/mpannableviewport.cpp
+++ src/corelib/widgets/mpannableviewport.cpp
@@ -94,7 +94,7 @@
// Assume only bottom part of pannable area is covered by SIP.
const int overlappingHeight = (q->mapRectFromScene(imArea).toRect()
- & q->contentsRect().toRect()).height();
+ & q->rect().toRect()).height();
// Increase panning range to so that user can pan areas beneath
// software input panel visible.
@@ -131,7 +131,7 @@
// This privileged scrolling extends the range if necessary.
const qreal bottomRangeExtension = endPosition.y()
- + q->contentsRect().height()
+ + q->size().height()
- pannedWidget->size().height();
setAutoScrollingExtension(qMax<qreal>(0.0, bottomRangeExtension));
@@ -236,9 +236,15 @@
// If current position is bigger than new panned widget size (in panning direction) then
// position should be updated to avoid unnecessary panning animation.
if (q->panDirection().testFlag(Qt::Vertical)) {
- qreal updatedPosition = pannedWidget->size().height() - q->size().height();
- if(updatedPosition < q->position().y())
- q->setPosition(QPointF(q->position().x(), qMax((qreal)0, updatedPosition)));
+
+ // Need to update range so we can use it here.
+ applyAutoRange();
+
+ // Note that range also contains the height extension.
+ const qreal rangeBottomLimit = q->range().bottom();
+ if (rangeBottomLimit < q->position().y()) {
+ q->setPosition(QPointF(q->position().x(), rangeBottomLimit));
+ }
}
// The heightChanged signal is called from an event handler. Singleshot timer
--- src/corelib/workspace/mdeviceprofile.cpp
+++ src/corelib/workspace/mdeviceprofile.cpp
@@ -273,3 +273,16 @@
Q_D(const MDeviceProfile);
return pt * d->pixelsPerPtF;
}
+
+int MDeviceProfile::pixelsToPt(int pixels)
+{
+ Q_D(const MDeviceProfile);
+ return pixels / d->pixelsPerPt;
+}
+
+qreal MDeviceProfile::pixelsToPtF(qreal pixels)
+{
+ Q_D(const MDeviceProfile);
+ return pixels / d->pixelsPerPtF;
+}
+
--- src/corelib/workspace/mdeviceprofile.h
+++ src/corelib/workspace/mdeviceprofile.h
@@ -69,6 +69,13 @@
//! Returns point size in pixels using floating point precision on this device.
qreal ptToPixelsF(qreal pt);
+ //! Returns the result of pixels to points conversion
+ int pixelsToPt(int pixels);
+
+ //! Returns the result of pixels to points conversion
+ qreal pixelsToPtF(qreal pixels);
+
+
protected:
MDeviceProfilePrivate *const d_ptr;
--- src/views/mbannerview.cpp
+++ src/views/mbannerview.cpp
@@ -229,13 +229,6 @@
layout = createLayout();
- if (!q->model()->iconID().isEmpty()) {
- icon()->setStyleName("InformationBannerIcon");
- icon()->setVisible(true);
- landscapePolicy->addItem(icon(), Qt::AlignTop);
- portraitPolicy->addItem(icon(), Qt::AlignTop);
- }
-
if (!q->model()->title().isEmpty()) {
title()->setStyleName("InformationBannerTitle");
title()->setVisible(true);
@@ -244,6 +237,8 @@
portraitPolicy->addItem(title(), Qt::AlignTop);
}
+ icon()->setVisible(false);
+ subtitle()->setVisible(false);
prefixTimeStamp()->setVisible(false);
bannerTimeStamp()->setVisible(false);
}
@@ -254,6 +249,13 @@
layout = createLayout();
+ if (!q->model()->iconID().isEmpty()) {
+ icon()->setStyleName("SystemBannerTitleIcon");
+ icon()->setVisible(true);
+ landscapePolicy->addItem(icon(), Qt::AlignTop);
+ portraitPolicy->addItem(icon(), Qt::AlignTop);
+ }
+
if (!q->model()->title().isEmpty()) {
title()->setStyleName("SystemBannerTitle");
title()->setVisible(true);
@@ -263,7 +265,7 @@
portraitPolicy->addItem(title(), Qt::AlignTop);
}
- icon()->setVisible(false);
+ subtitle()->setVisible(false);
prefixTimeStamp()->setVisible(false);
bannerTimeStamp()->setVisible(false);
}
--- src/views/mpositionindicatorview.cpp
+++ src/views/mpositionindicatorview.cpp
@@ -128,7 +128,7 @@
const MScalableImage *rail = style()->backgroundImage();
- if (pRange.height() > vpSize.height()) {
+ if ((int)pRange.height() > (int)vpSize.height()) {
int indicatorPixmapSizeX = indicator->pixmap()->width();
int railPixmapSizeX = rail->pixmap()->width();
@@ -163,7 +163,7 @@
painter);
}
- if (pRange.width() > vpSize.width()) {
+ if ((int)pRange.width() > (int)vpSize.width()) {
int indicatorPixmapSizeY = indicator->pixmap()->height();
int railPixmapSizeY = rail->pixmap()->height();
--- src/views/msliderview.cpp
+++ src/views/msliderview.cpp
@@ -92,21 +92,21 @@
QRect handleRect = rect().toRect();
if (sliderState == MSliderModel::Pressed) {
- if (orientation == Qt::Horizontal)
+ if (orientation == Qt::Horizontal && handlePressedPixmap != 0)
painter->drawPixmap((handleRect.width() - handlePressedPixmap->width()) / 2,
(handleRect.height() - handlePressedPixmap->height()) / 2,
*handlePressedPixmap);
- if (orientation == Qt::Vertical)
+ if (orientation == Qt::Vertical && handleVerticalPressedPixmap != 0)
painter->drawPixmap((handleRect.width() - handleVerticalPressedPixmap->width()) / 2,
(handleRect.height() - handleVerticalPressedPixmap->height()) / 2,
*handleVerticalPressedPixmap);
}
if (sliderState == MSliderModel::Released) {
- if (orientation == Qt::Horizontal)
+ if (orientation == Qt::Horizontal && handlePixmap != 0)
painter->drawPixmap((handleRect.width() - handlePixmap->width()) / 2,
(handleRect.height() - handlePixmap->height()) / 2,
*handlePixmap);
- if (orientation == Qt::Vertical)
+ if (orientation == Qt::Vertical && handleVerticalPixmap != 0)
painter->drawPixmap((handleRect.width() - handleVerticalPixmap->width()) / 2,
(handleRect.height() - handleVerticalPixmap->height()) / 2,
*handleVerticalPixmap);
@@ -198,19 +198,22 @@
bool reverse = qApp->isRightToLeft();
QRect handleRect = rect().toRect();
- if (orientation == Qt::Horizontal)
+ if (orientation == Qt::Horizontal && handleLabelArrowDownPixmap != 0)
painter->drawPixmap((handleRect.width() - handleLabelArrowDownPixmap->width()) / 2,
(handleRect.height() - handleLabelArrowDownPixmap->height()) / 2,
*handleLabelArrowDownPixmap);
if (orientation == Qt::Vertical) {
- if (!reverse)
- painter->drawPixmap((handleRect.width() - handleLabelArrowLeftPixmap->width()) / 2,
- (handleRect.height() - handleLabelArrowLeftPixmap->height()) / 2,
- *handleLabelArrowLeftPixmap);
- else
- painter->drawPixmap((handleRect.width() - handleLabelArrowRightPixmap->width()) / 2,
- (handleRect.height() - handleLabelArrowRightPixmap->height()) / 2,
- *handleLabelArrowRightPixmap);
+ if (!reverse) {
+ if (handleLabelArrowLeftPixmap != 0)
+ painter->drawPixmap((handleRect.width() - handleLabelArrowLeftPixmap->width()) / 2,
+ (handleRect.height() - handleLabelArrowLeftPixmap->height()) / 2,
+ *handleLabelArrowLeftPixmap);
+ } else {
+ if (handleLabelArrowRightPixmap != 0)
+ painter->drawPixmap((handleRect.width() - handleLabelArrowRightPixmap->width()) / 2,
+ (handleRect.height() - handleLabelArrowRightPixmap->height()) / 2,
+ *handleLabelArrowRightPixmap);
+ }
}
}
--- tests/ft_mstylesheetparser/ft_mstylesheetparser.cpp
+++ tests/ft_mstylesheetparser/ft_mstylesheetparser.cpp
@@ -504,23 +504,8 @@
QCOMPARE(m_subject->fileInfoList().count(), 3);
MStyleSheetParser::StylesheetFileInfo *info = m_subject->fileInfoList()[0];
- QCOMPARE(info->constants.count(), 5);
- QCOMPARE(info->constants["cWidth"], QByteArray("10px"));
- QCOMPARE(info->constants["cHeight"], QByteArray("15px"));
- QCOMPARE(info->constants["cFontFamily"], QByteArray("sans"));
- QCOMPARE(info->constants["cFontSize"], QByteArray("12px"));
- QCOMPARE(info->constants["cColor"], QByteArray("#0abba0"));
- info = m_subject->fileInfoList()[1];
+ // the binary files do not contain any constants
QCOMPARE(info->constants.count(), 0);
- info = m_subject->fileInfoList()[2];
- QCOMPARE(info->constants.count(), 7);
- QCOMPARE(info->constants["cInt"], QByteArray("10"));
- QCOMPARE(info->constants["cReal"], QByteArray("1.0"));
- QCOMPARE(info->constants["cName"], QByteArray("\"name\""));
- QCOMPARE(info->constants["cColor"], QByteArray("#0dead0"));
- QCOMPARE(info->constants["cBool"], QByteArray("true"));
- QCOMPARE(info->constants["cPoint"], QByteArray("17px 11px"));
- QCOMPARE(info->constants["cFont"], QByteArray("arial 10px"));
//check that there are right number of attributes
info = m_subject->fileInfoList()[0];
@@ -593,8 +578,8 @@
QList<MStyleSheetParser::StylesheetFileInfo *>::iterator binaryFi = binary.fileInfoList().begin();
for (int i = 0; i < parser.fileInfoList().count(); i++) {
- // check that there is equal count of constants
- QCOMPARE((*parserFi)->constants.count(), (*binaryFi)->constants.count());
+ // NOTE: (*parserFi)->constants.count() will differ from (*binaryFi)->constants.count()
+ // as the binary files do not contain any constants
// check that there is equal count of selectors
QCOMPARE((*parserFi)->selectors.count(), (*binaryFi)->selectors.count());
--- tests/ut_minputmethodstate/ut_minputmethodstate.cpp
+++ tests/ut_minputmethodstate/ut_minputmethodstate.cpp
@@ -104,6 +104,11 @@
// make a modification
state->setToolbarItemAttribute(id, "itemName", "attributeName", 42);
QCOMPARE(changeSpy.count(), 1);
+
+ // check that setting value doesn't make signals if value does not change
+ state->setToolbarItemAttribute(id, "itemName", "attributeName", 42);
+ QCOMPARE(changeSpy.count(), 1);
+
changeSpy.clear();
// another toolbar with one item containing two attributes, and second containing one
--- tests/ut_minputwidgetrelocator/ut_minputwidgetrelocator.cpp
+++ tests/ut_minputwidgetrelocator/ut_minputwidgetrelocator.cpp
@@ -380,6 +380,15 @@
Q_UNUSED(index);
}
+void MScrollChain::addMinimalScroll(const QRect &localRect,
+ int startingIndex,
+ int untilIndex)
+{
+ Q_UNUSED(localRect);
+ Q_UNUSED(startingIndex);
+ Q_UNUSED(untilIndex);
+}
+
void MScrollChain::applyScrolling()
{
++gScrollCallCount;
++++++ libmeegotouch.yaml
--- libmeegotouch.yaml
+++ libmeegotouch.yaml
@@ -11,6 +11,7 @@
Patches:
- arm_ftbfs_egl.patch
- arm_egl_visibility.patch
+ - temporary_enable_qdbus_link.patch
Description: |
Qt based MeeGo Touch Framework for developing touch based user interfaces.
Requires:
@@ -22,7 +23,6 @@
PkgConfigBR:
- QtOpenGL
- contextprovider-1.0
- - dbus-1
- gconf-2.0
- gstreamer-0.10
- gstreamer-base-0.10
++++++ temporary_enable_qdbus_link.patch (new)
--- temporary_enable_qdbus_link.patch
+++ temporary_enable_qdbus_link.patch
+diff --git a/mkspecs/features/meegotouch_common.prf b/mkspecs/features/meegotouch_common.prf
+index 12e3ca3..43589e6 100644
+--- a/mkspecs/features/meegotouch_common.prf
++++ b/mkspecs/features/meegotouch_common.prf
+@@ -2,9 +2,9 @@ include(meegotouch_defines.prf)
+ include(meegotouch_mgen.prf)
+ include(meegotouch_mmoc.prf)
+
+-contains(DEFINES, HAVE_DBUS) {
++#contains(DEFINES, HAVE_DBUS) {
+ QT += dbus
+-}
++#}
+
+ macx {
+ INCLUDEPATH += /Library/Frameworks/m.framework/Headers
More information about the MeeGo-commits
mailing list