Skip to content
Snippets Groups Projects
Commit 947271ac authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

allow notebooks to be present in multiple notebooks (see discussion about tomboy-ng)

parent 90229329
No related branches found
No related tags found
No related merge requests found
...@@ -162,6 +162,7 @@ print __LINE__, " scan_dir: quick=[$quick]\n"; ...@@ -162,6 +162,7 @@ print __LINE__, " scan_dir: quick=[$quick]\n";
# print "n: ", main::Dumper ($n); # print "n: ", main::Dumper ($n);
my %rec= map { $_ => $n->{$_} } @TB_note_attrs; my %rec= map { $_ => $n->{$_} } @TB_note_attrs;
$rec{'notebook'}= join (';', @{$rec{notebook}}) if ($rec{notebook});
$rec{'uuid'}= $fnm_uuid; $rec{'uuid'}= $fnm_uuid;
$rec{'mtime'}= $st[9]; $rec{'mtime'}= $st[9];
$rec{'size'}= $st[7]; $rec{'size'}= $st[7];
......
...@@ -256,7 +256,7 @@ sub parse ...@@ -256,7 +256,7 @@ sub parse
} }
elsif ($tag =~ m#system:notebook:(.+)#) elsif ($tag =~ m#system:notebook:(.+)#)
{ {
$note->{'notebook'}= $1; push (@{$note->{'notebook'}} => $1);
} }
# TODO: maybe there other tags as well... # TODO: maybe there other tags as well...
} }
...@@ -528,7 +528,7 @@ sub save ...@@ -528,7 +528,7 @@ sub save
$note->update() unless ($note->{'flg_lines'}); $note->update() unless ($note->{'flg_lines'});
my ($title, $uuid, $lines, $ts_updated, $ts_md_updated, $ts_created, my ($title, $uuid, $lines, $ts_updated, $ts_md_updated, $ts_created,
$e_updated, $is_template, $nb_name)= $e_updated, $is_template, $nb_list)=
map { $note->{$_} } qw(title uuid lines last-change-date map { $note->{$_} } qw(title uuid lines last-change-date
last-metadata-change-date create-date e_updated is_template last-metadata-change-date create-date e_updated is_template
notebook); notebook);
...@@ -549,7 +549,13 @@ sub save ...@@ -549,7 +549,13 @@ sub save
# print "tags: ", Dumper ($note->{'tags'}); # print "tags: ", Dumper ($note->{'tags'});
my @tags= (); my @tags= ();
push (@tags, 'system:template') if ($is_template); push (@tags, 'system:template') if ($is_template);
push (@tags, 'system:notebook:'. $nb_name) if ($nb_name); if ($nb_list)
{
foreach my $nb_name (@$nb_list)
{
push (@tags, 'system:notebook:'. $nb_name)
}
}
unless (defined ($fnm_out)) unless (defined ($fnm_out))
{ {
......
...@@ -17,6 +17,7 @@ do stuff with Tomboy files ...@@ -17,6 +17,7 @@ do stuff with Tomboy files
--note-path <dir> --note-path <dir>
-d <dir> ... full path of Tomboy notes directory -d <dir> ... full path of Tomboy notes directory
-e ... edit note (used with find) -e ... edit note (used with find)
-v ... same as -e, use Vi as editor
=head1 OP-CODES =head1 OP-CODES
...@@ -106,6 +107,7 @@ while (my $arg= shift (@ARGV)) ...@@ -106,6 +107,7 @@ while (my $arg= shift (@ARGV))
elsif ($a eq 'T') { $verbosity= 'title'; } elsif ($a eq 'T') { $verbosity= 'title'; }
elsif ($a eq 'e') { $start_tb= 1; } elsif ($a eq 'e') { $start_tb= 1; }
elsif ($a eq 'v') { $start_visual_editor= 1; } elsif ($a eq 'v') { $start_visual_editor= 1; }
# elsif ($a eq 'l') { $show_note= 1; }
elsif ($a eq 'D') { $dump_note= 1; } elsif ($a eq 'D') { $dump_note= 1; }
else else
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment