diff options
-rw-r--r-- | demos/embedded/desktopservices/contenttab.cpp | 6 | ||||
-rw-r--r-- | demos/embedded/desktopservices/contenttab.h | 1 | ||||
-rw-r--r-- | demos/embedded/desktopservices/desktopwidget.cpp | 10 | ||||
-rw-r--r-- | mkspecs/common/symbian/symbian.conf | 2 | ||||
-rw-r--r-- | src/gui/styles/qs60style.cpp | 5 | ||||
-rw-r--r-- | src/gui/util/qdesktopservices_s60.cpp | 54 | ||||
-rw-r--r-- | src/gui/util/util.pri | 5 |
7 files changed, 42 insertions, 41 deletions
diff --git a/demos/embedded/desktopservices/contenttab.cpp b/demos/embedded/desktopservices/contenttab.cpp index 12e80f6..450a080 100644 --- a/demos/embedded/desktopservices/contenttab.cpp +++ b/demos/embedded/desktopservices/contenttab.cpp @@ -66,9 +66,13 @@ ContentTab::~ContentTab() // NEW PUBLIC METHODS void ContentTab::init(const QDesktopServices::StandardLocation &location, + const QString &filter, const QString &icon) { setContentDir(location); + QStringList filterList; + filterList = filter.split(";"); + m_ContentDir.setNameFilters(filterList); setIcon(icon); connect(this, SIGNAL(itemClicked(QListWidgetItem *)), @@ -90,7 +94,7 @@ void ContentTab::setIcon(const QString &icon) void ContentTab::populateListWidget() { - QFileInfoList fileList = m_ContentDir.entryInfoList(QStringList(), QDir::Files, QDir::Time); + QFileInfoList fileList = m_ContentDir.entryInfoList(QDir::Files, QDir::Time); foreach(QFileInfo item, fileList) { new QListWidgetItem(m_Icon, itemName(item), this); } diff --git a/demos/embedded/desktopservices/contenttab.h b/demos/embedded/desktopservices/contenttab.h index af1b7bb..a5a402e 100644 --- a/demos/embedded/desktopservices/contenttab.h +++ b/demos/embedded/desktopservices/contenttab.h @@ -74,6 +74,7 @@ public: // Constructors & Destructors public: // New Methods virtual void init(const QDesktopServices::StandardLocation &location, + const QString &filter, const QString &icon); protected: // New Methods diff --git a/demos/embedded/desktopservices/desktopwidget.cpp b/demos/embedded/desktopservices/desktopwidget.cpp index e8a654e..3abe591 100644 --- a/demos/embedded/desktopservices/desktopwidget.cpp +++ b/demos/embedded/desktopservices/desktopwidget.cpp @@ -59,18 +59,22 @@ DesktopWidget::DesktopWidget(QWidget *parent) : QWidget(parent) // Images ContentTab* imageTab = new ContentTab(tabWidget); - imageTab->init(QDesktopServices::PicturesLocation, ":/resources/photo.png"); + imageTab->init(QDesktopServices::PicturesLocation, + "*.png;*.jpg;*.jpeg;*.bmp;*.gif", + ":/resources/photo.png"); tabWidget->addTab(imageTab, tr("Images")); // Music ContentTab* musicTab = new ContentTab(tabWidget); - musicTab->init(QDesktopServices::MusicLocation, ":/resources/music.png"); + musicTab->init(QDesktopServices::MusicLocation, + "*.wav;*.mp3;*.mp4", + ":/resources/music.png"); tabWidget->addTab(musicTab, tr("Music")); // Links LinkTab* othersTab = new LinkTab(tabWidget);; // Given icon file will be overriden by LinkTab - othersTab->init(QDesktopServices::PicturesLocation, ""); + othersTab->init(QDesktopServices::PicturesLocation, "", ""); tabWidget->addTab(othersTab, tr("Links")); // Layout diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index 5a61a23..6ae4c4a 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -62,7 +62,7 @@ QMAKE_LFLAGS_DLL = -shared QMAKE_LINK_OBJECT_MAX = 10 QMAKE_LINK_OBJECT_SCRIPT= object_script -QMAKE_DESKTOPSERVICES_LIBS = -lsendui -lplatformenv -lcommonui -letext -lapmime +QMAKE_DESKTOPSERVICES_LIBS = -lsendas2 -lplatformenv -lcommonui -letext -lapmime QMAKE_STATUSPANE_LIBS = -lavkon -leikcoctl QMAKE_LIBS = -llibc -llibm -leuser -llibdl diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 180937f..6ee63e6 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2342,6 +2342,11 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple sliderlen = (qint64(scrollbarOption->pageStep) * maxlen) / (range + scrollbarOption->pageStep); int slidermin = pixelMetric(PM_ScrollBarSliderMin, scrollbarOption, widget); + if (isHorizontal && slidermin < scrollBarRect.height()) + slidermin = scrollBarRect.height(); + else if (!isHorizontal && slidermin < scrollBarRect.width()) + slidermin = scrollBarRect.width(); + if (sliderlen < slidermin || range > (INT_MAX>>1)) sliderlen = slidermin; if (sliderlen > maxlen) diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp index a30e2ed..d53c046 100644 --- a/src/gui/util/qdesktopservices_s60.cpp +++ b/src/gui/util/qdesktopservices_s60.cpp @@ -54,8 +54,8 @@ #include <eikenv.h> // CEikonEnv #include <apgcli.h> // RApaLsSession #include <apgtask.h> // TApaTaskList, TApaTask -#include <sendui.h> // CSendUi -#include <cmessagedata.h> // CMessageData +#include <rsendas.h> // RSendAs +#include <rsendasmessage.h> // RSendAsMessage #include <pathinfo.h> // PathInfo #ifdef USE_DOCUMENTHANDLER #include <documenthandler.h> // CDocumentHandler @@ -85,52 +85,44 @@ static void handleMailtoSchemeL(const QUrl &url) QStringList bccs = bcc.split(","); - CSendUi* sendUi = CSendUi::NewLC(); + RSendAs sendAs; + User::LeaveIfError(sendAs.Connect()); + CleanupClosePushL(sendAs); + + RSendAsMessage sendAsMessage; + sendAsMessage.CreateL(sendAs, KUidMsgTypeSMTP); + CleanupClosePushL(sendAsMessage); - // Construct symbian sendUI data holder - CMessageData* messageData = CMessageData::NewLC(); // Subject - TPtrC subj( qt_QString2TPtrC(subject) ); - messageData->SetSubjectL( &subj ); + sendAsMessage.SetSubjectL(qt_QString2TPtrC(subject)); // Body - CParaFormatLayer* paraFormat = CParaFormatLayer::NewL(); - CleanupStack::PushL( paraFormat ); - CCharFormatLayer* charFormat = CCharFormatLayer::NewL(); - CleanupStack::PushL( charFormat ); - CRichText* bodyRichText = CRichText::NewL( paraFormat, charFormat ); - CleanupStack::PushL( bodyRichText ); - - TPtrC bodyPtr( qt_QString2TPtrC(body) ); - if( bodyPtr.Length() ) - { - bodyRichText->InsertL( 0, bodyPtr ); - } - else - { - bodyRichText->InsertL( 0, KNullDesC ); - } - - messageData->SetBodyTextL( bodyRichText ); + sendAsMessage.SetBodyTextL(qt_QString2TPtrC(body)); // To foreach(QString item, recipients) - messageData->AppendToAddressL(qt_QString2TPtrC(item)); + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo ); foreach(QString item, tos) - messageData->AppendToAddressL(qt_QString2TPtrC(item)); + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo ); // Cc foreach(QString item, ccs) - messageData->AppendCcAddressL(qt_QString2TPtrC(item)); + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientCc ); // Bcc foreach(QString item, bccs) - messageData->AppendBccAddressL(qt_QString2TPtrC(item)); + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientBcc ); + + // send the message + sendAsMessage.LaunchEditorAndCloseL(); + + // sendAsMessage (already closed) + CleanupStack::Pop(); - sendUi->CreateAndSendMessageL( KUidMsgTypeSMTP, messageData ); - CleanupStack::PopAndDestroy( 5 ); // bodyRichText, charFormat, paraFormat, messageData, sendUi + // sendAs + CleanupStack::PopAndDestroy(); } static bool handleMailtoScheme(const QUrl &url) diff --git a/src/gui/util/util.pri b/src/gui/util/util.pri index 69c53ae..e628229 100644 --- a/src/gui/util/util.pri +++ b/src/gui/util/util.pri @@ -35,11 +35,6 @@ embedded { util/qsystemtrayicon_qws.cpp } -symbian { - # QDesktopServices uses CSendUi which is located on app layer - INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE -} - !embedded:!x11:mac { OBJECTIVE_SOURCES += util/qsystemtrayicon_mac.mm } |