summaryrefslogtreecommitdiffstats
path: root/src/gui/util
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-08-06 06:23:07 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-08-06 06:23:07 (GMT)
commit57ceb11ecf95032418712a686418116cf2398e7a (patch)
tree378533fcc07983d3a1b461aaaad07d842e50b81c /src/gui/util
parent90d4366f1e9657b3240a872698614c7d9747f9e0 (diff)
parenta4fc85c75f068b73f9c2334c77b0ae2275510e17 (diff)
downloadQt-57ceb11ecf95032418712a686418116cf2398e7a.zip
Qt-57ceb11ecf95032418712a686418116cf2398e7a.tar.gz
Qt-57ceb11ecf95032418712a686418116cf2398e7a.tar.bz2
Merge commit 'origin/master'
Conflicts: tests/auto/qfilesystemmodel/qfilesystemmodel.pro tests/auto/qfontdialog/tst_qfontdialog.cpp tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp tests/auto/qsqldriver/qsqldriver.pro tests/auto/qsqlquery/qsqlquery.pro tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro tests/auto/qsqltablemodel/qsqltablemodel.pro tests/auto/qsqlthread/qsqlthread.pro tests/auto/qstatemachine/tst_qstatemachine.cpp tests/auto/qtcpsocket/tst_qtcpsocket.cpp
Diffstat (limited to 'src/gui/util')
-rw-r--r--src/gui/util/qdesktopservices.cpp5
-rw-r--r--src/gui/util/qdesktopservices_s60.cpp83
2 files changed, 47 insertions, 41 deletions
diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp
index 18a0a73..26e10ca 100644
--- a/src/gui/util/qdesktopservices.cpp
+++ b/src/gui/util/qdesktopservices.cpp
@@ -288,8 +288,9 @@ void QDesktopServices::unsetUrlHandler(const QString &scheme)
\note The storage location returned can be a directory that does not exist; i.e., it
may need to be created by the system or the user.
- \note On Symbian OS, DataLocation and ApplicationsLocation always point to appropriate
- folder on same drive with executable. FontsLocation always points to folder on ROM drive.
+ \note On Symbian OS, ApplicationsLocation always point /sys/bin folder on the same drive
+ with executable. FontsLocation always points to folder on ROM drive. Symbian OS does not
+ have desktop concept, DesktopLocation returns same path as DocumentsLocation.
Rest of the standard locations point to folder on same drive with executable, except
that if executable is in ROM the folder from C drive is returned.
diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp
index 565dd6e..4531a2f 100644
--- a/src/gui/util/qdesktopservices_s60.cpp
+++ b/src/gui/util/qdesktopservices_s60.cpp
@@ -68,6 +68,7 @@
QT_BEGIN_NAMESPACE
+_LIT(KCacheSubDir, "Cache\\");
_LIT(KSysBin, "\\Sys\\Bin\\");
_LIT(KTempDir, "\\System\\Temp\\");
_LIT(KBrowserPrefix, "4 " );
@@ -125,7 +126,7 @@ static void handleMailtoSchemeLX(const QUrl &url)
CleanupStack::PopAndDestroy(accounts);
if(!count) {
- // TODO: we should try to create account if count == 0
+ // TODO: Task 259192: We should try to create account if count == 0
// CSendUi would provide account creation service for us, but it requires ridicilous
// capabilities: LocalServices NetworkServices ReadDeviceData ReadUserData WriteDeviceData WriteUserData
User::Leave(KErrNotSupported);
@@ -143,18 +144,18 @@ static void handleMailtoSchemeLX(const QUrl &url)
// To
foreach(QString item, recipients)
- sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo );
+ sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo);
foreach(QString item, tos)
- sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo );
+ sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo);
// Cc
foreach(QString item, ccs)
- sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientCc );
+ sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientCc);
// Bcc
foreach(QString item, bccs)
- sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientBcc );
+ sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientBcc);
// send the message
sendAsMessage.LaunchEditorAndCloseL();
@@ -172,32 +173,29 @@ static bool handleMailtoScheme(const QUrl &url)
static void handleOtherSchemesL(const TDesC& aUrl)
{
// Other schemes are at the moment passed to WEB browser
- HBufC* buf16 = HBufC::NewLC( aUrl.Length() + KBrowserPrefix.iTypeLength );
- buf16->Des().Copy( KBrowserPrefix ); // Prefix used to launch correct browser view
- buf16->Des().Append( aUrl );
-
- TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
- TApaTask task = taskList.FindApp( KUidBrowser );
- if ( task.Exists() )
- {
+ HBufC* buf16 = HBufC::NewLC(aUrl.Length() + KBrowserPrefix.iTypeLength);
+ buf16->Des().Copy(KBrowserPrefix); // Prefix used to launch correct browser view
+ buf16->Des().Append(aUrl);
+
+ TApaTaskList taskList(CEikonEnv::Static()->WsSession());
+ TApaTask task = taskList.FindApp(KUidBrowser);
+ if (task.Exists()){
// Switch to existing browser instance
- HBufC8* param8 = HBufC8::NewLC( buf16->Length() );
- param8->Des().Append( buf16->Des() );
- task.SendMessage( TUid::Uid( 0 ), *param8 ); // Uid is not used
- CleanupStack::PopAndDestroy( param8 );
- }
- else
- {
+ HBufC8* param8 = HBufC8::NewLC(buf16->Length());
+ param8->Des().Append(buf16->Des());
+ task.SendMessage(TUid::Uid( 0 ), *param8); // Uid is not used
+ CleanupStack::PopAndDestroy(param8);
+ } else {
// Start a new browser instance
RApaLsSession appArcSession;
- User::LeaveIfError( appArcSession.Connect() );
- CleanupClosePushL<RApaLsSession>( appArcSession );
+ User::LeaveIfError(appArcSession.Connect());
+ CleanupClosePushL<RApaLsSession>(appArcSession);
TThreadId id;
- appArcSession.StartDocument( *buf16, KUidBrowser , id );
+ appArcSession.StartDocument(*buf16, KUidBrowser, id);
CleanupStack::PopAndDestroy(); // appArcSession
- }
+ }
- CleanupStack::PopAndDestroy( buf16 );
+ CleanupStack::PopAndDestroy(buf16);
}
static bool handleOtherSchemes(const QUrl &url)
@@ -219,8 +217,8 @@ static TDriveUnit exeDrive()
static TDriveUnit writableExeDrive()
{
TDriveUnit drive = exeDrive();
- if( drive.operator TInt() == EDriveZ )
- return TDriveUnit( EDriveC );
+ if(drive.operator TInt() == EDriveZ)
+ return TDriveUnit(EDriveC);
return drive;
}
@@ -228,7 +226,7 @@ static TPtrC writableDataRoot()
{
TDriveUnit drive = exeDrive();
#ifdef Q_WS_S60
- switch( drive.operator TInt() ){
+ switch(drive.operator TInt()){
case EDriveC:
return PathInfo::PhoneMemoryRootPath();
break;
@@ -241,7 +239,6 @@ static TPtrC writableDataRoot()
return PathInfo::PhoneMemoryRootPath();
break;
default:
- // TODO: Should we return drive root similar to MemoryCardRootPath
return PathInfo::PhoneMemoryRootPath();
break;
}
@@ -258,13 +255,13 @@ static void openDocumentL(const TDesC& aUrl)
// Apparc base method cannot be used to open app in embedded mode,
// but seems to be most stable way at the moment
RApaLsSession appArcSession;
- User::LeaveIfError( appArcSession.Connect() );
- CleanupClosePushL<RApaLsSession>( appArcSession );
+ User::LeaveIfError(appArcSession.Connect());
+ CleanupClosePushL<RApaLsSession>(appArcSession);
TThreadId id;
// ESwitchFiles means do not start another instance
// Leaves if file does not exist, leave is trapped in openDocument and false returned to user.
- User::LeaveIfError( appArcSession.StartDocument( aUrl, id,
- RApaLsSession::ESwitchFiles ) ); // ELaunchNewApp
+ User::LeaveIfError(appArcSession.StartDocument(aUrl, id,
+ RApaLsSession::ESwitchFiles)); // ELaunchNewApp
CleanupStack::PopAndDestroy(); // appArcSession
#else
// This is an alternative way to launch app associated to MIME type
@@ -306,8 +303,8 @@ static bool handleUrl(const QUrl &url)
static void handleUrlL(const TDesC& aUrl)
{
- CSchemeHandler* schemeHandler = CSchemeHandler::NewL( aUrl );
- CleanupStack::PushL( schemeHandler );
+ CSchemeHandler* schemeHandler = CSchemeHandler::NewL(aUrl);
+ CleanupStack::PushL(schemeHandler);
schemeHandler->HandleUrlStandaloneL(); // Process the Url in standalone mode
CleanupStack::PopAndDestroy();
}
@@ -351,7 +348,9 @@ QString QDesktopServices::storageLocation(StandardLocation type)
switch (type) {
case DesktopLocation:
- qWarning("QDesktopServices::storageLocation %d not implemented", type);
+ qWarning("No desktop concept in Symbian OS");
+ // But lets still use some feasible default
+ path.Append(writableDataRoot());
break;
case DocumentsLocation:
path.Append(writableDataRoot());
@@ -391,11 +390,17 @@ QString QDesktopServices::storageLocation(StandardLocation type)
//return QDir::homePath(); break;
break;
case DataLocation:
- CEikonEnv::Static()->FsSession().PrivatePath( path );
- // TODO: Should we actually return phone mem if data is on ROM?
- path.Insert( 0, exeDrive().Name() );
+ CEikonEnv::Static()->FsSession().PrivatePath(path);
+ path.Insert(0, writableExeDrive().Name());
break;
+ case CacheLocation:
+ CEikonEnv::Static()->FsSession().PrivatePath(path);
+ path.Insert(0, writableExeDrive().Name());
+ path.Append(KCacheSubDir);
+ break;
default:
+ // Lets use feasible default
+ path.Append(writableDataRoot());
break;
}