Skip to content

Commit

Permalink
Merge branch 'hotfix-1.14.4'
Browse files Browse the repository at this point in the history
* hotfix-1.14.4:
  Update version info.
  trade: no more copy to ID-named folder
  trade: fix potential error on export
  • Loading branch information
danny0838 committed Nov 20, 2017
2 parents 7e0a64d + 416ff92 commit 8af7753
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
10 changes: 4 additions & 6 deletions chrome/content/scrapbook/trade.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,10 @@ var sbExportService = {
item.exported = (new Date()).toISOString();

var num = 0, destDir, dirName;
var dirNameBase = sbCommonUtils.crop(sbCommonUtils.validateFileName(item.title), 60, 0, '') || "untitled";
dirNameBase = sbCommonUtils.validateFileName(dirNameBase); // avoid potential bad filename such as trailing space
do {
dirName = sbCommonUtils.validateFileName(item.title).substring(0,60) || "untitled";
dirName = dirNameBase;
if ( num > 0 ) dirName += "-" + num;
dirName = dirName.replace(/\./g, "");
destDir = sbTradeService.rightDir.clone();
Expand All @@ -403,11 +405,7 @@ var sbExportService = {
try {
srcDir.copyTo(sbTradeService.rightDir, destDir.leafName);
} catch(ex) {
try {
srcDir.copyTo(sbTradeService.rightDir, item.id);
} catch(ex) {
throw "Failed to copy files.";
}
throw "Failed to copy files.";
}
if (item.type == "folder" || item.type == "bookmark" || item.type == "separator")
sbCommonUtils.removeDirSafety(srcDir);
Expand Down
8 changes: 8 additions & 0 deletions doc/releases/1.14.4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Scrapbook X 1.14.4
==================

Changes since v1.14.3
---------------------

* Fixed an issue that the exported item folder be named after its ID
instead of its title.
2 changes: 1 addition & 1 deletion install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>[email protected]</em:id>
<em:type>2</em:type>
<em:version>1.14.3</em:version>
<em:version>1.14.4</em:version>
<em:unpack>false</em:unpack>
<em:bootstrap>false</em:bootstrap>
<em:multiprocessCompatible>false</em:multiprocessCompatible>
Expand Down

0 comments on commit 8af7753

Please sign in to comment.