Bug 1386916 - Port 1326520 to mailnews: Rename GetPath/SetPath to GetPathQueryRef/SetpathQueryRef. r=jorgk
authorEdmund Wong <ewong>
Wed, 02 Aug 2017 21:39:00 +0200
changeset 29452 ec72d5653abf8c27512fdf7c4e83b05ca5d380df
parent 29451 2dd67431020a2f34c96e06474b293ab2f2ceb7da
child 29453 b0da77087a9064f3d20a11b1a322f6ddc780177c
push id378
push userclokep@gmail.com
push dateMon, 13 Nov 2017 18:45:35 +0000
reviewersjorgk
bugs1386916, 1326520
Bug 1386916 - Port 1326520 to mailnews: Rename GetPath/SetPath to GetPathQueryRef/SetpathQueryRef. r=jorgk
ldap/xpcom/src/nsLDAPURL.cpp
mailnews/addrbook/src/nsAbContentHandler.cpp
mailnews/addrbook/src/nsAddbookProtocolHandler.cpp
mailnews/addrbook/src/nsAddbookUrl.cpp
mailnews/base/util/nsMsgDBFolder.cpp
mailnews/base/util/nsMsgMailNewsUrl.cpp
mailnews/base/util/nsMsgProtocol.cpp
mailnews/compose/src/nsMsgCompUtils.cpp
mailnews/compose/src/nsMsgCompose.cpp
mailnews/compose/src/nsSmtpUrl.cpp
mailnews/imap/src/nsImapProtocol.cpp
mailnews/imap/src/nsImapUrl.cpp
mailnews/local/src/nsMailboxUrl.cpp
mailnews/news/src/nsNNTPProtocol.cpp
mailnews/news/src/nsNntpService.cpp
mailnews/news/src/nsNntpUrl.cpp
--- a/ldap/xpcom/src/nsLDAPURL.cpp
+++ b/ldap/xpcom/src/nsLDAPURL.cpp
@@ -299,33 +299,33 @@ NS_IMETHODIMP
 nsLDAPURL::SetPort(int32_t aPort)
 {
   if (!mBaseURL)
     return NS_ERROR_NOT_INITIALIZED;
 
   return mBaseURL->SetPort(aPort);
 }
 
-NS_IMETHODIMP nsLDAPURL::GetPath(nsACString &_retval)
+NS_IMETHODIMP nsLDAPURL::GetPathQueryRef(nsACString &_retval)
 {
   if (!mBaseURL)
     return NS_ERROR_NOT_INITIALIZED;
 
-  return mBaseURL->GetPath(_retval);
+  return mBaseURL->GetPathQueryRef(_retval);
 }
 
