From eb4c00a469f473a33103652ed977eabb4fb9ce9b Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 19 May 2009 19:13:39 +0200 Subject: Testing 'dictionary' if it contains a value before using operator[]. T & QMap::operator[]: "If the map contains no item with key key, the function inserts a default-constructed value into the map with key key, and returns a reference to it" How many occurences of 'dictionary["foo"].startsWith("bar")' has that file by the way? --- tools/configure/configureapp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 2c20d51..a879e5d 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1886,14 +1886,14 @@ bool Configure::checkAvailability(const QString &part) else if (part == "SQL_DB2") available = findFile("sqlcli.h") && findFile("sqlcli1.h") && findFile("db2cli.lib"); else if (part == "SQL_SQLITE") - if (dictionary["XQMAKESPEC"].startsWith("symbian")) + if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) available = false; // In Symbian we only support system sqlite option else available = true; // Built in, we have a fork else if (part == "SQL_SQLITE_LIB") { if (dictionary[ "SQL_SQLITE_LIB" ] == "system") { // Symbian has multiple .lib/.dll files we need to find - if (dictionary["XQMAKESPEC"].startsWith("symbian")) { + if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) { available = true; // There is sqlite_symbian plugin which exports the necessary stuff dictionary[ "QT_LFLAGS_SQLITE" ] += "-lsqlite3"; } else { -- cgit v0.12 From 38c0b9100b5636e7f92185159cac5a5addbe4264 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 19 May 2009 19:14:55 +0200 Subject: Fresh build with commit eb4c00a469f473a33103652ed977eabb4fb9ce9b (MSVC 2008, No MS runtimes, UPXed) --- configure.exe | Bin 856064 -> 535040 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/configure.exe b/configure.exe index 5710503..30383d8 100755 Binary files a/configure.exe and b/configure.exe differ -- cgit v0.12 From 26e6d20ef0abee7b2d721637d6eaea67e932b907 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 19 May 2009 19:58:57 +0200 Subject: Stub for backgroundTexture() --- src/gui/styles/qs60style_simulated.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index 17c1ebe..5a88f9a 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -191,6 +191,25 @@ QVariant QS60StylePrivate::styleProperty_specific(const char *name) const return styleProperty(name); } +QPixmap QS60StylePrivate::backgroundTexture() +{ + static QPixmap result; + // Poor mans caching. + Making sure that there is always only one background image in memory at a time + +/* + TODO: 1) Hold the background QPixmap as pointer in a static class member. + Also add a deleteBackground() function and call that in ~QS60StylePrivate() + 2) Don't cache the background at all as soon as we have native pixmap support +*/ + + if (!m_backgroundValid) { + result = QPixmap(); + result = part(QS60StyleEnums::SP_QsnBgScreen, QApplication::activeWindow()->size()); + m_backgroundValid = true; + } + return result; +} + bool QS60StylePrivate::isTouchSupported() { #ifdef QT_KEYPAD_NAVIGATION -- cgit v0.12 From 1588c0fe43f2173e026d7b52bdea0cf85b18ea1d Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 19 May 2009 20:14:07 +0200 Subject: Softkeys also for non-S60. Currently only as stub. Will eventually go into a separate implementation file. --- src/gui/widgets/qsoftkeystack.cpp | 11 +++++++++++ src/gui/widgets/widgets.pri | 18 +++++++----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index cd17171..32a2df9 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -164,3 +164,14 @@ void QSoftKeyStack::handleSoftKeyPress(int command) Q_D(QSoftKeyStack); d->handleSoftKeyPress(command); } + +#if !defined(Q_WS_S60) +void QSoftKeyStackPrivate::handleSoftKeyPress(int command) +{ + Q_UNUSED(command) +} + +void QSoftKeyStackPrivate::setNativeSoftKeys() +{ +} +#endif // !defined(Q_WS_S60) \ No newline at end of file diff --git a/src/gui/widgets/widgets.pri b/src/gui/widgets/widgets.pri index c9e68a1..0c0641a 100644 --- a/src/gui/widgets/widgets.pri +++ b/src/gui/widgets/widgets.pri @@ -78,8 +78,10 @@ HEADERS += \ widgets/qtoolbararealayout_p.h \ widgets/qplaintextedit.h \ widgets/qplaintextedit_p.h \ - widgets/qprintpreviewwidget.h - + widgets/qprintpreviewwidget.h \ + widgets/qsoftkeyaction.h \ + widgets/qsoftkeystack.h \ + widgets/qsoftkeystack_p.h SOURCES += \ widgets/qabstractbutton.cpp \ widgets/qabstractslider.cpp \ @@ -138,8 +140,9 @@ SOURCES += \ widgets/qwidgetanimator.cpp \ widgets/qtoolbararealayout.cpp \ widgets/qplaintextedit.cpp \ - widgets/qprintpreviewwidget.cpp - + widgets/qprintpreviewwidget.cpp \ + widgets/qsoftkeyaction.cpp \ + widgets/qsoftkeystack.cpp !embedded:mac { HEADERS += widgets/qmacnativewidget_mac.h \ @@ -162,14 +165,7 @@ wince*: { } symbian*: { - HEADERS += \ - widgets/qsoftkeyaction.h \ - widgets/qsoftkeystack.h \ - widgets/qsoftkeystack_p.h - SOURCES += \ widgets/qmenu_symbian.cpp \ - widgets/qsoftkeyaction.cpp \ - widgets/qsoftkeystack.cpp \ widgets/qsoftkeystack_s60.cpp } -- cgit v0.12 From ade1bdc75245bb233022b1cc0358b89df2180466 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 19 May 2009 20:14:58 +0200 Subject: Not using deprecated QString constructor --- src/gui/widgets/qsoftkeystack.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index 32a2df9..ae58e8d 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -129,8 +129,8 @@ void QSoftKeyStack::handleFocusChanged(QWidget *old, QWidget *now) Qt::ContextMenuPolicy policy = now->contextMenuPolicy(); if (policy != Qt::NoContextMenu && policy != Qt::PreventContextMenu ) { QList actionList; - QSoftKeyAction* menu = new QSoftKeyAction(QSoftKeyAction::Menu, QString("Menu"), now); - QSoftKeyAction* contextMenu = new QSoftKeyAction(QSoftKeyAction::ContextMenu, QString("ContextMenu"), now); + QSoftKeyAction* menu = new QSoftKeyAction(QSoftKeyAction::Menu, QString::fromLatin1("Menu"), now); + QSoftKeyAction* contextMenu = new QSoftKeyAction(QSoftKeyAction::ContextMenu, QString::fromLatin1("ContextMenu"), now); actionList.append(menu); actionList.append(contextMenu); softKeyStack->push(actionList); -- cgit v0.12