--- a/controlpanelplugins/themeplugin/src/cpthemecontrol.cpp Wed Jul 14 07:09:46 2010 +0800
+++ b/controlpanelplugins/themeplugin/src/cpthemecontrol.cpp Fri Jul 23 11:04:51 2010 +0800
@@ -128,8 +128,8 @@
//connect to signal for selecting a list item.
- connect(mThemeListView,SIGNAL(newThemeSelected(const QModelIndex&)),
- this,SLOT(newThemeSelected(const QModelIndex&)));
+ connect(mThemeListView,SIGNAL(newThemeSelected(QModelIndex)),
+ this,SLOT(newThemeSelected(QModelIndex)));
//handle signal for list view closing. (e.g Back softkey pressed)
connect(mThemeListView,SIGNAL(aboutToClose()),
@@ -225,6 +225,11 @@
themeInfo.setName(data.toString());
}
+ data = index.data(CpThemeListModel::ItemDataRole);
+ if(data.isValid()) {
+ themeInfo.setItemData(data.toString());
+ }
+
//get theme icon.
data = index.data(Qt::DecorationRole);
if(data.isValid()) {
@@ -241,6 +246,8 @@
themeInfo.setLandscapePreviewIcon(data.value<HbIcon>());
}
+
+
//Set up the theme preview and set it to
//the current view of main window.
@@ -253,8 +260,8 @@
connect(mThemePreview,SIGNAL(aboutToClose()),
this, SLOT(previewClosed()));
- connect(mThemePreview, SIGNAL(applyTheme(const QString&)),
- this, SLOT(themeApplied(const QString&)));
+ connect(mThemePreview, SIGNAL(applyTheme(CpThemeInfo)),
+ this, SLOT(themeApplied(CpThemeInfo)));
} else {
mThemePreview->setThemeInfo(themeInfo);
}
@@ -267,7 +274,7 @@
/*!
Slot called when a Select key is pressed in theme preview view.
*/
-void CpThemeControl::themeApplied(const QString& theme)
+void CpThemeControl::themeApplied(const CpThemeInfo& theme)
{
QThread::currentThread()->setPriority(QThread::HighPriority);
@@ -393,6 +400,9 @@
//set current index.
mThemeListView->themeList()->setCurrentIndex(sourceIndex, QItemSelectionModel::SelectCurrent);
}
+ else {
+ mThemeListView->themeList()->setCurrentIndex(QModelIndex(), QItemSelectionModel::Clear);
+ }
}