-NS_IMETHODIMP nsLDAPURL::SetPath(const nsACString &aPath)
+NS_IMETHODIMP nsLDAPURL::SetPathQueryRef(const nsACString &aPath)
 {
   if (!mBaseURL)
     return NS_ERROR_NOT_INITIALIZED;
 
   nsresult rv = SetPathInternal(PromiseFlatCString(aPath));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  return mBaseURL->SetPath(aPath);
+  return mBaseURL->SetPathQueryRef(aPath);
 }
 
 NS_IMETHODIMP nsLDAPURL::GetAsciiSpec(nsACString &_retval)
 {
   if (!mBaseURL)
     return NS_ERROR_NOT_INITIALIZED;
 
   // XXX handle extra items?
@@ -472,17 +472,17 @@ NS_IMETHODIMP nsLDAPURL::SetDn(const nsA
 
   mDN.Assign(aDn);
 
   // Now get the current path
   nsCString newPath;
   GetPathInternal(newPath);
 
   // and update the base url
-  return mBaseURL->SetPath(newPath);
+  return mBaseURL->SetPathQueryRef(newPath);
 }
 
 NS_IMETHODIMP nsLDAPURL::GetAttributes(nsACString &aAttributes)
 {
   if (mAttributes.IsEmpty())
   {
     aAttributes.Truncate();
     return NS_OK;
@@ -518,17 +518,17 @@ NS_IMETHODIMP nsLDAPURL::SetAttributes(c
       mAttributes.Append(',');
   }
 
   // Now get the current path
   nsCString newPath;
   GetPathInternal(newPath);
 
   // and update the base url
-  return mBaseURL->SetPath(newPath);
+  return mBaseURL->SetPathQueryRef(newPath);
 }
 
 nsresult nsLDAPURL::SetAttributeArray(char** aAttributes)
 {
   mAttributes.Truncate();
 
   while (aAttributes && *aAttributes)
   {
@@ -573,17 +573,17 @@ NS_IMETHODIMP nsLDAPURL::AddAttribute(co
     mAttributes.Append(Substring(findAttribute, 1));
   }
 
   // Now get the current path
   nsCString newPath;
   GetPathInternal(newPath);
 
   // and update the base url
-  return mBaseURL->SetPath(newPath);
+  return mBaseURL->SetPathQueryRef(newPath);
 }
 
 NS_IMETHODIMP nsLDAPURL::RemoveAttribute(const nsACString &aAttribute)
 {
   if (!mBaseURL)
     return NS_ERROR_NOT_INITIALIZED;
 
   if (mAttributes.IsEmpty())
@@ -604,17 +604,17 @@ NS_IMETHODIMP nsLDAPURL::RemoveAttribute
     mAttributes.Cut(pos, findAttribute.Length() - 1);
   }
 
   // Now get the current path
   nsCString newPath;
   GetPathInternal(newPath);
 
   // and update the base url
-  return mBaseURL->SetPath(newPath);
+  return mBaseURL->SetPathQueryRef(newPath);
 }
 
 NS_IMETHODIMP nsLDAPURL::HasAttribute(const nsACString &aAttribute,
                                       bool *_retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
 
   nsAutoCString findAttribute(",");
@@ -644,17 +644,17 @@ NS_IMETHODIMP nsLDAPURL::SetScope(int32_
 
   mScope = aScope;
 
   // Now get the current path
   nsCString newPath;
   GetPathInternal(newPath);
 
   // and update the base url
-  return mBaseURL->SetPath(newPath);
+  return mBaseURL->SetPathQueryRef(newPath);
 }
 
 NS_IMETHODIMP nsLDAPURL::GetFilter(nsACString& _retval)
 {
     _retval.Assign(mFilter);
     return NS_OK;
 }
 NS_IMETHODIMP nsLDAPURL::SetFilter(const nsACString& aFilter)
@@ -667,17 +667,17 @@ NS_IMETHODIMP nsLDAPURL::SetFilter(const
   if (mFilter.IsEmpty())
     mFilter.AssignLiteral("(objectclass=*)");
 
   // Now get the current path
   nsCString newPath;
   GetPathInternal(newPath);
 
   // and update the base url
-  return mBaseURL->SetPath(newPath);
+  return mBaseURL->SetPathQueryRef(newPath);
 }
 
 NS_IMETHODIMP nsLDAPURL::GetOptions(uint32_t *_retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
   *_retval = mOptions;
   return NS_OK;
 }
--- a/mailnews/addrbook/src/nsAbContentHandler.cpp
+++ b/mailnews/addrbook/src/nsAbContentHandler.cpp
@@ -49,17 +49,17 @@ nsAbContentHandler::HandleContent(const 
     nsCOMPtr<nsIURI> uri;
     nsCOMPtr<nsIChannel> aChannel = do_QueryInterface(request);
     if (!aChannel) return NS_ERROR_FAILURE;
 
     rv = aChannel->GetURI(getter_AddRefs(uri));
     if (uri)
     {
         nsAutoCString path;
-        rv = uri->GetPath(path);
+        rv = uri->GetPathQueryRef(path);
         NS_ENSURE_SUCCESS(rv,rv);
 
         const char *startOfVCard = strstr(path.get(), "add?vcard=");
         if (startOfVCard)
         {
             nsCString unescapedData;
             
             // XXX todo, explain why we is escaped twice
--- a/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp
+++ b/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp
@@ -209,17 +209,17 @@ nsAddbookProtocolHandler::NewChannel2(ns
 
 nsresult    
 nsAddbookProtocolHandler::GeneratePrintOutput(nsIAddbookUrl *addbookUrl, 
                                               nsString &aOutput)
 {
   NS_ENSURE_ARG_POINTER(addbookUrl);
 
   nsAutoCString uri;
-  nsresult rv = addbookUrl->GetPath(uri);
+  nsresult rv = addbookUrl->GetPathQueryRef(uri);
   NS_ENSURE_SUCCESS(rv,rv);
 
   /* turn
    "//moz-abmdbdirectory/abook.mab?action=print"
    into "moz-abmdbdirectory://abook.mab"
   */
 
   /* step 1:  
--- a/mailnews/addrbook/src/nsAddbookUrl.cpp
+++ b/mailnews/addrbook/src/nsAddbookUrl.cpp
@@ -34,17 +34,17 @@ nsAddbookUrl::SetSpec(const nsACString &
   NS_ENSURE_SUCCESS(rv, rv);
   return ParseUrl();
 }
 
 nsresult nsAddbookUrl::ParseUrl()
 {
   nsAutoCString pathStr;
 
-  nsresult rv = m_baseURL->GetPath(pathStr);
+  nsresult rv = m_baseURL->GetPathQueryRef(pathStr);
   NS_ENSURE_SUCCESS(rv,rv);
 
   if (strstr(pathStr.get(), "?action=print"))
     mOperationType = nsIAddbookUrlOperation::PrintAddressBook;
   else if (strstr(pathStr.get(), "?action=add"))
     mOperationType = nsIAddbookUrlOperation::AddVCard;
   else
     mOperationType = nsIAddbookUrlOperation::InvalidUrl;
@@ -136,24 +136,24 @@ NS_IMETHODIMP nsAddbookUrl::GetPort(int3
   return m_baseURL->GetPort(aPort);
 }
 
 NS_IMETHODIMP nsAddbookUrl::SetPort(int32_t aPort)
 {
   return m_baseURL->SetPort(aPort);
 }
 
-NS_IMETHODIMP nsAddbookUrl::GetPath(nsACString &aPath)
+NS_IMETHODIMP nsAddbookUrl::GetPathQueryRef(nsACString &aPath)
 {
-  return m_baseURL->GetPath(aPath);
+  return m_baseURL->GetPathQueryRef(aPath);
 }
 
-NS_IMETHODIMP nsAddbookUrl::SetPath(const nsACString &aPath)
+NS_IMETHODIMP nsAddbookUrl::SetPathQueryRef(const nsACString &aPath)
 {
-  m_baseURL->SetPath(aPath);
+  m_baseURL->SetPathQueryRef(aPath);
   return ParseUrl();
 }
 
 NS_IMETHODIMP nsAddbookUrl::GetAsciiHost(nsACString &aHostA)
 {
   return m_baseURL->GetAsciiHost(aHostA);
 }
 
--- a/mailnews/base/util/nsMsgDBFolder.cpp
+++ b/mailnews/base/util/nsMsgDBFolder.cpp
@@ -3129,17 +3129,17 @@ nsMsgDBFolder::parseURI(bool needServer)
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = url->SetSpec(mURI);
   NS_ENSURE_SUCCESS(rv, rv);
   // empty path tells us it's a server.
   if (!mIsServerIsValid)
   {
     nsAutoCString path;
-    rv = url->GetPath(path);
+    rv = url->GetPathQueryRef(path);
     if (NS_SUCCEEDED(rv))
       mIsServer = path.EqualsLiteral("/");
     mIsServerIsValid = true;
   }
 
   // grab the name off the leaf of the server
   if (mName.IsEmpty())
   {
--- a/mailnews/base/util/nsMsgMailNewsUrl.cpp
+++ b/mailnews/base/util/nsMsgMailNewsUrl.cpp
@@ -515,24 +515,24 @@ NS_IMETHODIMP nsMsgMailNewsUrl::GetPort(
   return m_baseURL->GetPort(aPort);
 }
 
 NS_IMETHODIMP nsMsgMailNewsUrl::SetPort(int32_t aPort)
 {
   return m_baseURL->SetPort(aPort);
 }
 
-NS_IMETHODIMP nsMsgMailNewsUrl::GetPath(nsACString &aPath)
+NS_IMETHODIMP nsMsgMailNewsUrl::GetPathQueryRef(nsACString &aPath)
 {
-  return m_baseURL->GetPath(aPath);
+  return m_baseURL->GetPathQueryRef(aPath);
 }
 
-NS_IMETHODIMP nsMsgMailNewsUrl::SetPath(const nsACString &aPath)
+NS_IMETHODIMP nsMsgMailNewsUrl::SetPathQueryRef(const nsACString &aPath)
 {
-  return m_baseURL->SetPath(aPath);
+  return m_baseURL->SetPathQueryRef(aPath);
 }
 
 NS_IMETHODIMP nsMsgMailNewsUrl::GetAsciiHost(nsACString &aHostA)
 {
     return m_baseURL->GetAsciiHost(aHostA);
 }
 
 NS_IMETHODIMP nsMsgMailNewsUrl::GetAsciiHostPort(nsACString &aHostPortA)
--- a/mailnews/base/util/nsMsgProtocol.cpp
+++ b/mailnews/base/util/nsMsgProtocol.cpp
@@ -170,17 +170,17 @@ nsMsgProtocol::OpenNetworkSocketWithInfo
 }
 
 nsresult nsMsgProtocol::GetFileFromURL(nsIURI * aURL, nsIFile **aResult)
 {
   NS_ENSURE_ARG_POINTER(aURL);
   NS_ENSURE_ARG_POINTER(aResult);
   // extract the file path from the uri...
   nsAutoCString urlSpec;
-  aURL->GetPath(urlSpec);
+  aURL->GetPathQueryRef(urlSpec);
   urlSpec.Insert(NS_LITERAL_CSTRING("file://"), 0);
   nsresult rv;
 
 // dougt - there should be an easier way!
   nsCOMPtr<nsIURI> uri;
   if (NS_FAILED(rv = NS_NewURI(getter_AddRefs(uri), urlSpec.get())))
       return rv;
 
--- a/mailnews/compose/src/nsMsgCompUtils.cpp
+++ b/mailnews/compose/src/nsMsgCompUtils.cpp
@@ -1609,17 +1609,17 @@ GenerateFileNameFromURI(nsIURI *aURL)
 {
   nsresult    rv;
   nsCString file;
   nsCString spec;
   char        *returnString;
   char        *cp = nullptr;
   char        *cp1 = nullptr;
 
-  rv = aURL->GetPath(file);
+  rv = aURL->GetPathQueryRef(file);
   if ( NS_SUCCEEDED(rv) && !file.IsEmpty())
   {
     char *newFile = ToNewCString(file);
     if (!newFile)
       return nullptr;
 
     // strip '/'
     cp = PL_strrchr(newFile, '/');
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -301,17 +301,17 @@ bool nsMsgCompose::IsEmbeddedObjectSafe(
       if (NS_SUCCEEDED(rv) && scheme.Equals(originalScheme, nsCaseInsensitiveCStringComparator()))
       {
         nsAutoCString host;
         rv = uri->GetAsciiHost(host);
         // mailbox url don't have a host therefore don't be too strict.
         if (NS_SUCCEEDED(rv) && (host.IsEmpty() || originalHost || host.Equals(originalHost, nsCaseInsensitiveCStringComparator())))
         {
           nsAutoCString path;
-          rv = uri->GetPath(path);
+          rv = uri->GetPathQueryRef(path);
           if (NS_SUCCEEDED(rv))
           {
             const char * query = strrchr(path.get(), '?');
             if (query && PL_strncasecmp(path.get(), originalPath, query - path.get()) == 0)
                 return true; //This object is a part of the original message, we can send it safely.
           }
         }
       }
@@ -494,17 +494,17 @@ nsresult nsMsgCompose::TagEmbeddedObject
   rv = GetMessageServiceFromURI(mOriginalMsgURI, getter_AddRefs(msgService));
   if (NS_SUCCEEDED(rv))
   {
     rv = msgService->GetUrlForUri(mOriginalMsgURI.get(), getter_AddRefs(originalUrl), nullptr);
     if (NS_SUCCEEDED(rv) && originalUrl)
     {
       originalUrl->GetScheme(originalScheme);
       originalUrl->GetAsciiHost(originalHost);
-      originalUrl->GetPath(originalPath);
+      originalUrl->GetPathQueryRef(originalPath);
     }
   }
 
   // Then compare the url of each embedded objects with the original message.
   // If they a not coming from the original message, they should not be sent
   // with the message.
   for (i = 0; i < count; i ++)
   {
--- a/mailnews/compose/src/nsSmtpUrl.cpp
+++ b/mailnews/compose/src/nsSmtpUrl.cpp
@@ -286,17 +286,17 @@ nsresult nsMailtoUrl::CleanupMailtoState
     m_priorityPart = "";
     return NS_OK;
 }
 
 nsresult nsMailtoUrl::ParseUrl()
 {
   // we can get the path from the simple url.....
   nsCString escapedPath;
-  m_baseURL->GetPath(escapedPath);
+  m_baseURL->GetPathQueryRef(escapedPath);
 
   int32_t startOfSearchPart = escapedPath.FindChar('?');
   if (startOfSearchPart >= 0)
   {
     // now parse out the search field...
     nsAutoCString searchPart(Substring(escapedPath, startOfSearchPart));
 
     if (!searchPart.IsEmpty())
@@ -472,24 +472,24 @@ NS_IMETHODIMP nsMailtoUrl::GetPort(int32
 }
 
 NS_IMETHODIMP nsMailtoUrl::SetPort(int32_t aPort)
 {
 	m_baseURL->SetPort(aPort);
 	return ParseUrl();
 }
 
-NS_IMETHODIMP nsMailtoUrl::GetPath(nsACString &aPath)
+NS_IMETHODIMP nsMailtoUrl::GetPathQueryRef(nsACString &aPath)
 {
-	return m_baseURL->GetPath(aPath);
+	return m_baseURL->GetPathQueryRef(aPath);
 }
 
-NS_IMETHODIMP nsMailtoUrl::SetPath(const nsACString &aPath)
+NS_IMETHODIMP nsMailtoUrl::SetPathQueryRef(const nsACString &aPath)
 {
-	m_baseURL->SetPath(aPath);
+	m_baseURL->SetPathQueryRef(aPath);
 	return ParseUrl();
 }
 
 NS_IMETHODIMP nsMailtoUrl::GetAsciiHost(nsACString &aHostA)
 {
 	return m_baseURL->GetAsciiHost(aHostA);
 }
 
--- a/mailnews/imap/src/nsImapProtocol.cpp
+++ b/mailnews/imap/src/nsImapProtocol.cpp
@@ -9393,17 +9393,17 @@ nsresult nsImapMockChannel::OpenCacheEnt
   // changes, we won't re-use the wrong cache entries.
   nsAutoCString extension;
   extension.AppendInt(uidValidity, 16);
 
   // Open a cache entry where the key is the potentially modified URL.
   nsCOMPtr<nsIURI> newUri;
   m_url->Clone(getter_AddRefs(newUri));
   nsAutoCString path;
-  newUri->GetPath(path);
+  newUri->GetPathQueryRef(path);
 
   // First we need to "normalise" the URL by extracting ?part= and &filename.
   // The path should only contain: ?part=x.y&filename=file.ext
   // These are seen in the wild:
   // /;section=2?part=1.2&filename=A01.JPG
   // ?section=2?part=1.2&filename=A01.JPG&type=image/jpeg&filename=A01.JPG
   // ?part=1.2&type=image/jpeg&filename=IMG_C0030.jpg
   // ?header=quotebody&part=1.2&filename=lijbmghmkilicioj.png
@@ -9423,56 +9423,56 @@ nsresult nsImapMockChannel::OpenCacheEnt
     path.SetLength(ind);
   ind = path.Find("/;");
   if (ind != kNotFound)
     path.SetLength(ind);
 
   if (partQuery.IsEmpty())
   {
     // Not looking for a part. That's the easy part.
-    newUri->SetPath(path);
+    newUri->SetPathQueryRef(path);
     return cacheStorage->AsyncOpenURI(newUri, extension, cacheAccess, this);
   }
 
   /**
    * Part processing (rest of this function).
    */
   if (mTryingToReadPart)
   {
     // If mTryingToReadPart is set, we are here for the second time.
     // We tried to read a part from the entire message but the meta data didn't
     // allow it. So we come back here.
     // Now request the part with its full URL.
     mTryingToReadPart = false;
 
     // Note that part extraction was already set the first time.
-    newUri->SetPath(path + partQuery + filenameQuery);
+    newUri->SetPathQueryRef(path + partQuery + filenameQuery);
     return cacheStorage->AsyncOpenURI(newUri, extension, cacheAccess, this);
   }
 
   // First time processing. Set up part extraction.
   SetupPartExtractorListener(imapUrl, m_channelListener);
 
   // Check whether part is in the cache.
   bool exists = false;
-  newUri->SetPath(path + partQuery + filenameQuery);
+  newUri->SetPathQueryRef(path + partQuery + filenameQuery);
   rv = cacheStorage->Exists(newUri, extension, &exists);
   NS_ENSURE_SUCCESS(rv, rv);
   if (exists) {
     return cacheStorage->AsyncOpenURI(newUri, extension, cacheAccess, this);
   }
 
   // Let's see whether we have the entire message instead.
-  newUri->SetPath(path);
+  newUri->SetPathQueryRef(path);
   rv = cacheStorage->Exists(newUri, extension, &exists);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (!exists) {
     // The entire message is not in the cache. Request the part.
-    newUri->SetPath(path + partQuery + filenameQuery);
+    newUri->SetPathQueryRef(path + partQuery + filenameQuery);
     return cacheStorage->AsyncOpenURI(newUri, extension, cacheAccess, this);
   }
 
   // This is where is gets complicated. The entire message is in the cache,
   // but we don't know whether it's suitable for use. Its meta data
   // might indicate that the message is incomplete.
   mTryingToReadPart = true;
   return cacheStorage->AsyncOpenURI(newUri, extension, cacheAccess, this);
--- a/mailnews/imap/src/nsImapUrl.cpp
+++ b/mailnews/imap/src/nsImapUrl.cpp
@@ -226,17 +226,17 @@ NS_IMETHODIMP nsImapUrl::SetQuery(const 
 
 nsresult nsImapUrl::ParseUrl()
 {
   nsresult rv = NS_OK;
   // extract the user name
   GetUserPass(m_userName);
 
   nsAutoCString imapPartOfUrl;
-  rv = GetPath(imapPartOfUrl);
+  rv = GetPathQueryRef(imapPartOfUrl);
   nsAutoCString unescapedImapPartOfUrl;
   MsgUnescapeString(imapPartOfUrl, 0, unescapedImapPartOfUrl);
   if (NS_SUCCEEDED(rv) && !unescapedImapPartOfUrl.IsEmpty())
   {
     ParseImapPart(unescapedImapPartOfUrl.BeginWriting()+1);  // GetPath leaves leading '/' in the path!!!
   }
 
   return NS_OK;
--- a/mailnews/local/src/nsMailboxUrl.cpp
+++ b/mailnews/local/src/nsMailboxUrl.cpp
@@ -406,17 +406,17 @@ nsresult nsMailboxUrl::ParseUrl()
     nsCOMPtr <nsIFileURL> fileURL = do_QueryInterface(uri);
     NS_ENSURE_SUCCESS(rv, rv);
     nsCOMPtr <nsIFile> fileURLFile;
     fileURL->GetFile(getter_AddRefs(fileURLFile));
     m_filePath = do_QueryInterface(fileURLFile, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
-  GetPath(m_file);
+  GetPathQueryRef(m_file);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMailboxUrl::SetSpec(const nsACString &aSpec)
 {
   nsresult rv = nsMsgMailNewsUrl::SetSpec(aSpec);
   if (NS_SUCCEEDED(rv))
     rv = ParseUrl();
--- a/mailnews/news/src/nsNNTPProtocol.cpp
+++ b/mailnews/news/src/nsNNTPProtocol.cpp
@@ -827,21 +827,21 @@ nsresult nsNNTPProtocol::OpenCacheEntry(
   rv = mailnewsUrl->GetBaseURI(getter_AddRefs(uri));
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Truncate of the query part so we don't duplicate urls in the cache for
   // various message parts.
   nsCOMPtr<nsIURI> newUri;
   uri->Clone(getter_AddRefs(newUri));
   nsAutoCString path;
-  newUri->GetPath(path);
+  newUri->GetPathQueryRef(path);
   int32_t pos = path.FindChar('?');
   if (pos != kNotFound) {
     path.SetLength(pos);
-    newUri->SetPath(path);
+    newUri->SetPathQueryRef(path);
   }
   return cacheStorage->AsyncOpenURI(newUri, EmptyCString(), nsICacheStorage::OPEN_NORMALLY, this);
 }
 
 NS_IMETHODIMP nsNNTPProtocol::AsyncOpen(nsIStreamListener *listener, nsISupports *ctxt)
 {
   nsresult rv;
   nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(m_runningURL, &rv);
--- a/mailnews/news/src/nsNntpService.cpp
+++ b/mailnews/news/src/nsNntpService.cpp
@@ -554,17 +554,17 @@ nsNntpService::GetFolderFromUri(const ch
   NS_ENSURE_ARG_POINTER(aUri);
   NS_ENSURE_ARG_POINTER(aFolder);
 
   nsCOMPtr<nsIURI> uri;
   nsresult rv = NS_NewURI(getter_AddRefs(uri), nsDependentCString(aUri));
   NS_ENSURE_SUCCESS(rv,rv);
 
   nsAutoCString path;
-  rv = uri->GetPath(path);
+  rv = uri->GetPathQueryRef(path);
   NS_ENSURE_SUCCESS(rv,rv);
 
   nsCOMPtr <nsIMsgAccountManager> accountManager = do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv,rv);
 
   nsCOMPtr <nsIMsgIncomingServer> server;
   rv = accountManager->FindServerByURI(uri, false, getter_AddRefs(server));
   NS_ENSURE_SUCCESS(rv,rv);
@@ -972,17 +972,17 @@ nsNntpService::GetServerForUri(nsIURI *a
   nsAutoCString scheme;
   nsAutoCString path;
   int32_t port = 0;
   nsresult rv;
 
   rv = aUri->GetAsciiHost(hostName);
   rv = aUri->GetScheme(scheme);
   rv = aUri->GetPort(&port);
-  rv = aUri->GetPath(path);
+  rv = aUri->GetPathQueryRef(path);
 
   nsCOMPtr <nsIMsgAccountManager> accountManager = do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv,rv);
 
   // find the incoming server, it if exists.
   // migrate if necessary, before searching for it.
   // if it doesn't exist, create it.
   nsCOMPtr<nsIMsgIncomingServer> server;
@@ -1511,21 +1511,21 @@ NS_IMETHODIMP nsNntpService::IsMsgInMemC
   nsresult rv;
 
   if (mCacheStorage)
   {
     // NNTP urls are truncated at the query part when used as cache keys.
     nsCOMPtr <nsIURI> newUri;
     aUrl->Clone(getter_AddRefs(newUri));
     nsAutoCString path;
-    newUri->GetPath(path);
+    newUri->GetPathQueryRef(path);
     int32_t pos = path.FindChar('?');
     if (pos != kNotFound) {
       path.SetLength(pos);
-      newUri->SetPath(path);
+      newUri->SetPathQueryRef(path);
     }
     bool exists;
     rv = mCacheStorage->Exists(newUri, EmptyCString(), &exists);
     if (NS_SUCCEEDED(rv) && exists) {
       *aResult = true;
     }
   }
 
--- a/mailnews/news/src/nsNntpUrl.cpp
+++ b/mailnews/news/src/nsNntpUrl.cpp
@@ -191,17 +191,17 @@ nsresult nsNntpUrl::ParseNntpURL()
   }
 
   return NS_OK;
 }
 
 nsresult nsNntpUrl::DetermineNewsAction()
 {
   nsAutoCString path;
-  nsresult rv = nsMsgMailNewsUrl::GetPath(path);
+  nsresult rv = nsMsgMailNewsUrl::GetPathQueryRef(path);
   NS_ENSURE_SUCCESS(rv,rv);
 
   nsAutoCString query;
   rv = GetQuery(query);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (query.EqualsLiteral("cancel"))
   {