searchui/stateproviders/searchstateprovider/src/searchprogressivestate.cpp
changeset 7 51d10d255e92
parent 5 3bc31ad99ee7
child 9 4a2987baf8f7
child 11 773be20e0a25
--- a/searchui/stateproviders/searchstateprovider/src/searchprogressivestate.cpp	Thu May 27 12:52:35 2010 +0300
+++ b/searchui/stateproviders/searchstateprovider/src/searchprogressivestate.cpp	Fri Jun 11 13:39:26 2010 +0300
@@ -598,46 +598,28 @@
         }
     else if (item->data(Qt::UserRole + 1).toString().contains("applications"))
         {
-        TRAPD(err,
-                    {LaunchApplicationL(TUid::Uid((item->data(Qt::UserRole)).toString().toInt(&t, 16)));})
-        if (err == KErrNone)
-            {
-            }
+        TRAP_IGNORE(LaunchApplicationL(TUid::Uid((item->data(Qt::UserRole)).toString().toInt(&t, 16))));
         }
     else if (item->data(Qt::UserRole + 1).toString().contains("file"))
         {
+        QString uid = item->data(Qt::UserRole).toString();
+        QFile file(uid);
+        mRequest = mAiwMgr->create(file, false);
+        args << file.fileName();
         }
-    else if (item->data(Qt::UserRole + 1).toString().contains("video"))
-        {
-        mRequest = mAiwMgr->create("com.nokia.videos", "IVideoView",
-                "playMedia(QString)", false);
-
-        QString uid = getDrivefromMediaId(
-                item->data(Qt::UserRole + 2).toString());
-        uid.append(':');
-        uid.append(item->data(Qt::UserRole).toString());
-        args << uid;
-        }
-    else if (item->data(Qt::UserRole + 1).toString().contains("audio"))
+    else if ((item->data(Qt::UserRole + 1).toString().contains("video"))
+            || (item->data(Qt::UserRole + 1).toString().contains("audio"))
+            || (item->data(Qt::UserRole + 1).toString().contains("image")))
         {
         QString uid = getDrivefromMediaId(
                 item->data(Qt::UserRole + 2).toString());
         uid.append(':');
         uid.append(item->data(Qt::UserRole).toString());
-        mRequest = mAiwMgr->create("musicplayer",
-                "com.nokia.symbian.IFileView", "view(QString)", false);
-        args << uid;
+        QFile file(uid);
+        mRequest = mAiwMgr->create(file, false);
+        args << file.fileName();
         }
-    else if (item->data(Qt::UserRole + 1).toString().contains("image"))
-        {
-        QString uid = getDrivefromMediaId(
-                item->data(Qt::UserRole + 2).toString());
-        uid.append(':');
-        uid.append(item->data(Qt::UserRole).toString());
-        mRequest = mAiwMgr->create("com.nokia.services.media",
-                "com.nokia.symbian.IFileView", "view(QString)", false);
-        args << uid;
-        }
+
     else if (item->data(Qt::UserRole + 1).toString().contains("notes"))
         {
         if (!notesEditor)
@@ -830,11 +812,11 @@
         mDatabasecount = 0;
         mLinkindex = 0;
         //Prefix query
-        /*mSearchString = "$prefix(\"";
+        mSearchString = "$prefix(\"";
         mSearchString += mOriginalString;
-        mSearchString += "\")";*/
-        mSearchString = mOriginalString;
-        mSearchString.append('*');
+        mSearchString += "\")";
+        /*mSearchString = mOriginalString;
+         mSearchString.append('*');*/
         searchOnCategory(mSearchString);
         }
     }