Re: Epiphany 1.1.2



Il dom, 2003-12-28 alle 20:05, Marco Pesenti Gritti ha scritto:
> Hi,

> Epiphany 1.1.1 requires mozilla 1.4, 1.5, mozilla cvs.
> The suggested version is Mozilla 1.5:
> ftp://ftp.mozilla.org/pub/mozilla/releases/mozilla1.5/src/mozilla-source-1.5.tar.gz
> 

I've some compilation troubles against mozilla 1.4 

-----------
In file included from ContentHandler.cpp:28:
/opt/gnome/include/mozilla-1.4/xpcom/nsCOMPtr.h: In instantiation of
`nsCOMPtr<nsIObserver>':
MozDownload.h:123:   instantiated from here
/opt/gnome/include/mozilla-1.4/xpcom/nsCOMPtr.h:452: error: invalid
application of `sizeof' to an incomplete type
/opt/gnome/include/mozilla-1.4/xpcom/nsCOMPtr.h: In instantiation of
`nsCOMPtr<nsIRequest>':
MozDownload.h:125:   instantiated from here
/opt/gnome/include/mozilla-1.4/xpcom/nsCOMPtr.h:452: error: invalid
application of `sizeof' to an incomplete type
make[3]: *** [ContentHandler.lo] Error 1
make[3]: Leaving directory `/tmp/GNOME/epiphany/embed/mozilla'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/GNOME/epiphany/embed'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/GNOME/epiphany'
make: *** [all] Error 2
-----------

So I replace MozDownload.h with a previous CVS versio (see attach) ;-)

Then I rerun make:

----------------
MozDownload.cpp: In member function `virtual nsresult
MozDownload::SetObserver(nsIObserver*)':
MozDownload.cpp:253: error: `mObserver' undeclared (first use this
function)
MozDownload.cpp:253: error: (Each undeclared identifier is reported only
once for each function it appears in.)
MozDownload.cpp: In member function `virtual nsresult
MozDownload::OnProgressChange(nsIWebProgress*, nsIRequest*, int, int,
int, int)':
MozDownload.cpp:312: error: `mRequest' undeclared (first use this
function)
make[3]: *** [MozDownload.lo] Error 1
make[3]: Leaving directory `/tmp/GNOME/epiphany/embed/mozilla'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/GNOME/epiphany/embed'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/GNOME/epiphany'
make: *** [all] Error 2
-----------------

So I replace MozDownload.cpp too. Finally I can compile and use it. Any
ideas?

Note: diff -Naur OLD_WORKING_FILE NEW_FILE



> More about dependencies and installation tips:
> http://gnome.org/projects/epiphany/downloads.html
> 
> Enjoy.
> 
> Marco
> 
> _______________________________________________
> desktop-devel-list mailing list
> desktop-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/desktop-devel-list
--- ../OLD/epiphany/embed/mozilla/MozDownload.h	2003-12-27 20:05:14.000000000 +0100
+++ embed/mozilla/MozDownload.h	2003-12-28 19:46:39.000000000 +0100
@@ -118,10 +118,11 @@
 	PRInt32                 mCurrentProgress;
 
 	bool                    mGotFirstStateChange, mIsNetworkTransfer;
-	bool                    mUserCanceled;
 	nsresult                mStatus;
-   
+
+	nsCOMPtr<nsIObserver>		mObserver;   
 	nsCOMPtr<nsIWebBrowserPersist>  mWebPersist;
+	nsCOMPtr<nsIRequest>		mRequest;
 	EphyDownload                   *mEphyDownload;
 	DownloaderView                 *mDownloaderView;
 	MozillaEmbedPersist            *mEmbedPersist;
--- ../OLD/epiphany/embed/mozilla/MozDownload.cpp	2003-12-27 20:05:14.000000000 +0100
+++ embed/mozilla/MozDownload.cpp	2003-12-28 19:46:39.000000000 +0100
@@ -38,7 +38,7 @@
  *
  * ***** END LICENSE BLOCK *****
  *
- * $Id: MozDownload.cpp,v 1.9 2003/11/27 23:46:32 xan Exp $
+ * $Id: MozDownload.cpp,v 1.11 2003/12/21 23:48:39 marco Exp $
  */
 
 #include "MozDownload.h"
@@ -58,7 +58,6 @@
 
 MozDownload::MozDownload() :
 	mGotFirstStateChange(false), mIsNetworkTransfer(false),
-	mUserCanceled(false),
 	mStatus(NS_OK),
 	mEmbedPersist(nsnull),
 	mDownloadState(EPHY_DOWNLOAD_DOWNLOADING)
@@ -251,7 +250,9 @@
 NS_IMETHODIMP
 MozDownload::SetObserver(nsIObserver *aObserver)
 {
-	return NS_ERROR_NOT_IMPLEMENTED;
+	mObserver = aObserver;
+
+	return NS_OK;
 }
 
 NS_IMETHODIMP 
@@ -308,6 +309,9 @@
 			      PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress,
 			      PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress)
 {
+	if (!mRequest)
+		mRequest = aRequest;
+
 	PRInt64 now = PR_Now ();
 
 	if ((now - mLastUpdate < mInterval) &&
@@ -316,15 +320,6 @@
 		return NS_OK;
 
 	mLastUpdate = now;
-    
-	if (mUserCanceled)
-	{
-	        if (aRequest)
-		{
-	            aRequest->Cancel(NS_BINDING_ABORTED);
-		}
-	        mUserCanceled = false;
-	}
 
 	if (aMaxTotalProgress == -1)
 	{
@@ -368,21 +363,35 @@
 void
 MozDownload::Cancel()
 {
-    mUserCanceled = true;
-    /* nsWebBrowserPersist does the right thing: After canceling, next time through
-       OnStateChange(), aStatus != NS_OK. This isn't the case with nsExternalHelperAppService.*/
-    if (!mWebPersist)
-        mStatus = NS_ERROR_ABORT;
+	if (mWebPersist)
+	{
+		mWebPersist->CancelSave ();
+	}
+
+	if (mObserver)
+	{
+		mObserver->Observe (nsnull, "oncancel", nsnull);
+	}	
 }
 
 void
 MozDownload::Pause()
 {
+	if (mRequest)
+	{
+		mRequest->Suspend ();
+		mDownloadState = EPHY_DOWNLOAD_PAUSED;
+	}
 }
 
 void
 MozDownload::Resume()
 {
+	if (mRequest)
+	{
+		mRequest->Resume ();
+		mDownloadState = EPHY_DOWNLOAD_DOWNLOADING;
+	}
 }
 
 nsresult InitiateMozillaDownload (nsIDOMDocument *domDocument, nsIURI *sourceURI,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]