CNcdNodeFolderProxy::~CNcdNodeFolderProxy()
    {
    // Remove interfaces implemented by this class from the interface list.
    // So, the interface list is up to date when this class object is deleted.
    RemoveInterface( MNcdNodeContainer::KInterfaceUid );
    RemoveInterface( MNcdNodeSearch::KInterfaceUid );

    // Delete the objects that are owned by this class and provide functionality
    // through the api.
    // Notice that the api-objects are Released (not deleted) from the UI side.
    // The node owns the data and the reference counter of the node keeps
    // track of the api objects it owns. When the reference counter of the node
    // reaches zero, it means that nobody is using the node or the classes owned
    // by the node. If somebody is using the object owned by the node, the reference
    // counter can not be zero until everything is released.
    // Thus, the node may delete the data here.

    delete iSearch;
    iSearch = NULL;
    
    delete iNodeSeenFolder;
    iNodeSeenFolder = NULL;
    
    iChildren.ResetAndDestroy();
    }
CNcdNodeProxy::~CNcdNodeProxy()
    {
    DLTRACEIN(("this-ptr: %x", this));
    // Because this object is deleted. Remove the interfaces from the
    // interface list.
    RemoveInterface( MNcdNode::KInterfaceUid );
    RemoveInterface( MNcdNodeChildOfTransparent::KInterfaceUid );
    RemoveInterface( MNcdNodeFavorite::KInterfaceUid );
    
    // Inform node manager that this node is under deletion.    
    iNodeManager.NodeDeleted( this );

    delete iNodeIdentifier;
    iNodeIdentifier = NULL;

    // Delete link data

    delete iCatalogSourceName;
    iCatalogSourceName = NULL;

    delete iParentIdentifier;
    iParentIdentifier = NULL;
    
    delete iRealParentIdentifier;
    iRealParentIdentifier = NULL;

    delete iTimestamp;
    iTimestamp = NULL;


    // Delete the objects that are owned by this class and provide functionality
    // through the api.
    // Notice that the api-objects are Released (not deleted) from the UI side.
    // The node owns the data and the reference counter of the node keeps
    // track of the api objects it owns. When the reference counter of the node
    // reaches zero, it means that nobody is using the node or the classes owned
    // by the node. If somebody is using the object owned by the node, the reference
    // counter can not be zero until everything is released.
    // Thus, the node may delete the data here.

    delete iMetadata;
    iMetadata = NULL;
    
    delete iNodeSeen;
    iNodeSeen = NULL;
    DLTRACEOUT(("this-ptr: %x", this));
    }
void CNcdNodeContentInfoProxy::InternalizeL()
    {
    DLTRACEIN((""));

    HBufC8* data( NULL );
        
    // Because we do not know the exact size of the data, use
    // the alloc method, which creates the buffer of the right size
    // and sets the pointer to point to the created buffer.
    // Get all the data that is necessary to internalize this object
    // from the server side.
    TInt error(
        ClientServerSession().
        SendSyncAlloc( NcdNodeFunctionIds::ENcdInternalize,
                       KNullDesC8,
                       data,
                       Handle(),
                       0 ) );

    if ( error == KNcdErrorObsolete )
        {
        DLINFO(("Content info was obsolete"));
        // Remove interfaces implemented by this class from the top parent interface list.
        // So, the interface list is up to date after this object is removed
        // from its top parent.
        RemoveInterface( MNcdNodeContentInfo::KInterfaceUid );
        // Remove from the parent
        RemoveFromParent();
        // Now update the interface for this object just in case somebody needs it.
        // Register the interface
        MNcdNodeContentInfo* interface( this );
        AddInterfaceL( 
            CCatalogsInterfaceIdentifier::NewL( interface, this, MNcdNodeContentInfo::KInterfaceUid ) );
        }

    // If error occurred during data transfer, leave here and forward the error.
    User::LeaveIfError( error );

    if ( data == NULL )
        {
        DLERROR((""));
        User::Leave(  KErrNotFound );
        }

     CleanupStack::PushL( data );

     // Read the data from the stream and insert it to the memeber variables
     RDesReadStream stream( *data );
     CleanupClosePushL( stream );
    
     InternalizeDataL( stream );
    
     // Closes the stream
     CleanupStack::PopAndDestroy( &stream ); 
     CleanupStack::PopAndDestroy( data );

    DLTRACEOUT((""));    
    }
CNcdNodeSearch::~CNcdNodeSearch()
    {
    DLTRACEIN((""))
    // Remove interfaces implemented by this class from the interface list.
    // So, the interface list is up to date when this class object is deleted.
    RemoveInterface( MNcdNodeSearch::KInterfaceUid );
    
    
    // Delete member variables here
    // Do not delete node and operation manager because
    // this object does not own them.
    }
CNcdNodeContentInfoProxy::~CNcdNodeContentInfoProxy()
    {
    DLTRACEIN((""));
    // Remove interfaces implemented by this class from the interface list.
    // So, the interface list is up to date when this class object is deleted.
    RemoveInterface( MNcdNodeContentInfo::KInterfaceUid );

    delete iMimeType;
    iMimeType = NULL;
    
    delete iIdentifier;
    iIdentifier = NULL;
    
    delete iVersion;
    iVersion = NULL;
    }
Beispiel #6
0
bool CUDisks2Provider::HandleInterfacesRemoved(DBusMessage *msg, IStorageEventsCallback *callback)
{
  DBusMessageIter msgIter, ifaceIter;
  const char *path, *iface;
  bool result = false;
  dbus_message_iter_init(msg, &msgIter);
  dbus_message_iter_get_basic(&msgIter, &path);
  dbus_message_iter_next(&msgIter);
  dbus_message_iter_recurse(&msgIter, &ifaceIter);
  while (dbus_message_iter_get_arg_type(&ifaceIter) == DBUS_TYPE_STRING)
  {
    dbus_message_iter_get_basic(&ifaceIter, &iface);
    result |= RemoveInterface(path, iface, callback);
    dbus_message_iter_next(&ifaceIter);
  }
  return result;
}
Beispiel #7
0
status_t
BNetworkRoster::RemoveInterface(const BNetworkInterface& interface)
{
    return RemoveInterface(interface.Name());
}
void CNcdNodeProxy::RemoveFromFavoritesL() 
    {
    DLTRACEIN((""));
    iFavoriteManager.RemoveFromFavoritesL( *iNodeIdentifier );
    RemoveInterface( MNcdNodeFavorite::KInterfaceUid );
    }