From d08c01797a319ec72b965f309afdf5d3d212c8a2 Mon Sep 17 00:00:00 2001 From: Ger Hobbelt Date: Thu, 29 Oct 2020 02:02:36 +0100 Subject: [PATCH] tweak the LibraryType code so as to identify auto-discovered 'Legacy' libraries as 'Legacy' instead of 'UNKNOWN' and allow these to be synced -- ONCE WE GET TO ADDING AN EDITOR SO YOU CAN SET/CHANGE THE SYNC TARGET DIRECTORY FOR ANY LIBRARY, that is. --- .../WebLibraryStuff/WebLibraryDetail.cs | 18 +++++++++--------- .../WebLibraryStuff/WebLibraryManager.cs | 9 +++------ .../WebLibraryStuff/WebLibraryDetail.cs | 2 +- .../WebLibraryStuff/WebLibraryManager.cs | 2 +- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryDetail.cs b/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryDetail.cs index 7991ff31c..f6cb90068 100644 --- a/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryDetail.cs +++ b/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryDetail.cs @@ -84,7 +84,7 @@ public string LibraryType() if (IsIntranetLibrary) return "Intranet"; if (IsBundleLibrary) return "Bundle"; if (IsWebLibrary) return "Web"; - return "UNKNOWN"; + return "Legacy"; } #if false @@ -99,17 +99,17 @@ public WebLibraryDetail CloneSansLibraryReference() rv.Description = this.Description; rv.Deleted = this.Deleted; //LastSynced - //FolderToWatch + //FolderToWatch rv.IsLocalGuestLibrary = this.IsLocalGuestLibrary; - //ShortWebId - //IsAdministrator + //ShortWebId + //IsAdministrator //IsReadOnly - //IntranetPath - //BundleManifestJSON - //LastBundleManifestDownloadTimestampUTC - //LastBundleManifestIgnoreVersion + //IntranetPath + //BundleManifestJSON + //LastBundleManifestDownloadTimestampUTC + //LastBundleManifestIgnoreVersion rv.IsPurged = this.IsPurged; - //LastServerSyncNotificationDate + //LastServerSyncNotificationDate rv.AutoSync = false; return rv; diff --git a/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryManager.cs b/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryManager.cs index f24fc4296..3b3b7967e 100644 --- a/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryManager.cs +++ b/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryManager.cs @@ -523,7 +523,7 @@ private void SaveKnownWebLibraries(string filename = null) // *** MIGRATION TO OPEN SOURCE CODE *************************************************************************** // ************************************************************************************************************* // Don't remember the web libraries - let them be discovered by this - if ("UNKNOWN" == web_library_detail.LibraryType()) + if ("Legacy" == web_library_detail.LibraryType()) { continue; } @@ -840,11 +840,8 @@ private void UpdateKnownWebLibrary(WebLibraryDetail new_web_library_detail, bool old.IsReadOnly = MixOldAndNew(old.IsReadOnly, new_web_library_detail.IsReadOnly, new_web_library_detail.Id + "::" + nameof(old.IsReadOnly), ref state); // fixup: - if (old.LibraryType() != "UNKNOWN" && old.IsReadOnly) - { - // reset ReadOnly for everyone who is ex-Premium(Plus) for all their known libraries. - old.IsReadOnly = false; - } + // reset ReadOnly for everyone who is ex-Premium(Plus) for all their known libraries. + old.IsReadOnly = false; old.library?.Dispose(); diff --git a/QiqqaLegacyFileFormats/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryDetail.cs b/QiqqaLegacyFileFormats/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryDetail.cs index c4b538b70..0e85a58b7 100644 --- a/QiqqaLegacyFileFormats/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryDetail.cs +++ b/QiqqaLegacyFileFormats/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryDetail.cs @@ -68,7 +68,7 @@ public string LibraryType() if (IsIntranetLibrary) return "Intranet"; if (IsBundleLibrary) return "Bundle"; if (IsWebLibrary) return "Web"; - return "UNKNOWN"; + return "Legacy"; } } } diff --git a/QiqqaLegacyFileFormats/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryManager.cs b/QiqqaLegacyFileFormats/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryManager.cs index f48a61ef8..4f526164b 100644 --- a/QiqqaLegacyFileFormats/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryManager.cs +++ b/QiqqaLegacyFileFormats/Qiqqa/DocumentLibrary/WebLibraryStuff/WebLibraryManager.cs @@ -57,7 +57,7 @@ private void SaveKnownWebLibraries(string filename = null) // *** MIGRATION TO OPEN SOURCE CODE *************************************************************************** // ************************************************************************************************************* // Don't remember the web libraries - let them be discovered by this - if ("UNKNOWN" == web_library_detail.LibraryType()) + if ("Legacy" == web_library_detail.LibraryType()) { continue; }