Bug 1507809 - Remove 'ExcludeReadOnlyFolders' option from places' queries r=Standard8
authorJames Lee <jamesl33info@gmail.com>
Mon, 26 Nov 2018 13:18:05 +0000
changeset 507185 693821f7cf935d9ad882af4b12f699562a6e7ea7
parent 507184 326ed3b7c89498850b2830fbaa18b850841ecaec
child 507186 f2f2f8b59557b9cd3781222d2329039c031a6032
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1507809
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1507809 - Remove 'ExcludeReadOnlyFolders' option from places' queries r=Standard8 Removed all references to 'ExcludeReadOnlyFolders' since Firefox doesn't (and will not) support read only folders. Differential Revision: https://phabricator.services.mozilla.com/D12821
browser/components/places/content/editBookmark.js
browser/components/places/content/tree.xml
browser/components/places/content/treeView.js
toolkit/components/places/nsINavHistoryService.idl
toolkit/components/places/nsNavHistoryQuery.cpp
toolkit/components/places/nsNavHistoryQuery.h
toolkit/components/places/nsNavHistoryResult.cpp
--- a/browser/components/places/content/editBookmark.js
+++ b/browser/components/places/content/editBookmark.js
@@ -675,17 +675,17 @@ var gEditItemOverlay = {
       expander.setAttribute("tooltiptext",
                             expander.getAttribute("tooltiptextup"));
       folderTreeRow.collapsed = false;
 
       // XXXmano: Ideally we would only do this once, but for some odd reason,
       // the editable mode set on this tree, together with its collapsed state
       // breaks the view.
       const FOLDER_TREE_PLACE_URI =
-        "place:excludeItems=1&excludeQueries=1&excludeReadOnlyFolders=1&type=" +
+        "place:excludeItems=1&excludeQueries=1&type=" +
         Ci.nsINavHistoryQueryOptions.RESULTS_AS_ROOTS_QUERY;
       this._folderTree.place = FOLDER_TREE_PLACE_URI;
 
       this._element("chooseFolderSeparator").hidden =
         this._element("chooseFolderMenuItem").hidden = true;
       this._folderTree.selectItems([this._paneInfo.parentGuid]);
       this._folderTree.focus();
     }
