[Pkg-mozext-commits] [tabmixplus] 21/44: Bookmark sessions with more than one group when user starts Firefox 45+ for the first time without Tab Groups extension
David Prévot
taffit at moszumanska.debian.org
Fri Mar 18 20:57:15 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository tabmixplus.
commit 46c3545002b498219946f5299923a662241b3139
Author: onemen <tabmix.onemen at gmail.com>
Date: Sun Feb 28 18:01:06 2016 +0200
Bookmark sessions with more than one group when user starts Firefox 45+ for the first time without Tab Groups extension
---
modules/TabGroupsMigrator.jsm | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/modules/TabGroupsMigrator.jsm b/modules/TabGroupsMigrator.jsm
index 68fde72..4e91d8c 100644
--- a/modules/TabGroupsMigrator.jsm
+++ b/modules/TabGroupsMigrator.jsm
@@ -73,12 +73,25 @@ this.TabmixGroupsMigrator = {
return false;
};
+ let bookmarkGroups = (session) => {
+ let state = window.TabmixConvertSession.getSessionState(session, true);
+ let groupData = this.gatherGroupData(state);
+ if (groupData.exist) {
+ this.bookmarkAllGroupsFromState(groupData.data);
+ }
+ };
+
let string = s => TabmixSvc.getSMString("sm.tabview.backup." + s);
- let saveSessions = (type, index) => {
+ let saveSessions = (type, index, bookmark) => {
let session = sm.gSessionPath[index];
if (!isSessionWithGroups(session)) {
return;
}
+
+ if (bookmark && index == 0) {
+ bookmarkGroups(session);
+ }
+
sm.saveClosedSession({
session: session,
name: {name: string(type)},
@@ -93,9 +106,9 @@ this.TabmixGroupsMigrator = {
// one more older session
let index = isAfterCrash ? 1 : 0;
saveSessions("session", index + 1);
- saveSessions("session", index);
+ saveSessions("session", index, true);
if (isAfterCrash) {
- saveSessions("crashed", 0);
+ saveSessions("crashed", 0, true);
}
if (notify) {
TabmixSvc.sm.showMissingTabViewNotification = {msg: string("msg")};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git
More information about the Pkg-mozext-commits
mailing list