Skip to content

Commit

Permalink
Switched bundle id and preference file out to avoid conflict during d…
Browse files Browse the repository at this point in the history
…evelopment. Made note importer maintain first line when getting title.
  • Loading branch information
ttscoff committed Feb 5, 2011
1 parent dfe1eb2 commit a0befe3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions AlienNoteImporter.m
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ - (NoteObject*)noteWithFile:(NSString*)filename {

NSMutableAttributedString *attributedStringFromData = nil;
if (fileType == HTML_TYPE_ID || [extension isEqualToString:@"htm"] || [extension isEqualToString:@"html"] || [extension isEqualToString:@"shtml"]) {
//should convert to text with markdown here
// convert to text with markdown here
if ([[GlobalPrefs defaultPrefs] useMarkdownImport]) {
if ([[GlobalPrefs defaultPrefs] useReadability] || [self shouldUseReadability]) {
attributedStringFromData = [[NSMutableAttributedString alloc] initWithString:[self contentUsingReadability:filename]
Expand Down Expand Up @@ -624,7 +624,7 @@ - (NSArray*)_importStickies:(NSString*)filename {
NSMutableAttributedString *attributedString = [[[NSMutableAttributedString alloc] initWithRTFD:[doc RTFDData] documentAttributes:NULL] autorelease];
[attributedString removeAttachments];
[attributedString santizeForeignStylesForImporting];
NSString *syntheticTitle = [attributedString trimLeadingSyntheticTitle];
NSString *syntheticTitle = [attributedString getLeadingSyntheticTitle];

NoteObject *noteObject = [[[NoteObject alloc] initWithNoteBody:attributedString title:syntheticTitle uniqueFilename:nil format:SingleDatabaseFormat] autorelease];
if (noteObject) {
Expand Down
2 changes: 1 addition & 1 deletion Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
<key>CFBundleIconFile</key>
<string>Notality</string>
<key>CFBundleIdentifier</key>
<string>net.notational.velocity</string>
<string>net.brettterpstra.nvalt</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
Expand Down
2 changes: 1 addition & 1 deletion NotationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ - (void)upgradeDatabaseIfNecessary {
NSLog(@"trying to upgrade note encodings");
[allNotes makeObjectsPerformSelector:@selector(upgradeToUTF8IfUsingSystemEncoding)];
//move aside the old database as the new format breaks compatibility
(void)[self renameAndForgetNoteDatabaseFile:@"Notes & Settings (old version from 2.0b)"];
(void)[self renameAndForgetNoteDatabaseFile:@"nvALT Notes & Settings (old version from 2.0b)"];
}
if (epochIteration < 3) {
[allNotes makeObjectsPerformSelector:@selector(writeFileDatesAndUpdateTrackingInfo)];
Expand Down
2 changes: 1 addition & 1 deletion NotationFileManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <sys/param.h>
#include <sys/mount.h>

NSString *NotesDatabaseFileName = @"Notes & Settings";
NSString *NotesDatabaseFileName = @"nvALT Notes & Settings";

@implementation NotationController (NotationFileManager)

Expand Down
5 changes: 3 additions & 2 deletions PreviewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,13 @@ -(void)preview:(id)object
NSString *rawString = [app noteContent];
SEL mode = [self markupProcessorSelector:[app currentPreviewMode]];
NSString *processedString = [NSString performSelector:mode withObject:rawString];
NSString *previewString = processedString;
NSMutableString *outputString = [NSMutableString stringWithString:(NSString *)htmlString];
NSString *noteTitle = ([app selectedNoteObject]) ? [NSString stringWithFormat:@"%@",titleOfNote([app selectedNoteObject])] : @"";

if (lastNote == [app selectedNoteObject]) {
NSString *restoreScrollPosition = [NSString stringWithFormat:@"\n<script>window.onload = function(){var div = document.getElementById('contentdiv'),oldscroll = %@;div.scrollTop = oldscroll;}</script>",lastScrollPosition];
processedString = [processedString stringByAppendingString:restoreScrollPosition];
previewString = [processedString stringByAppendingString:restoreScrollPosition];
} else {
[cssString release];
[htmlString release];
Expand All @@ -234,7 +235,7 @@ -(void)preview:(id)object
NSString *nvSupportPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Application Support/Notational Velocity"];
[outputString replaceOccurrencesOfString:@"{%support%}" withString:nvSupportPath options:0 range:NSMakeRange(0, [outputString length])];
[outputString replaceOccurrencesOfString:@"{%title%}" withString:noteTitle options:0 range:NSMakeRange(0, [outputString length])];
[outputString replaceOccurrencesOfString:@"{%content%}" withString:processedString options:0 range:NSMakeRange(0, [outputString length])];
[outputString replaceOccurrencesOfString:@"{%content%}" withString:previewString options:0 range:NSMakeRange(0, [outputString length])];
[outputString replaceOccurrencesOfString:@"{%style%}" withString:cssString options:0 range:NSMakeRange(0, [outputString length])];

[[preview mainFrame] loadHTMLString:outputString baseURL:nil];
Expand Down

0 comments on commit a0befe3

Please sign in to comment.