diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-19 22:25:52 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-19 22:25:52 (GMT) |
commit | bb382d523710454dadb50214d5a2fad6fd8dd02c (patch) | |
tree | 8f05677400a53b172102d94dbadda57bf71a02d9 /src/gui/util | |
parent | 0cfa6daa4776cd78370e644fae3005ae432b83c7 (diff) | |
parent | 7eb9cf865f2b40ca3ca4bf8655b6bb6d40d6fcdd (diff) | |
download | Qt-bb382d523710454dadb50214d5a2fad6fd8dd02c.zip Qt-bb382d523710454dadb50214d5a2fad6fd8dd02c.tar.gz Qt-bb382d523710454dadb50214d5a2fad6fd8dd02c.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public: (21 commits)
Fixed handling of QInputMethodEvents with nonzero replacementLength.
Fixed namespace issues related to epocroot.cpp
Corrected ASCII comparison and removed extra braces
Add symbian scope for qfiledialog_symbian.cpp
Resolve EPOCROOT in qt.conf using same logic as in .pro
Make epocroot resolving compatible with more build environments
Fix for QtOpenGL RVCT4 compilation error
Removed extra cpp and done changes based on comments
Correct flags for Symbian file dialogs
Fix for WServ 64 crash on Symbian.
Use include(original mkspec) instead of copying of mkspec to default
Fixed code style of d92cbfc5, reported by git push.
Switched qdesktopservices to use SchemeHandler for Symbian^3 and later.
Removed unnecessary Q_OS_SYMBIAN flags from qdesktopservices_s60.cpp.
Documented usage of dialogs on Symbian
Native file dialog on Symbian^3
Add Location as self signable capability in patch_capabilities.pl
Localize .loc and .pkg content based on TRANSLATIONS
Bump Qt version to 4.7.2.
SSL: Fix for systemCaCertificates being called first on symbian
...
Diffstat (limited to 'src/gui/util')
-rw-r--r-- | src/gui/util/qdesktopservices_s60.cpp | 180 | ||||
-rw-r--r-- | src/gui/util/util.pri | 19 |
2 files changed, 98 insertions, 101 deletions
diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp index cd023cb..56c2b98 100644 --- a/src/gui/util/qdesktopservices_s60.cpp +++ b/src/gui/util/qdesktopservices_s60.cpp @@ -45,32 +45,29 @@ #include <qurl.h> #include <private/qcore_symbian_p.h> -#include <txtrich.h> // CRichText #include <f32file.h> // TDriveUnit etc +#include <pathinfo.h> // PathInfo + +#ifndef USE_SCHEMEHANDLER +#ifdef Q_WS_S60 +// This flag changes the implementation to use S60 CDcoumentHandler +// instead of apparc when opening the files +#define USE_DOCUMENTHANDLER +#endif + +#include <txtrich.h> // CRichText #include <eikenv.h> // CEikonEnv #include <apgcli.h> // RApaLsSession #include <apgtask.h> // TApaTaskList, TApaTask #include <rsendas.h> // RSendAs #include <rsendasmessage.h> // RSendAsMessage -#ifdef Q_WS_S60 -// This flag changes the implementation to use S60 CDcoumentHandler -// instead of apparch when opening the files -#define USE_DOCUMENTHANDLER +#ifdef USE_DOCUMENTHANDLER +#include <DocumentHandler.h> // CDocumentHandler +#include <AknServerApp.h> #endif - -// copied from miutset.h, so we don't get a dependency into the app layer -const TUid KUidMsgTypeSMTP = {0x10001028}; // 268439592 - -#ifdef Q_OS_SYMBIAN -# include <pathinfo.h> // PathInfo -# ifdef USE_DOCUMENTHANDLER -# include <DocumentHandler.h> // CDocumentHandler -# include <AknServerApp.h> -# endif -#else -# warning CDocumentHandler requires support for S60 -# undef USE_DOCUMENTHANDLER // Fallback to RApaLsSession based implementation +#else // USE_SCHEMEHANDLER +#include <schemehandler.h> #endif QT_BEGIN_NAMESPACE @@ -79,6 +76,10 @@ _LIT(KCacheSubDir, "Cache\\"); _LIT(KSysBin, "\\Sys\\Bin\\"); _LIT(KBrowserPrefix, "4 " ); _LIT(KFontsDir, "z:\\resource\\Fonts\\"); + +#ifndef USE_SCHEMEHANDLER +// copied from miutset.h, so we don't get a dependency into the app layer +const TUid KUidMsgTypeSMTP = {0x10001028}; // 268439592 const TUid KUidBrowser = { 0x10008D39 }; template<class R> @@ -137,7 +138,6 @@ private: Q_GLOBAL_STATIC(QS60DocumentHandler, qt_s60_documenthandler); #endif - static void handleMailtoSchemeLX(const QUrl &url) { // this function has many intermingled leaves and throws. Qt and Symbian objects do not have @@ -155,12 +155,10 @@ static void handleMailtoSchemeLX(const QUrl &url) QStringList ccs = cc.split(QLatin1String(","), QString::SkipEmptyParts); QStringList bccs = bcc.split(QLatin1String(","), QString::SkipEmptyParts); - RSendAs sendAs; User::LeaveIfError(sendAs.Connect()); QAutoClose<RSendAs> sendAsCleanup(sendAs); - CSendAsAccounts* accounts = CSendAsAccounts::NewL(); CleanupStack::PushL(accounts); sendAs.AvailableAccountsL(KUidMsgTypeSMTP, *accounts); @@ -249,47 +247,6 @@ static bool handleOtherSchemes(const QUrl &url) return err ? false : true; } -static TDriveUnit exeDrive() -{ - RProcess me; - TFileName processFileName = me.FileName(); - TDriveUnit drive(processFileName); - return drive; -} - -static TDriveUnit writableExeDrive() -{ - TDriveUnit drive = exeDrive(); - if(drive.operator TInt() == EDriveZ) - return TDriveUnit(EDriveC); - return drive; -} - -static TPtrC writableDataRoot() -{ - TDriveUnit drive = exeDrive(); -#ifdef Q_OS_SYMBIAN - switch(drive.operator TInt()){ - case EDriveC: - return PathInfo::PhoneMemoryRootPath(); - break; - case EDriveE: - return PathInfo::MemoryCardRootPath(); - break; - case EDriveZ: - // It is not possible to write on ROM drive -> - // return phone mem root path instead - return PathInfo::PhoneMemoryRootPath(); - break; - default: - return PathInfo::PhoneMemoryRootPath(); - break; - } -#else -#warning No fallback implementation of writableDataRoot() - return 0; -#endif -} static void openDocumentL(const TDesC& aUrl) { @@ -314,13 +271,44 @@ static void openDocumentL(const TDesC& aUrl) #endif } -#ifdef USE_SCHEMEHANDLER +static bool launchWebBrowser(const QUrl &url) +{ + if (!url.isValid()) + return false; + + if (url.scheme() == QLatin1String("mailto")) { + return handleMailtoScheme(url); + } + return handleOtherSchemes( url ); +} + +static bool openDocument(const QUrl &file) +{ + if (!file.isValid()) + return false; + + QString filePath = file.toLocalFile(); + filePath = QDir::toNativeSeparators(filePath); + TPtrC filePathPtr(qt_QString2TPtrC(filePath)); + TRAPD(err, openDocumentL(filePathPtr)); + return err ? false : true; +} + +#else //USE_SCHEMEHANDLER // The schemehandler component only exist in private SDK. This implementation // exist here just for convenience in case that we need to use it later on // The schemehandle based implementation is not yet tested. // The biggest advantage of schemehandler is that it can handle // wide range of schemes and is extensible by plugins +static void handleUrlL(const TDesC& aUrl) +{ + CSchemeHandler* schemeHandler = CSchemeHandler::NewL(aUrl); + CleanupStack::PushL(schemeHandler); + schemeHandler->HandleUrlStandaloneL(); // Process the Url in standalone mode + CleanupStack::PopAndDestroy(); +} + static bool handleUrl(const QUrl &url) { if (!url.isValid()) @@ -332,13 +320,6 @@ static bool handleUrl(const QUrl &url) return err ? false : true; } -static void handleUrlL(const TDesC& aUrl) -{ - CSchemeHandler* schemeHandler = CSchemeHandler::NewL(aUrl); - CleanupStack::PushL(schemeHandler); - schemeHandler->HandleUrlStandaloneL(); // Process the Url in standalone mode - CleanupStack::PopAndDestroy(); -} static bool launchWebBrowser(const QUrl &url) { return handleUrl(url); @@ -346,31 +327,48 @@ static bool launchWebBrowser(const QUrl &url) static bool openDocument(const QUrl &file) { - return handleUrl(url); + return handleUrl(file); } -#endif -static bool launchWebBrowser(const QUrl &url) -{ - if (!url.isValid()) - return false; +#endif //USE_SCHEMEHANDLER - if (url.scheme() == QLatin1String("mailto")) { - return handleMailtoScheme(url); - } - return handleOtherSchemes( url ); +// Common functions to all implementations + +static TDriveUnit exeDrive() +{ + RProcess me; + TFileName processFileName = me.FileName(); + TDriveUnit drive(processFileName); + return drive; } -static bool openDocument(const QUrl &file) +static TDriveUnit writableExeDrive() { - if (!file.isValid()) - return false; + TDriveUnit drive = exeDrive(); + if (drive.operator TInt() == EDriveZ) + return TDriveUnit(EDriveC); + return drive; +} - QString filePath = file.toLocalFile(); - filePath = QDir::toNativeSeparators(filePath); - TPtrC filePathPtr(qt_QString2TPtrC(filePath)); - TRAPD(err, openDocumentL(filePathPtr)); - return err ? false : true; +static TPtrC writableDataRoot() +{ + TDriveUnit drive = exeDrive(); + switch (drive.operator TInt()){ + case EDriveC: + return PathInfo::PhoneMemoryRootPath(); + break; + case EDriveE: + return PathInfo::MemoryCardRootPath(); + break; + case EDriveZ: + // It is not possible to write on ROM drive -> + // return phone mem root path instead + return PathInfo::PhoneMemoryRootPath(); + break; + default: + return PathInfo::PhoneMemoryRootPath(); + break; + } } QString QDesktopServices::storageLocation(StandardLocation type) @@ -395,21 +393,15 @@ QString QDesktopServices::storageLocation(StandardLocation type) break; case MusicLocation: path.Append(writableDataRoot()); -#ifdef Q_OS_SYMBIAN path.Append(PathInfo::SoundsPath()); -#endif break; case MoviesLocation: path.Append(writableDataRoot()); -#ifdef Q_OS_SYMBIAN path.Append(PathInfo::VideosPath()); -#endif break; case PicturesLocation: path.Append(writableDataRoot()); -#ifdef Q_OS_SYMBIAN path.Append(PathInfo::ImagesPath()); -#endif break; case TempLocation: return QDir::tempPath(); diff --git a/src/gui/util/util.pri b/src/gui/util/util.pri index bea520e..d1c4ff8 100644 --- a/src/gui/util/util.pri +++ b/src/gui/util/util.pri @@ -43,12 +43,17 @@ embedded { } symbian { - LIBS += -lsendas2 -letext -lapmime -lplatformenv - contains(QT_CONFIG, s60) { - contains(CONFIG, is_using_gnupoc) { - LIBS += -lcommonui - } else { - LIBS += -lCommonUI + LIBS += -letext -lplatformenv + contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { + LIBS += -lsendas2 -lapmime + contains(QT_CONFIG, s60) { + contains(CONFIG, is_using_gnupoc) { + LIBS += -lcommonui + } else { + LIBS += -lCommonUI + } } + } else { + DEFINES += USE_SCHEMEHANDLER } -} +}
\ No newline at end of file |