Revision: 201001 PDK_3.0.f PDK_3.0.g
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 18 Jan 2010 20:19:34 +0200
changeset 2 acc370d7f2f6
parent 1 ceeb73e410b5
child 6 86ac2e536fee
child 15 2275db202402
Revision: 201001 Kit: 201003
ImagePrint/ImagePrintEngine/DeviceProtocols/btprotocol/src/cbtobjectserver.cpp
ImagePrint/ImagePrintEngine/DeviceProtocols/btprotocol/src/cbtprintingdevice.cpp
ImagePrint/ImagePrintEngine/DeviceProtocols/upnpprotocolfw2/src/cupnpprintingdevice.cpp
ImagePrint/ImagePrintEngine/DeviceProtocols/upnpprotocolfw2/src/cupprintercontainer.cpp
ImagePrint/ImagePrintEngine/ImagePrintServer/src/server/cimageprintsession.cpp
ImagePrint/ImagePrintEngine/group/bld.inf
ImagePrint/ImagePrintUI/imageprintapp/src/cpropertiesboxmodel.cpp
ImagePrint/ImagePrintUI/imageprinteng/src/cdiscoverymanager.cpp
ImagePrint/ImagePrintUI/imgpprintdll/src/cdiscoverydlgmanager.cpp
ImagePrint/ImagePrintUI/imgpprintdll/src/imgpprintapputil.cpp
--- a/ImagePrint/ImagePrintEngine/DeviceProtocols/btprotocol/src/cbtobjectserver.cpp	Thu Jan 07 12:46:28 2010 +0200
+++ b/ImagePrint/ImagePrintEngine/DeviceProtocols/btprotocol/src/cbtobjectserver.cpp	Mon Jan 18 20:19:34 2010 +0200
@@ -827,9 +827,11 @@
 	    	LOG1("[CBtObjectServer::CreateObexObject]\t file = \"%S\"", &file );
 
 			GetDataSequenceL(file, size);
-		    LOG2("[CBtObjectServer::CreateObexObject]\t data len: %d, file size: %d", iObexBody->Size(), size);
 			if(iObexBody)
-				iObexBufObject = CObexBufObject::NewL(iObexBody);
+                {
+                LOG2("[CBtObjectServer::CreateObexObject]\t data len: %d, file size: %d", iObexBody->Size(), size);
+    			iObexBufObject = CObexBufObject::NewL(iObexBody);
+                }
 
 			break;
 		}
--- a/ImagePrint/ImagePrintEngine/DeviceProtocols/btprotocol/src/cbtprintingdevice.cpp	Thu Jan 07 12:46:28 2010 +0200
+++ b/ImagePrint/ImagePrintEngine/DeviceProtocols/btprotocol/src/cbtprintingdevice.cpp	Mon Jan 18 20:19:34 2010 +0200
@@ -945,14 +945,14 @@
 //--------------------------------------------------------------------------------------------
 void CBtPrintingDevice::SetNumsOfCopiesL( const RArray<TInt>& aNumsOfCopies, TInt& aErr )
 	{
-	LOG1("[CBtPrintingDevice::SetNumsOfCopiesL]\t iPrintingJob->JobState(): %d", iPrintingJob->JobState());
-
 	if( !iPrintingJob || iPrintingJob->JobState() != CPrintJob::EStateCreated )
 	{
 		aErr = KErrInvalidSequence;
 		return;
 	}
 
+    LOG1("[CBtPrintingDevice::SetNumsOfCopiesL]\t iPrintingJob->JobState(): %d", iPrintingJob->JobState());
+
 	LOG2("[CBtPrintingDevice::SetNumsOfCopiesL]\t ImageCount(): %d, copies count: %d ",
 				iPrintingJob->ImageCount(), aNumsOfCopies.Count());
 	if( iPrintingJob->ImageCount() != aNumsOfCopies.Count() )
@@ -1580,7 +1580,7 @@
 //--------------------------------------------------------------------------------------------
 void CBtPrintingDevice::CancelJobL()
 {
-	LOG1("[CBtPrintingDevice::CancelJobL]\t begin at iPrintingJob->JobState(): %d", iPrintingJob->JobState());
+	LOG("[CBtPrintingDevice::CancelJobL]\t begin");
 
 	// If not submitted, return
 	if( !iPrintingJob || 
@@ -1589,6 +1589,8 @@
 	   	CPrintJob::EStatePrinting != iPrintingJob->JobState()) )
 		User::Leave(KErrInvalidSequence);
 
+    LOG1("[CBtPrintingDevice::CancelJobL]\t begin at iPrintingJob->JobState(): %d", iPrintingJob->JobState());
+
 	CRsBtDevice* printer = static_cast<CRsBtDevice*>(User::LeaveIfNull(
 					FindDevice(iPrintingJob->PrinterId())));
 
--- a/ImagePrint/ImagePrintEngine/DeviceProtocols/upnpprotocolfw2/src/cupnpprintingdevice.cpp	Thu Jan 07 12:46:28 2010 +0200
+++ b/ImagePrint/ImagePrintEngine/DeviceProtocols/upnpprotocolfw2/src/cupnpprintingdevice.cpp	Mon Jan 18 20:19:34 2010 +0200
@@ -1108,10 +1108,14 @@
 		iState = EUPnPDiscovery;
 		iTriedReadCacheAndFail = EFalse;
 	}
