Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
docu-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gerhard Gonter
docu-tools
Commits
d6578123
Commit
d6578123
authored
11 years ago
by
Gerhard Gonter
Browse files
Options
Downloads
Patches
Plain Diff
more metadata about notes
parent
9ea5cf1c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
perl/Gnome-Tomboy/lib/Tomboy/Directory.pm
+12
-2
12 additions, 2 deletions
perl/Gnome-Tomboy/lib/Tomboy/Directory.pm
with
12 additions
and
2 deletions
perl/Gnome-Tomboy/lib/Tomboy/Directory.pm
+
12
−
2
View file @
d6578123
...
...
@@ -4,7 +4,7 @@
=head1 NAME
Tomboy::Directory
;
Tomboy::Directory
=head1 SYNOPSIS
...
...
@@ -21,7 +21,7 @@ use strict;
use
Tomboy::Note::
Simple
;
my
@TB_note_attrs
=
qw(title create-date last-change-date last-metadata-change-date)
;
my
@TB_meta_attrs
=
qw(uid
notebook
)
;
my
@TB_meta_attrs
=
qw(uid
mtime size notebook is_template
)
;
sub
TB_attrs
{
return
(
@TB_meta_attrs
,
@TB_note_attrs
)
}
sub
new
...
...
@@ -61,6 +61,13 @@ sub scan_dir
my
$fp
=
join
('
/
',
$dir
,
$e
);
# print "reading note [$fp]\n"; # TODO: if verbose...
my
@st
=
stat
(
$fp
);
unless
(
@st
)
{
print
"
ATTN: can't stat '
$fp
'
\n
";
next
NOTE
;
}
my
$n
=
parse
Tomboy::Note::
Simple
(
$fp
);
unless
(
defined
(
$n
))
...
...
@@ -71,10 +78,13 @@ sub scan_dir
my
%rec
=
map
{
$_
=>
$n
->
{
$_
}
}
@TB_note_attrs
;
$rec
{'
uid
'}
=
$uid
;
$rec
{'
mtime
'}
=
$st
[
9
];
$rec
{'
size
'}
=
$st
[
7
];
foreach
my
$tag
(
@
{
$n
->
{'
tags
'}})
{
if
(
$tag
=~
m#system:notebook:(.+)#
)
{
$rec
{'
notebook
'}
=
$
1
}
elsif
(
$tag
eq
'
system:template
')
{
$rec
{'
is_template
'}
=
1
;
}
}
push
(
@res
,
\
%rec
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment