messagingapp/shareui/src/shareuiprivate.cpp
changeset 44 36f374c67aa8
parent 34 84197e66a4bd
child 47 5b14749788d7
child 52 12db4185673b
equal deleted inserted replaced
43:35b64624a9e7 44:36f374c67aa8
    67 /**
    67 /**
    68  * Destructor.
    68  * Destructor.
    69  */
    69  */
    70 ShareUiPrivate::~ShareUiPrivate()
    70 ShareUiPrivate::~ShareUiPrivate()
    71     {
    71     {
    72     reset();
       
    73     }
    72     }
    74 
    73 
    75 /**
    74 /**
    76  * Clear the internal data structures
    75  * Clear the internal data structures
    77  */
    76  */
    78 void ShareUiPrivate::reset()
    77 void ShareUiPrivate::reset()
    79     {
    78     {
    80     mFileList.clear();
    79     mFileList.clear();
    81 
    80 
    82     mIndexActionMap.clear();
    81     mIndexActionMap.clear();
       
    82     foreach(XQAiwRequest* request,mAiwRequestList)
       
    83     {
       
    84         delete request;
       
    85     }
    83     mAiwRequestList.clear();
    86     mAiwRequestList.clear();
    84 
    87 
    85     }
    88     }
    86 
    89 
    87 /**
    90 /**
   123     
   126     
   124     // Some protected content
   127     // Some protected content
   125     if ( fileList.count() != filteredFileList.count() )
   128     if ( fileList.count() != filteredFileList.count() )
   126         {
   129         {
   127         showNote(LOC_PROTECTED_CONTENT);      
   130         showNote(LOC_PROTECTED_CONTENT);      
       
   131         return true;
   128         }
   132         }
   129     
   133     
   130     // Only protected content
   134     // Only protected content
   131     if ( filteredFileList.count() == 0 )
   135     if ( filteredFileList.count() == 0 )
   132         {
   136         {
   203     mSharePopup = new HbDialog();
   207     mSharePopup = new HbDialog();
   204     // make it delete itself on close
   208     // make it delete itself on close
   205     mSharePopup->setAttribute( Qt::WA_DeleteOnClose, true );
   209     mSharePopup->setAttribute( Qt::WA_DeleteOnClose, true );
   206     HbTextItem* heading = new HbTextItem(LOC_SEND_SELECTED_ITEM, mSharePopup);
   210     HbTextItem* heading = new HbTextItem(LOC_SEND_SELECTED_ITEM, mSharePopup);
   207     heading->setAlignment(Qt::AlignCenter);
   211     heading->setAlignment(Qt::AlignCenter);
   208     mSharePopup->setDismissPolicy(HbDialog::NoDismiss);
   212     mSharePopup->setDismissPolicy(HbDialog::TapAnywhere);
   209     mSharePopup->setHeadingWidget(heading);
   213     mSharePopup->setHeadingWidget(heading);
   210     mSharePopup->setFrameType(HbDialog::Strong);
   214     mSharePopup->setFrameType(HbDialog::Strong);
       
   215     connect(mSharePopup, SIGNAL(aboutToClose()), this, SLOT(reset()));
   211         
   216         
   212     // Content widget
   217     // Content widget
   213     mContentListView = new HbListView(mSharePopup);
   218     mContentListView = new HbListView(mSharePopup);
   214     ShareListItem *prototype = new ShareListItem(mSharePopup);
   219     ShareListItem *prototype = new ShareListItem(mSharePopup);
   215     mContentListView->setItemPrototype(prototype);
   220     mContentListView->setItemPrototype(prototype);
   266 /**
   271 /**
   267  * Slot for handling send service selection on the UI.
   272  * Slot for handling send service selection on the UI.
   268  */
   273  */
   269 void ShareUiPrivate::onTriggered(void)
   274 void ShareUiPrivate::onTriggered(void)
   270     {
   275     {
       
   276     
   271     XQAiwRequest* request = 0;
   277     XQAiwRequest* request = 0;
   272     request = qobject_cast<XQAiwRequest*>(sender());
   278     request = qobject_cast<XQAiwRequest*>(sender());
   273     if(request)
   279     if(request)
   274         {
   280         {
   275         QList<QVariant> args;
   281         QList<QVariant> args;
   282 
   288 
   283 /**
   289 /**
   284  * Slot for handling valid returns from the framework.
   290  * Slot for handling valid returns from the framework.
   285  */
   291  */
   286 void ShareUiPrivate::handleOk(const QVariant& result)
   292 void ShareUiPrivate::handleOk(const QVariant& result)
   287     {
   293 {
   288     Q_UNUSED(result)
   294     Q_UNUSED(result)
   289     }
   295          
       
   296     XQAiwRequest* request = 0;
       
   297     request = qobject_cast<XQAiwRequest*>(sender());
       
   298     if(request)
       
   299     {
       
   300        disconnect(request, 
       
   301                SIGNAL(requestError(int,const QString&)), 
       
   302                this, 
       
   303                SLOT(handleError(int,const QString&)));
       
   304     }
       
   305 }
   290 
   306 
   291 /**
   307 /**
   292  * Slot for handling errors from the framework.
   308  * Slot for handling errors from the framework.
   293  */
   309  */
   294 void ShareUiPrivate::handleError(int errorCode, const QString& errorMessage)
   310 void ShareUiPrivate::handleError(int errorCode, const QString& errorMessage)
   313     
   329     
   314     if ( action )
   330     if ( action )
   315         {
   331         {
   316         action->setEnabled(true);
   332         action->setEnabled(true);
   317         action->activate(HbAction::Trigger);
   333         action->activate(HbAction::Trigger);
   318         }    
   334         } 
       
   335     
   319     mSharePopup->close();
   336     mSharePopup->close();
   320     }
   337     }
   321 
   338 
   322 
   339 
   323 /**
   340 /**