-	else
+	else if(iDiscoveryObserver)
 	{
 		iDiscoveryObserver->DiscoveryStatusL(EDiscoveryFinished, KErrNone, 0);	
 	}
+	else
+    {
+	    User::LeaveIfNull(iDiscoveryObserver);
+    }
 	LOG("[CUPnPPrintingDevice]\t SendPrinterListL end");
 }
 
@@ -1354,9 +1358,13 @@
 	{
 		printer =
 			static_cast<CUPPrinter*> (User::LeaveIfNull(iPrinterContainer->Printer(printerIndex)));
+        SubmitJobToPcpL(*(printer->Device()), aDeviceID);
 	}
+	else
+	{
+	    User::LeaveIfNull(printer);
+    }
 	
-	SubmitJobToPcpL(*(printer->Device()), aDeviceID);
 }
 
 //--------------------------------------------------------------------------------------------
--- a/ImagePrint/ImagePrintEngine/DeviceProtocols/upnpprotocolfw2/src/cupprintercontainer.cpp	Thu Jan 07 12:46:28 2010 +0200
+++ b/ImagePrint/ImagePrintEngine/DeviceProtocols/upnpprotocolfw2/src/cupprintercontainer.cpp	Mon Jan 18 20:19:34 2010 +0200
@@ -414,6 +414,7 @@
 			break;
 		}
 	}
+	User::LeaveIfNull(printer);
 
 	// Calculate size for buffer
 	TInt bufSize = 0;
--- a/ImagePrint/ImagePrintEngine/ImagePrintServer/src/server/cimageprintsession.cpp	Thu Jan 07 12:46:28 2010 +0200
+++ b/ImagePrint/ImagePrintEngine/ImagePrintServer/src/server/cimageprintsession.cpp	Mon Jan 18 20:19:34 2010 +0200
@@ -753,7 +753,8 @@
 		/* 
 		*	If there is some problems with pictbridge, check from usbpersonalityids.h that constants haven't been changed.
 		*/
-		if( dState == EUsbDeviceStateConfigured && personality == KUsbPersonalityIdMTP )
+        if( dState == EUsbDeviceStateConfigured && 
+                ((personality == KUsbPersonalityIdMTP)||(personality == KUsbPersonalityIdPCSuiteMTP)))
 			err = ETrue;		
 
 		aMessage.SetDisposable( ETrue );
--- a/ImagePrint/ImagePrintEngine/group/bld.inf	Thu Jan 07 12:46:28 2010 +0200
+++ b/ImagePrint/ImagePrintEngine/group/bld.inf	Mon Jan 18 20:19:34 2010 +0200
@@ -37,7 +37,7 @@
 ../DeviceProtocols/dpof/group/dpofprotdll.mmp
 ../DeviceProtocols/btprotocol/group/btprotocol.mmp
 ../DeviceProtocols/pictbridge2/group/pdphotolib.mmp
-../DeviceProtocols/upnpprotocolfw2/group/upnpprotocol.mmp
+//../DeviceProtocols/upnpprotocolfw2/group/upnpprotocol.mmp
 
 
 //  End of File
--- a/ImagePrint/ImagePrintUI/imageprintapp/src/cpropertiesboxmodel.cpp	Thu Jan 07 12:46:28 2010 +0200
+++ b/ImagePrint/ImagePrintUI/imageprintapp/src/cpropertiesboxmodel.cpp	Mon Jan 18 20:19:34 2010 +0200
@@ -362,32 +362,33 @@
    
     // Images selected in print job
     TInt imagesCount = iEngine.FileArray().Count(); 
- 
-    // Get number of copies for current image
-    if( numberOfCopiesArray.Count() != imagesCount )
+    if(0 != imagesCount)
         {
-        numberOfCopiesArray.Reset();
-        for( TInt i=0; i < imagesCount; ++i )
+        // Get number of copies for current image
+        if( numberOfCopiesArray.Count() != imagesCount )
             {
-            numberOfCopiesArray.Append( 1 );
+            numberOfCopiesArray.Reset();
+            for( TInt i=0; i < imagesCount; ++i )
+                {
+                numberOfCopiesArray.Append( 1 );
+                }
+            }
+    
+        TInt oldNOC( numberOfCopiesArray[ 0 ] );
+    
+        // if new value was entered
+        if (iNumberOfCopiesValue != oldNOC)
+            {
+            // Set Number of copies value for each image.
+            // Value is same for all images in IP 6.2
+            for ( TInt i=0; i<imagesCount; i++ )
+                {
+                numberOfCopiesArray[ i ] = iNumberOfCopiesValue;
+                }
+            
+            iSettingsIF->SetNumberOfCopiesL( numberOfCopiesArray );
             }
         }
