summaryrefslogtreecommitdiffstats
path: root/demos/embedded/desktopservices/contenttab.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'demos/embedded/desktopservices/contenttab.cpp')
-rw-r--r--demos/embedded/desktopservices/contenttab.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/demos/embedded/desktopservices/contenttab.cpp b/demos/embedded/desktopservices/contenttab.cpp
index 69b7cf8..d218702 100644
--- a/demos/embedded/desktopservices/contenttab.cpp
+++ b/demos/embedded/desktopservices/contenttab.cpp
@@ -145,9 +145,20 @@ void ContentTab::handleErrorInOpen(QListWidgetItem *item)
// NEW SLOTS
void ContentTab::openItem(QListWidgetItem *item)
{
- bool ret = QDesktopServices::openUrl(itemUrl(item));
- if (!ret)
- handleErrorInOpen(item);
+#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
+ // Opening music files doesn't work in Symbian emulator and in some SDKs freezes the
+ // emulator entirely, so prevent it.
+ QStringList nameFilters = m_ContentDir.nameFilters();
+ if (nameFilters.contains("*.mp3")) {
+ QMessageBox::warning(this, tr("Operation Failed"), tr("Action not supported in emulator."),
+ QMessageBox::Close);
+ } else
+#endif
+ {
+ bool ret = QDesktopServices::openUrl(itemUrl(item));
+ if (!ret)
+ handleErrorInOpen(item);
+ }
}