# HG changeset patch # User hgs # Date 1280978909 -28800 # Node ID 313976a11e23865ce7b1494744e4a18fc4843eb5 # Parent e0b83131558d7ee73c86f9b33aa2c290852a1c05 201031 diff -r e0b83131558d -r 313976a11e23 controlpanelplugins/themeplugin/src/cpthemecontrol.cpp --- a/controlpanelplugins/themeplugin/src/cpthemecontrol.cpp Fri Jul 23 11:04:51 2010 +0800 +++ b/controlpanelplugins/themeplugin/src/cpthemecontrol.cpp Thu Aug 05 11:28:29 2010 +0800 @@ -51,7 +51,7 @@ #include //time out time before showing a processing dialog. -static const int KThemeChangeTimeOutMilliSeconds = 1000; +static const int KThemeChangeTimeOutMilliSeconds = 2000; /*! Helper function to fetch the main window. @@ -247,6 +247,7 @@ } +#ifdef CP_THEME_PREVIEW_DEFINED //Set up the theme preview and set it to //the current view of main window. @@ -268,6 +269,9 @@ mThemePreview->setTitle(hbTrId("txt_cp_title_control_panel")); mWindow->setCurrentView(mThemePreview); +#else + themeApplied(themeInfo); +#endif } @@ -288,8 +292,13 @@ mThemeChangeFinished = false; } else { //theme change failed, go back to control panel. +#ifdef CP_THEME_PREVIEW_DEFINED previewClosed(); triggerThemeListClose(); +#else + setActiveThemeIndex(); +#endif + } } @@ -343,12 +352,19 @@ if(mWaitDialog && mWaitDialog->isVisible()) { mWaitDialog->hide(); } - - previewClosed(); - //ask the themelistview to close. Control Panel will - //take care of removing it from window. - triggerThemeListClose(); - + +#ifdef CP_THEME_PREVIEW_DEFINED + previewClosed(); + //ask the themelistview to close. Control Panel will + //take care of removing it from window. + triggerThemeListClose(); +#else + setActiveThemeIndex(); + +#endif + + + QThread::currentThread()->setPriority(QThread::NormalPriority); } diff -r e0b83131558d -r 313976a11e23 controlpanelplugins/themeplugin/src/cpthemelistmodel.cpp --- a/controlpanelplugins/themeplugin/src/cpthemelistmodel.cpp Fri Jul 23 11:04:51 2010 +0800 +++ b/controlpanelplugins/themeplugin/src/cpthemelistmodel.cpp Thu Aug 05 11:28:29 2010 +0800 @@ -51,7 +51,7 @@ mFileWatcher->addPaths(themePaths); } - connect(mFileWatcher, SIGNAL(directoryChanged(QString&)), + connect(mFileWatcher, SIGNAL(directoryChanged(QString)), this, SLOT(themeListChanged())); // data for the list which appears after the themes: @@ -113,14 +113,10 @@ case Qt::DisplayRole: retVal = list->at(row).name(); break; - +#ifdef CP_THEME_PREVIEW_DEFINED case Qt::DecorationRole: retVal = list->at(row).icon(); break; - - case Qt::SizeHintRole: - retVal = list->at(row).icon().size(); - break; case PortraitPreviewRole: retVal = list->at(row).portraitPreviewIcon(); @@ -129,7 +125,11 @@ case LandscapePreviewRole: retVal = list->at(row).landscapePreviewIcon(); break; - +#endif + case Qt::SizeHintRole: + retVal = list->at(row).icon().size(); + break; + case ItemDataRole: retVal = list->at(row).itemData(); break; diff -r e0b83131558d -r 313976a11e23 controlpanelplugins/themeplugin/src/cpthemepreview.cpp --- a/controlpanelplugins/themeplugin/src/cpthemepreview.cpp Fri Jul 23 11:04:51 2010 +0800 +++ b/controlpanelplugins/themeplugin/src/cpthemepreview.cpp Thu Aug 05 11:28:29 2010 +0800 @@ -83,9 +83,10 @@ else { mPreviewIcon = new HbIconItem(mTheme.portraitPreviewIcon(), this); //set to ignore aspect ratio so the layout would rezise the icon correctly. - mPreviewIcon->setAspectRatioMode(Qt::IgnoreAspectRatio); } + mPreviewIcon->setAspectRatioMode(Qt::IgnoreAspectRatio); + // set an object name for preview icon to make it testable for automation testing mPreviewIcon->setObjectName(QString("themePreviewIcon")); @@ -176,7 +177,7 @@ QGraphicsLinearLayout* previewLayout = 0; if(containerLayout) { //get the layout that preview icon belongs to. - previewLayout = dynamic_cast(containerLayout->itemAt(0)); + previewLayout = dynamic_cast(containerLayout->itemAt(1)); } if(previewLayout && mPreviewIcon && mPreviewIcon == dynamic_cast(previewLayout->itemAt(0)) ) { @@ -185,16 +186,16 @@ if(orientation == Qt::Horizontal) { mPreviewIcon->setIcon(mTheme.landscapePreviewIcon()); - mPreviewIcon->setAspectRatioMode(Qt::KeepAspectRatio); } else { mPreviewIcon->setIcon(mTheme.portraitPreviewIcon()); - mPreviewIcon->setAspectRatioMode(Qt::IgnoreAspectRatio); } previewLayout->addItem(mPreviewIcon); } } + + diff -r e0b83131558d -r 313976a11e23 controlpanelplugins/themeplugin/themeplugin.pro --- a/controlpanelplugins/themeplugin/themeplugin.pro Fri Jul 23 11:04:51 2010 +0800 +++ b/controlpanelplugins/themeplugin/themeplugin.pro Thu Aug 05 11:28:29 2010 +0800 @@ -25,6 +25,10 @@ CONFIG += debug_and_release RESOURCES += themeplugin.qrc +#comment this out if theme plugin should have +#a preview view. +DEFINES += CP_THEME_PREVIEW_DEFINED + include (themeplugin.pri) include (rom/themeplugin_rom.pri) @@ -61,6 +65,7 @@ LIBS += -L$$DESTDIR + #For some reason the default include path doesn't include MOC_DIR on symbian symbian { INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE diff -r e0b83131558d -r 313976a11e23 controlpanelui/src/cpcategorymodel/src/cpcategorymodelutility.cpp --- a/controlpanelui/src/cpcategorymodel/src/cpcategorymodelutility.cpp Fri Jul 23 11:04:51 2010 +0800 +++ b/controlpanelui/src/cpcategorymodel/src/cpcategorymodelutility.cpp Thu Aug 05 11:28:29 2010 +0800 @@ -110,7 +110,7 @@ event->mPluginFile = pluginConfig.mPluginFile; //firstly, handle CpPluginInterface - if (CpPluginInterface *plugin = CpPluginLoader().loadCpPluginInterface(pluginConfig.mPluginFile)) { + if (CpPluginInterface *plugin = CpPluginLoader::loadCpPluginInterface(pluginConfig.mPluginFile)) { CPFW_LOG("Load root component CpPluginInterface succeed."); event->mPluginInterface = plugin; } @@ -164,7 +164,7 @@ QList itemDataList; //firstly, handle CpPluginInterface - if (CpPluginInterface *plugin = CpPluginLoader().loadCpPluginInterface(pluginConfig.mPluginFile)) { + if (CpPluginInterface *plugin = CpPluginLoader::loadCpPluginInterface(pluginConfig.mPluginFile)) { CPFW_LOG("Load root component CpPluginInterface succeed."); itemDataList = plugin->createSettingFormItemData(itemDataHelper); } diff -r e0b83131558d -r 313976a11e23 controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilenameeditdialog.cpp --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilenameeditdialog.cpp Fri Jul 23 11:04:51 2010 +0800 +++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilenameeditdialog.cpp Thu Aug 05 11:28:29 2010 +0800 @@ -74,9 +74,6 @@ profileEditNameDialog->setLineEditText( profileName ); profileEditNameDialog->checkPrimaryAction(); - - HbAction *secondAction = qobject_cast - (profileEditNameDialog->actions().at(1)); profileEditNameDialog->show(); return false; } diff -r e0b83131558d -r 313976a11e23 controlpanelui/src/tonefetcher/inc/tonefetcherlogger.h --- a/controlpanelui/src/tonefetcher/inc/tonefetcherlogger.h Fri Jul 23 11:04:51 2010 +0800 +++ b/controlpanelui/src/tonefetcher/inc/tonefetcherlogger.h Thu Aug 05 11:28:29 2010 +0800 @@ -12,7 +12,7 @@ * Contributors: * * Description: - * The header file for tone fetcher utilities. + * The header file for tone fetcher logger. * */ @@ -22,6 +22,12 @@ #include #include +/* + make LOG work +*/ + +//#define ENABLE_TONEFETCHER_LOG + #define TONEFETCHER_LOGGER_NAME QLatin1String("ToneFetcher") #if defined (Q_OS_SYMBIAN) @@ -34,6 +40,10 @@ #endif #endif -#define TF_LOG(str) Logger::instance(TONEFETCHER_LOGGER_NAME)->log(str); +#ifdef ENABLE_TONEFETCHER_LOG + #define TF_LOG(str) Logger::instance(TONEFETCHER_LOGGER_NAME)->log(str); +#else + #define TF_LOG(str) +#endif #endif /* TONEFETCHERLOGGER_H */ diff -r e0b83131558d -r 313976a11e23 controlpanelui/src/tonefetcher/src/main.cpp --- a/controlpanelui/src/tonefetcher/src/main.cpp Fri Jul 23 11:04:51 2010 +0800 +++ b/controlpanelui/src/tonefetcher/src/main.cpp Thu Aug 05 11:28:29 2010 +0800 @@ -25,12 +25,17 @@ { HbApplication a(argc, argv); - +#ifdef ENABLE_TONEFETCHER_LOG Logger::instance(TONEFETCHER_LOGGER_NAME)->configure( TF_LOGGER_CONFIG_PATH,QSettings::IniFormat); - +#endif TF_LOG("Entering tonefetcher.exe..."); ToneFetcherMainWindow w; w.show(); - return a.exec(); + int ret = a.exec(); + TF_LOG("Leaving tonefetcher.exe..."); +#ifdef ENABLE_TONEFETCHER_LOG + Logger::closeAll(); +#endif + return ret; } diff -r e0b83131558d -r 313976a11e23 controlpanelui/src/tonefetcher/tonefetcher.pro --- a/controlpanelui/src/tonefetcher/tonefetcher.pro Fri Jul 23 11:04:51 2010 +0800 +++ b/controlpanelui/src/tonefetcher/tonefetcher.pro Thu Aug 05 11:28:29 2010 +0800 @@ -45,6 +45,7 @@ TARGET.UID3 = 0x2002BCCA TARGET.CAPABILITY = ALL -TCB + TARGET.VID = VID_DEFAULT BLD_INF_RULES.prj_exports += "./service_conf.xml z:/private/2002BCCA/service_conf.xml" } symbian { diff -r e0b83131558d -r 313976a11e23 controlpanelui/src/tonefetcher/tonefetcherengine/private/CToneSelection.cpp --- a/controlpanelui/src/tonefetcher/tonefetcherengine/private/CToneSelection.cpp Fri Jul 23 11:04:51 2010 +0800 +++ b/controlpanelui/src/tonefetcher/tonefetcherengine/private/CToneSelection.cpp Thu Aug 05 11:28:29 2010 +0800 @@ -28,6 +28,7 @@ //refresh interval, 2 seconds. const TInt KTimerInterval = 2 * 1000 * 1000; const TInt KObserverCallStep = 100; +const TInt KOneKiloByte = 1024; // CONSTANTS _LIT( KMimeMp3, "mp3" ); @@ -172,8 +173,8 @@ } void CToneSelection::HandleObjectNotification( CMdESession& /*aSession*/, - TObserverNotificationType aType, - const RArray& aObjectIdArray ) + TObserverNotificationType /*aType*/, + const RArray& /*aObjectIdArray*/ ) { /*if ( aObjectIdArray.Count() > 0 && ( aType == ENotifyAdd || aType == ENotifyModify || aType == ENotifyRemove ) ) { @@ -300,7 +301,7 @@ return PropertyDefL( iSession, aAttr ); } -CMdEPropertyDef& CToneSelection::PropertyDefL( CMdESession* aSession, TInt aAttr ) +CMdEPropertyDef& CToneSelection::PropertyDefL( CMdESession* /*aSession*/, TInt aAttr ) { CMdEObjectDef& objectDef = iDefNS->GetObjectDefL( MdeConstants::Audio::KAudioObject ); @@ -337,6 +338,8 @@ { User::Leave( KErrNotSupported ); } + //avoid critical warning + return objectDef.GetPropertyDefL( MdeConstants::Audio::KAudioObject ); } void CToneSelection::ExcludeMusicPropertiesL( CMdELogicCondition& aCondition ) @@ -357,7 +360,7 @@ CMdELogicCondition& condition = aCondition.AddLogicConditionL( ELogicConditionOperatorAnd ); - condition.AddPropertyConditionL( sizeTypeDef, TMdEIntRange(0, iMaxFileSize, EMdERangeTypeBetween) ); + condition.AddPropertyConditionL( sizeTypeDef, TMdEIntRange(0, iMaxFileSize * KOneKiloByte, EMdERangeTypeNotBetween) ); condition.AddPropertyConditionL( mimeTypeDef, ETextPropertyConditionCompareContains, KMimeMp3 ); condition.AddPropertyConditionL( artistTypeDef ); diff -r e0b83131558d -r 313976a11e23 controlpanelui/src/tonefetcher/tonefetcherengine/private/tonefetcherengine_symbian.cpp --- a/controlpanelui/src/tonefetcher/tonefetcherengine/private/tonefetcherengine_symbian.cpp Fri Jul 23 11:04:51 2010 +0800 +++ b/controlpanelui/src/tonefetcher/tonefetcherengine/private/tonefetcherengine_symbian.cpp Thu Aug 05 11:28:29 2010 +0800 @@ -25,8 +25,8 @@ ToneFetcherEnginePrivate::ToneFetcherEnginePrivate() { - TRAPD( err, mToneSelection = CToneSelection::NewL( this ) ); - TRAPD( error, mTonePlayer = CTonePlayer::NewL( this ) ); + TRAP_IGNORE( mToneSelection = CToneSelection::NewL( this ) ); + TRAP_IGNORE( mTonePlayer = CTonePlayer::NewL( this ) ); } ToneFetcherEnginePrivate::~ToneFetcherEnginePrivate()