Fix bookmark file is not created when it does not exist.

master
boisso 8 years ago
parent e3932cb374
commit 96be366b14
  1. 2
      k-meleon/ns_bookmarks/ns_bookmarks.rc
  2. 13
      k-meleon/ns_bookmarks/ns_bookmarks_utils.cpp

@ -230,7 +230,7 @@ BEGIN
IDS_NEW_BOOKMARK "New Bookmark"
IDS_NEW_FOLDER "New Folder"
IDS_IMPORTED_FAVORITES "Imported Favorites"
IDS_FAILED_SAVE "Failed to save bookmarks."
IDS_FAILED_SAVE "Failed to save bookmarks. Verify that you have the permissions to write the bookmarks file."
IDS_ERROR "Error"
IDS_CONFIGURE "Configure the bookmarks plugin"
IDS_ADD "Add to bookmarks"

@ -494,10 +494,14 @@ void SaveBM(const TCHAR *file)
return;
}
create_backup(file);
create_backup(file);
_tunlink(file);
_trename(buf, file);
if (_trename(buf, file) != 0) {
MessageBox(NULL, gLoc->GetString(IDS_FAILED_SAVE), gLoc->GetString(IDS_ERROR), MB_OK|MB_ICONERROR);
ReleaseMutex(ghMutex);
return;
}
}
gGeneratedByUs = true;
@ -822,9 +826,10 @@ void LoadBM(const TCHAR *file)
ParseBookmarks(bmFileBuffer, *gBookmarkRoot);
gLoaded = TRUE;
delete [] bmFileBuffer;
}
fclose(bmFile);
}
}
fclose(bmFile);
gLoaded = TRUE;
}
ReleaseMutex(ghMutex);

Loading…
Cancel
Save