diff -r a5692c68d772 -r 593f946f4fec controlpanelplugins/themeplugin/src/cpthemelistmodel.cpp --- a/controlpanelplugins/themeplugin/src/cpthemelistmodel.cpp Fri Jun 25 17:12:20 2010 +0800 +++ b/controlpanelplugins/themeplugin/src/cpthemelistmodel.cpp Wed Sep 29 10:09:58 2010 +0800 @@ -18,6 +18,7 @@ #include #include #include +#include #include @@ -45,25 +46,14 @@ //Look into theme paths and add a file watcher for it //to get notified when themes are added. - QStringList themesPathList = CpThemeUtil::themePathList(); - foreach (const QString &path, themesPathList) { - QDir themeDir; - themeDir.setPath( path ) ; - QStringList list = themeDir.entryList(QDir::AllDirs|QDir::NoDotAndDotDot,QDir::Name); - if(list.contains("themes", Qt::CaseSensitive )) { - mFileWatcher->addPath(themeDir.path() + "/themes/"); - } + QStringList themePaths = CpThemeUtil::themeDirectories(mThemeList); + if(!themePaths.empty()) { + mFileWatcher->addPaths(themePaths); } - connect(mFileWatcher, SIGNAL(directoryChanged(const QString&)), + + connect(mFileWatcher, SIGNAL(directoryChanged(QString)), this, SLOT(themeListChanged())); - - // data for the list which appears after the themes: - CpThemeInfo fetchFromStore; - fetchFromStore.setName(hbTrId("txt_cp_list_get_more_tones")); - fetchFromStore.setItemType(CpThemeInfo::ThemeListItemType_URL); - fetchFromStore.setItemData(QString("http://lr.ovi.mobi/store/themes")); - fetchFromStore.setIcon(HbIcon("qtg_large_ovistore")); - mBottomThemeList.append(fetchFromStore); + } /* @@ -116,23 +106,11 @@ case Qt::DisplayRole: retVal = list->at(row).name(); break; - - 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(); - break; - - case LandscapePreviewRole: - retVal = list->at(row).landscapePreviewIcon(); - break; - + case ItemDataRole: retVal = list->at(row).itemData(); break;