-
-    TInt oldNOC( numberOfCopiesArray[ 0 ] );
-
-    // if new value was entered
-    if (iNumberOfCopiesValue != oldNOC)
-        {
-        // Set Number of copies value for each image.
-        // Value is same for all images in IP 6.2
-        for ( TInt i=0; i<imagesCount; i++ )
-            {
-            numberOfCopiesArray[ i ] = iNumberOfCopiesValue;
-            }
-        
-        iSettingsIF->SetNumberOfCopiesL( numberOfCopiesArray );
-        }
-
     CleanupStack::PopAndDestroy( &numberOfCopiesArray ); 
     }
 
--- a/ImagePrint/ImagePrintUI/imageprinteng/src/cdiscoverymanager.cpp	Thu Jan 07 12:46:28 2010 +0200
+++ b/ImagePrint/ImagePrintUI/imageprinteng/src/cdiscoverymanager.cpp	Mon Jan 18 20:19:34 2010 +0200
@@ -187,14 +187,14 @@
     // When Bluetooth discovery is finished, but Bluetooth is not enabled pass error code to UI.   
     if ( aErrorCode == ENoConnection )
     	{
-    	if (iDiscoveryObserver){
-    	iDiscoveryObserver->DiscoveryError( aErrorCode ); 
-    	}
-	}		
+    	if (iDiscoveryObserver)
+            {
+            iDiscoveryObserver->DiscoveryError( aErrorCode ); 
+            }
+        }
 	if ( iCancelling )
         {
         // Exection continues in CancelDiscoveryL()
-
         if ( iDiscoveryObserver )
            {
            iDiscoveryObserver->DeviceDiscoveryCompleted();
@@ -207,16 +207,25 @@
             if ( aStatus == EDiscovering )
                 {
                 iOnGoingDiscovery = EFalse;
-                iDiscoveryObserver->DeviceDiscoveryCompleted();
+                if ( iDiscoveryObserver )
+                    {
+                    iDiscoveryObserver->DeviceDiscoveryCompleted();
+                    }
                 }
             else if ( aStatus == EDoneDiscovery )
                 {
                 iOnGoingDiscovery = EFalse;
-                iDiscoveryObserver->DeviceDiscoveryCompleted();
+                if ( iDiscoveryObserver )
+                    {
+                    iDiscoveryObserver->DeviceDiscoveryCompleted();
+                    }
                 }
             else if ( aStatus == ECancellingDiscovery )
                 {
-                iDiscoveryObserver->DiscoveryError( aErrorCode );
+                if ( iDiscoveryObserver )
+                    {
+                    iDiscoveryObserver->DiscoveryError( aErrorCode );
+                    }
                 }
             else
                 {
--- a/ImagePrint/ImagePrintUI/imgpprintdll/src/cdiscoverydlgmanager.cpp	Thu Jan 07 12:46:28 2010 +0200
+++ b/ImagePrint/ImagePrintUI/imgpprintdll/src/cdiscoverydlgmanager.cpp	Mon Jan 18 20:19:34 2010 +0200
@@ -264,13 +264,14 @@
 // Called when process completed
 void CDiscoveryDlgManager::DeviceDiscoveryCompleted()
 	{
-	LOG1("[CDiscoveryDlgManager::DeviceDiscoveryCompleted]\t Before dissmissing the process/wait dialog, iDiscoveryCompleted has value of %d", iDiscoveryCompleted);
 	// // Added this to avoid multiple "Search Again" texts, because server sends DeviceDiscoveryCompleted() more than once 
 	if( iDiscoveryCompleted )
 		{
 		return;
 		}
 
+    LOG1("[CDiscoveryDlgManager::DeviceDiscoveryCompleted]\t Before dissmissing the process/wait dialog, iDiscoveryCompleted has value of %d", iDiscoveryCompleted);
+
 	// Searching over, flag is essential
 	iSearchingCancelled = ETrue;
 
@@ -288,7 +289,7 @@
 		}
 
 	iDiscoveryCompleted = ETrue;
-	if ( iActivePopup )
+	if ((iActivePopup) && (iPopupList))
 		{
 		iPopupList->Heading()->CancelAnimation();
 
--- a/ImagePrint/ImagePrintUI/imgpprintdll/src/imgpprintapputil.cpp	Thu Jan 07 12:46:28 2010 +0200
+++ b/ImagePrint/ImagePrintUI/imgpprintdll/src/imgpprintapputil.cpp	Mon Jan 18 20:19:34 2010 +0200
@@ -141,6 +141,7 @@
 	                aResourceId = R_NOTE_CONNECT_PRINT_ERROR;
 	                }           
 	            }
+                break;
 	            
 	        case KErrL2CAPRequestTimeout:
 	            aResourceId = R_NOTE_SEND_PRINT_ERROR;