# HG changeset patch # User hgs # Date 1284039452 -10800 # Node ID 59984e68247dea2bfc1c239087c87cc7e99917aa # Parent 554fe4dbbb59dc435753521c16cb8d2e3f21f131 201035_1 diff -r 554fe4dbbb59 -r 59984e68247d contactwidgethsplugin/contactwidgeths/inc/contactwidgeths.h --- a/contactwidgethsplugin/contactwidgeths/inc/contactwidgeths.h Fri Sep 03 14:32:33 2010 +0300 +++ b/contactwidgethsplugin/contactwidgeths/inc/contactwidgeths.h Thu Sep 09 16:37:32 2010 +0300 @@ -91,6 +91,8 @@ void thumbnailReady(QPixmap, void*, int, int); void loadNormalLayout(); void onRequestComplete(); + void onSelfContactIdChanged(const QContactLocalId &theOldId, + const QContactLocalId &theNewId); private: void createUI(); @@ -111,6 +113,7 @@ bool launchSingleContactSelecting(); void createLauncherWithPosition(); void loadLayout(const QString frameName, const QString textColor); + void finishWidget(); private: HbIconItem *mAvatarIconItem; diff -r 554fe4dbbb59 -r 59984e68247d contactwidgethsplugin/contactwidgeths/src/contactwidgeths.cpp --- a/contactwidgethsplugin/contactwidgeths/src/contactwidgeths.cpp Fri Sep 03 14:32:33 2010 +0300 +++ b/contactwidgethsplugin/contactwidgeths/src/contactwidgeths.cpp Thu Sep 09 16:37:32 2010 +0300 @@ -92,7 +92,6 @@ mThumbnailPixmap(QPixmap()), mThumbnailInProgress(false), mTranslator(new HbTranslator(translationsPath, translationsFile)), - mAvatarIcon(0), mPendingExit(false) { // Localization file loading @@ -601,6 +600,12 @@ this, SLOT(onContactsChanged(QList))); connect(mContactManager, SIGNAL(contactsRemoved(QList)), this, SLOT(onContactsRemoved(QList))); + connect(mContactManager, + SIGNAL(selfContactIdChanged(const QContactLocalId &, + const QContactLocalId &)), + this, + SLOT(onSelfContactIdChanged(const QContactLocalId &, + const QContactLocalId &))); } } @@ -811,21 +816,7 @@ for(i=0; ideleteLater(); - mContactNameLabel->deleteLater(); - - mContactLocalId = unUsedContactId; - - mContactHasAvatarDetail = false; - - - if (!mLauncher->isPendingRequest()){ - emit finished(); - } - else { - mPendingExit = true; - } + finishWidget(); break; } } @@ -890,5 +881,26 @@ update(); } +void ContactWidgetHs::onSelfContactIdChanged(const QContactLocalId &theOldId, + const QContactLocalId &theNewId) { + if (0 != theNewId && mContactLocalId == theNewId) { + qDebug() << "-deleting widget after selfcontact change" + << mContactLocalId; + finishWidget(); + } +} + +void ContactWidgetHs::finishWidget() { + mAvatarIconItem->deleteLater(); + mContactNameLabel->deleteLater(); + mContactLocalId = unUsedContactId; + mContactHasAvatarDetail = false; + + if (!mLauncher->isPendingRequest()) { + emit finished(); + } else { + mPendingExit = true; + } +} Q_IMPLEMENT_USER_METATYPE(CntServicesContact) Q_IMPLEMENT_USER_METATYPE_NO_OPERATORS(CntServicesContactList) diff -r 554fe4dbbb59 -r 59984e68247d contactwidgethsplugin/resource/qtg_graf_hswidget_preview_contact.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contactwidgethsplugin/resource/qtg_graf_hswidget_preview_contact.svg Thu Sep 09 16:37:32 2010 +0300 @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 554fe4dbbb59 -r 59984e68247d contactwidgethsplugin/sis/contactwidgethsplugin.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contactwidgethsplugin/sis/contactwidgethsplugin.pkg Thu Sep 09 16:37:32 2010 +0300 @@ -0,0 +1,50 @@ +; +; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; + + +; Language +&EN + + +; SIS header: name, uid, version +#{"contactwidgethsplugin"},(0x2002C353),1,0,0,TYPE=PU + +; Localised Vendor name +%{"Vendor"} + +; Unique Vendor name +:"Vendor" + + +; Manual PKG pre-rules from PRO files +; Default dependency to Qt libraries +(0x2001E61C), 4, 7, 0, {"Qt"} +; Default HW/platform dependencies +;[0x101F7961],0,0,0,{"S60ProductID"} +;[0x102032BE],0,0,0,{"S60ProductID"} +;[0x102752AE],0,0,0,{"S60ProductID"} +;[0x1028315F],0,0,0,{"S60ProductID"} +;[0x20022e6d],0,0,0,{"S60ProductID"} + +; Default dependency to QtMobility libraries +;(0x2002AC89), 1, 0, 2, {"QtMobility"} + +; DEPLOYMENT +"/epoc32/release/armv5/urel/contactwidgethsplugin.dll" - "!:\sys\bin\contactwidgethsplugin.dll" +"/epoc32/data/z/private/20022F35/import/widgetregistry/2002C353/contactwidgethsplugin.qtplugin" - "!:\private\20022F35\import\widgetregistry\2002C353\contactwidgethsplugin.qtplugin" +"/epoc32/data/z/private/20022F35/import/widgetregistry/2002C353/contactwidgethsplugin.xml" - "!:\private\20022F35\import\widgetregistry\2002C353\contactwidgethsplugin.xml" +"/epoc32/data/z/private/20022F35/import/widgetregistry/2002C353/contactwidgethsplugin.manifest" - "!:\private\20022F35\import\widgetregistry\2002C353\contactwidgethsplugin.manifest" +"/epoc32/data/z/private/20022F35/import/widgetregistry/2002C353/qtg_large_friend.svg" - "!:\private\20022F35\import\widgetregistry\2002C353\qtg_large_friend.svg" + +; Manual PKG post-rules from PRO files diff -r 554fe4dbbb59 -r 59984e68247d contactwidgethsplugin/src/contactwidgethsplugin.cpp --- a/contactwidgethsplugin/src/contactwidgethsplugin.cpp Fri Sep 03 14:32:33 2010 +0300 +++ b/contactwidgethsplugin/src/contactwidgethsplugin.cpp Thu Sep 09 16:37:32 2010 +0300 @@ -46,6 +46,7 @@ return new ContactWidgetHs(); } else { return 0; + } }