--- a/browser/components/places/content/tree.xml
+++ b/browser/components/places/content/tree.xml
@@ -506,18 +506,17 @@
                 return null;
 
               var queryOptions = PlacesUtils.asQuery(result.root).queryOptions;
               if (queryOptions.sortingMode !=
                     Ci.nsINavHistoryQueryOptions.SORT_BY_NONE) {
                 // If we are within a sorted view, insert at the end
                 index = -1;
               } else if (queryOptions.excludeItems ||
-                         queryOptions.excludeQueries ||
-                         queryOptions.excludeReadOnlyFolders) {
+                         queryOptions.excludeQueries) {
                 // Some item may be invisible, insert near last selected one.
                 // We don't replace index here to avoid requests to the db,
                 // instead it will be calculated later by the controller.
                 index = -1;
                 dropNearNode = lastSelected;
               } else {
                 var lsi = container.getChildIndex(lastSelected);
                 index = orientation == Ci.nsITreeView.DROP_BEFORE ? lsi : lsi + 1;
--- a/browser/components/places/content/treeView.js
+++ b/browser/components/places/content/treeView.js
@@ -1307,18 +1307,17 @@ PlacesTreeView.prototype = {
           return null;
 
         let queryOptions = PlacesUtils.asQuery(this._result.root).queryOptions;
         if (queryOptions.sortingMode !=
               Ci.nsINavHistoryQueryOptions.SORT_BY_NONE) {
           // If we are within a sorted view, insert at the end.
           index = -1;
         } else if (queryOptions.excludeItems ||
-                 queryOptions.excludeQueries ||
-                 queryOptions.excludeReadOnlyFolders) {
+                 queryOptions.excludeQueries) {
           // Some item may be invisible, insert near last selected one.
           // We don't replace index here to avoid requests to the db,
           // instead it will be calculated later by the controller.
           index = -1;
           dropNearNode = lastSelected;
         } else {
           let lsi = container.getChildIndex(lastSelected);
           index = orientation == Ci.nsITreeView.DROP_BEFORE ? lsi : lsi + 1;
--- a/toolkit/components/places/nsINavHistoryService.idl
+++ b/toolkit/components/places/nsINavHistoryService.idl
@@ -1019,23 +1019,16 @@ interface nsINavHistoryQueryOptions : ns
   /**
    * Set to true to exclude queries ("place:" URIs) from the query results.
    * Simple folder queries (bookmark folder symlinks) will still be included.
    * Defaults to false.
    */
   attribute boolean excludeQueries;
 
   /**
-   * DO NOT USE THIS API. IT'LL BE REMOVED IN BUG 1072833.
-   *
-   * Set to true to exclude live bookmarks from the query results.
-   */
-  attribute boolean excludeReadOnlyFolders;
-
-  /**
    * When set, allows items with "place:" URIs to appear as containers,
    * with the container's contents filled in from the stored query.
    * If not set, these will appear as normal items. Doesn't do anything if
    * excludeQueries is set. Defaults to false.
    *
    * Note that this has no effect on folder links, which are place: URIs
    * returned by nsINavBookmarkService.GetFolderURI. These are always expanded
    * and will appear as bookmark folders.
--- a/toolkit/components/places/nsNavHistoryQuery.cpp
+++ b/toolkit/components/places/nsNavHistoryQuery.cpp
@@ -85,17 +85,16 @@ static void SetOptionsKeyUint32(const ns
 #define QUERYKEY_NOTANNOTATION "!annotation"
 #define QUERYKEY_ANNOTATION "annotation"
 #define QUERYKEY_URI "uri"
 #define QUERYKEY_GROUP "group"
 #define QUERYKEY_SORT "sort"
 #define QUERYKEY_RESULT_TYPE "type"
 #define QUERYKEY_EXCLUDE_ITEMS "excludeItems"
 #define QUERYKEY_EXCLUDE_QUERIES "excludeQueries"
-#define QUERYKEY_EXCLUDE_READ_ONLY_FOLDERS "excludeReadOnlyFolders"
 #define QUERYKEY_EXPAND_QUERIES "expandQueries"
 #define QUERYKEY_FORCE_ORIGINAL_TITLE "originalTitle"
 #define QUERYKEY_INCLUDE_HIDDEN "includeHidden"
 #define QUERYKEY_MAX_RESULTS "maxResults"
 #define QUERYKEY_QUERY_TYPE "queryType"
 #define QUERYKEY_TAG "tag"
 #define QUERYKEY_NOTTAGS "!tags"
 #define QUERYKEY_ASYNC_ENABLED "asyncEnabled"
@@ -322,22 +321,16 @@ nsNavHistory::QueryToQueryString(nsINavH
   }
 
   // exclude queries
   if (options->ExcludeQueries()) {
     AppendAmpersandIfNonempty(queryString);
     queryString += NS_LITERAL_CSTRING(QUERYKEY_EXCLUDE_QUERIES "=1");
   }
 
-  // exclude read only folders
-  if (options->ExcludeReadOnlyFolders()) {
-    AppendAmpersandIfNonempty(queryString);
-    queryString += NS_LITERAL_CSTRING(QUERYKEY_EXCLUDE_READ_ONLY_FOLDERS "=1");
-  }
-
   // expand queries
   if (!options->ExpandQueries()) {
     AppendAmpersandIfNonempty(queryString);
     queryString += NS_LITERAL_CSTRING(QUERYKEY_EXPAND_QUERIES "=0");
   }
 
   // include hidden
   if (options->IncludeHidden()) {
@@ -510,21 +503,16 @@ nsNavHistory::TokensToQuery(const nsTArr
       SetOptionsKeyBool(kvp.value, aOptions,
                         &nsINavHistoryQueryOptions::SetExcludeItems);
 
     // exclude queries
     } else if (kvp.key.EqualsLiteral(QUERYKEY_EXCLUDE_QUERIES)) {
       SetOptionsKeyBool(kvp.value, aOptions,
                         &nsINavHistoryQueryOptions::SetExcludeQueries);
 
-    // exclude read only folders
-    } else if (kvp.key.EqualsLiteral(QUERYKEY_EXCLUDE_READ_ONLY_FOLDERS)) {
-      SetOptionsKeyBool(kvp.value, aOptions,
-                        &nsINavHistoryQueryOptions::SetExcludeReadOnlyFolders);
-
     // expand queries
     } else if (kvp.key.EqualsLiteral(QUERYKEY_EXPAND_QUERIES)) {
       SetOptionsKeyBool(kvp.value, aOptions,
                         &nsINavHistoryQueryOptions::SetExpandQueries);
     // include hidden
     } else if (kvp.key.EqualsLiteral(QUERYKEY_INCLUDE_HIDDEN)) {
       SetOptionsKeyBool(kvp.value, aOptions,
                         &nsINavHistoryQueryOptions::SetIncludeHidden);
@@ -1034,31 +1022,29 @@ nsNavHistoryQuery::Clone(nsNavHistoryQue
 // nsNavHistoryQueryOptions
 NS_IMPL_ISUPPORTS(nsNavHistoryQueryOptions, nsNavHistoryQueryOptions, nsINavHistoryQueryOptions)
 
 nsNavHistoryQueryOptions::nsNavHistoryQueryOptions()
 : mSort(0)
 , mResultType(0)
 , mExcludeItems(false)
 , mExcludeQueries(false)
-, mExcludeReadOnlyFolders(false)
 , mExpandQueries(true)
 , mIncludeHidden(false)
 , mMaxResults(0)
 , mQueryType(nsINavHistoryQueryOptions::QUERY_TYPE_HISTORY)
 , mAsyncEnabled(false)
 {
 }
 
 nsNavHistoryQueryOptions::nsNavHistoryQueryOptions(const nsNavHistoryQueryOptions& other)
 : mSort(other.mSort)
 , mResultType(other.mResultType)
 , mExcludeItems(other.mExcludeItems)
 , mExcludeQueries(other.mExcludeQueries)
-, mExcludeReadOnlyFolders(other.mExcludeReadOnlyFolders)
 , mExpandQueries(other.mExpandQueries)
 , mIncludeHidden(other.mIncludeHidden)
 , mMaxResults(other.mMaxResults)
 , mQueryType(other.mQueryType)
 , mAsyncEnabled(other.mAsyncEnabled)
 {
 }
 
@@ -1122,31 +1108,16 @@ nsNavHistoryQueryOptions::GetExcludeQuer
   return NS_OK;
 }
 NS_IMETHODIMP
 nsNavHistoryQueryOptions::SetExcludeQueries(bool aExclude)
 {
   mExcludeQueries = aExclude;
   return NS_OK;
 }
-
-// excludeReadOnlyFolders
-NS_IMETHODIMP
-nsNavHistoryQueryOptions::GetExcludeReadOnlyFolders(bool* aExclude)
-{
-  *aExclude = mExcludeReadOnlyFolders;
-  return NS_OK;
-}
-NS_IMETHODIMP
-nsNavHistoryQueryOptions::SetExcludeReadOnlyFolders(bool aExclude)
-{
-  mExcludeReadOnlyFolders = aExclude;
-  return NS_OK;
-}
-
 // expandQueries
 NS_IMETHODIMP
 nsNavHistoryQueryOptions::GetExpandQueries(bool* aExpand)
 {
   *aExpand = mExpandQueries;
   return NS_OK;
 }
 NS_IMETHODIMP
--- a/toolkit/components/places/nsNavHistoryQuery.h
+++ b/toolkit/components/places/nsNavHistoryQuery.h
@@ -115,17 +115,16 @@ public:
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSINAVHISTORYQUERYOPTIONS
 
   uint16_t SortingMode() const { return mSort; }
   uint16_t ResultType() const { return mResultType; }
   bool ExcludeItems() const { return mExcludeItems; }
   bool ExcludeQueries() const { return mExcludeQueries; }
-  bool ExcludeReadOnlyFolders() const { return mExcludeReadOnlyFolders; }
   bool ExpandQueries() const { return mExpandQueries; }
   bool IncludeHidden() const { return mIncludeHidden; }
   uint32_t MaxResults() const { return mMaxResults; }
   uint16_t QueryType() const { return mQueryType; }
   bool AsyncEnabled() const { return mAsyncEnabled; }
 
   nsresult Clone(nsNavHistoryQueryOptions **_clone);
 
@@ -137,17 +136,16 @@ private:
   //  * Add a new getter for C++ above if it makes sense
   //  * Add to the serialization code (see nsNavHistory::QueriesToQueryString())
   //  * Add to the deserialization code (see nsNavHistory::QueryStringToQueries)
   //  * Add to the nsNavHistory.cpp::GetSimpleBookmarksQueryFolder function if applicable
   uint16_t mSort;
   uint16_t mResultType;
   bool mExcludeItems;
   bool mExcludeQueries;
-  bool mExcludeReadOnlyFolders;
   bool mExpandQueries;
   bool mIncludeHidden;
   uint32_t mMaxResults;
   uint16_t mQueryType;
   bool mAsyncEnabled;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsNavHistoryQueryOptions, NS_NAVHISTORYQUERYOPTIONS_IID)
--- a/toolkit/components/places/nsNavHistoryResult.cpp
+++ b/toolkit/components/places/nsNavHistoryResult.cpp
@@ -801,19 +801,16 @@ nsNavHistoryContainerResultNode::SetAsPa
     nsNavHistoryContainerResultNode* container = aNode->GetAsContainer();
     // Propagate some of the parent's options to this container.
     if (mOptions->ExcludeItems()) {
       container->mOptions->SetExcludeItems(true);
     }
     if (mOptions->ExcludeQueries()) {
       container->mOptions->SetExcludeQueries(true);
     }
-    if (mOptions->ExcludeReadOnlyFolders()) {
-      container->mOptions->SetExcludeReadOnlyFolders(true);
-    }
     if (aNode->IsFolder() && mOptions->AsyncEnabled()) {
       container->mOptions->SetAsyncEnabled(true);
     }
     if (!mOptions->ExpandQueries()) {
       container->mOptions->SetExpandQueries(false);
     }
     container->mResult = mResult;
     container->FillStats();
@@ -3304,18 +3301,17 @@ nsNavHistoryFolderResultNode::Refresh()
  */
 bool
 nsNavHistoryFolderResultNode::StartIncrementalUpdate()
 {
   // if any items are excluded, we can not do incremental updates since the
   // indices from the bookmark service will not be valid
 
   if (!mOptions->ExcludeItems() &&
-      !mOptions->ExcludeQueries() &&
-      !mOptions->ExcludeReadOnlyFolders()) {
+      !mOptions->ExcludeQueries()) {
     // easy case: we are visible, always do incremental update
     if (mExpanded || AreChildrenVisible())
       return true;
 
     nsNavHistoryResult* result = GetResult();
     NS_ENSURE_TRUE(result, false);
 
     // When any observers are attached also do incremental updates if our