Bug 709265 - Remove unused AnnotatePersonalToolbarFolder from nsBrowserProfileMigratorUtils; r=gavin

This commit is contained in:
Ed Morley 2011-12-16 09:13:29 +00:00
parent ef84a75477
commit 1db65d16d1
2 changed files with 0 additions and 62 deletions

View File

@ -42,8 +42,6 @@
#include "nsToolkitCompsCID.h"
#include "nsIPlacesImportExportService.h"
#include "nsIFile.h"
#include "nsIInputStream.h"
#include "nsILineInputStream.h"
#include "nsIProperties.h"
#include "nsIProfileMigrator.h"
@ -165,57 +163,6 @@ GetProfilePath(nsIProfileStartup* aStartup, nsCOMPtr<nsIFile>& aProfileDir)
}
}
nsresult
AnnotatePersonalToolbarFolder(nsIFile* aSourceBookmarksFile,
nsIFile* aTargetBookmarksFile,
const char* aToolbarFolderName)
{
nsCOMPtr<nsIInputStream> fileInputStream;
nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(fileInputStream),
aSourceBookmarksFile);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIOutputStream> outputStream;
rv = NS_NewLocalFileOutputStream(getter_AddRefs(outputStream),
aTargetBookmarksFile);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsILineInputStream> lineInputStream =
do_QueryInterface(fileInputStream, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCAutoString sourceBuffer;
nsCAutoString targetBuffer;
bool moreData = false;
PRUint32 bytesWritten = 0;
do {
lineInputStream->ReadLine(sourceBuffer, &moreData);
if (!moreData)
break;
PRInt32 nameOffset = sourceBuffer.Find(aToolbarFolderName);
if (nameOffset >= 0) {
// Found the personal toolbar name on a line, check to make sure it's
// actually a folder.
NS_NAMED_LITERAL_CSTRING(folderPrefix, "<DT><H3 ");
PRInt32 folderPrefixOffset = sourceBuffer.Find(folderPrefix);
if (folderPrefixOffset >= 0)
sourceBuffer.Insert(NS_LITERAL_CSTRING("PERSONAL_TOOLBAR_FOLDER=\"true\" "),
folderPrefixOffset + folderPrefix.Length());
}
targetBuffer.Assign(sourceBuffer);
targetBuffer.Append("\r\n");
outputStream->Write(targetBuffer.get(), targetBuffer.Length(),
&bytesWritten);
}
while (1);
outputStream->Close();
return NS_OK;
}
nsresult
ImportBookmarksHTML(nsIFile* aBookmarksFile,
bool aImportIntoRoot,

View File

@ -99,15 +99,6 @@ void GetMigrateDataFromArray(MigrationData* aDataArray,
// this is already cloned, modify it to your heart's content
void GetProfilePath(nsIProfileStartup* aStartup, nsCOMPtr<nsIFile>& aProfileDir);
// The Netscape Bookmarks Format (bookmarks.html) is fairly standard but
// each browser vendor seems to have their own way of identifying the
// Personal Toolbar Folder. This function scans for the vendor-specific
// name in the source Bookmarks file and then writes out a normalized
// variant into the target folder.
nsresult AnnotatePersonalToolbarFolder(nsIFile* aSourceBookmarksFile,
nsIFile* aTargetBookmarksFile,
const char* aToolbarFolderName);
// In-place import from aBookmarksFile into a folder in the user's bookmarks.
// If the importIntoRoot parameter has a value of true, the bookmarks will be
// imported into the bookmarks root folder. Otherwise, they'll be imported into