ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlersend.cpp
changeset 24 99ad1390cd33
child 29 2c833fc9e98f
equal deleted inserted replaced
23:74c9f037fd5d 24:99ad1390cd33
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 #include "glxcommandhandlersend.h"
       
    19 #include <QModelIndex>
       
    20 #include <shareuidialog.h>
       
    21 #include <glxmodelparm.h>
       
    22 #include <glxmediamodel.h>
       
    23 #include <QAbstractItemModel>
       
    24 
       
    25 GlxCommandHandlerSend::GlxCommandHandlerSend()
       
    26     {
       
    27 
       
    28     }
       
    29 
       
    30 
       
    31 GlxCommandHandlerSend::~GlxCommandHandlerSend()
       
    32     {
       
    33    
       
    34     }
       
    35 
       
    36 void GlxCommandHandlerSend::doHandleUserAction(GlxMediaModel* model,QList<QModelIndex> indexList) const
       
    37 {
       
    38    QList <QVariant> fileList;
       
    39    QString imagePath ;
       
    40    //The Index list is NULL, when the item is selected to be sent from contect menu 
       
    41    // and fullscreen view,so that inturn is sending the focused item
       
    42     if(indexList.count() == 0)
       
    43         {
       
    44         imagePath = (model->data(model->index(model->data(model->index(0,0),GlxFocusIndexRole).value<int>(),0),GlxUriRole)).value<QString>();
       
    45         fileList.append(QVariant(imagePath));
       
    46         }
       
    47     else
       
    48     {
       
    49     for ( int i = 0; i < indexList.count(); i++)
       
    50         {        
       
    51         imagePath = (model->data(indexList[i],GlxUriRole)).value<QString>();
       
    52         fileList.append(QVariant(imagePath));        
       
    53         } 
       
    54     }
       
    55     ShareUi dialog;                               
       
    56     dialog.init(fileList,true);
       
    57 }
       
    58