projects
/
MojoFacets.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
35a6cab
)
store timefmt and restore on reload
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 27 Jun 2023 13:48:08 +0000
(15:48 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 27 Jun 2023 13:48:08 +0000
(15:48 +0200)
lib/MojoFacets/Data.pm
patch
|
blob
|
history
diff --git
a/lib/MojoFacets/Data.pm
b/lib/MojoFacets/Data.pm
index
e1dc8ac
..
eceafb7
100644
(file)
--- a/
lib/MojoFacets/Data.pm
+++ b/
lib/MojoFacets/Data.pm
@@
-69,6
+69,9
@@
sub index {
find( sub {
my $file = $File::Find::name;
find( sub {
my $file = $File::Find::name;
+
+ next if $file =~ m/.timefmt$/;
+
if ( -f $file && $file =~ m/([^\/]+)\.changes\/(\d+[\.,]\d+.+)/ ) {
push @{ $changes->{$1} }, $2
} elsif ( import_module( $file ) ) {
if ( -f $file && $file =~ m/([^\/]+)\.changes\/(\d+[\.,]\d+.+)/ ) {
push @{ $changes->{$1} }, $2
} elsif ( import_module( $file ) ) {
@@
-261,6
+264,11
@@
sub _load_path {
$loaded->{ $path } = $info;
$self->_save( $path ) unless $info->{generated};
$loaded->{ $path } = $info;
$self->_save( $path ) unless $info->{generated};
+ my $timefmt_path = $self->_permanent_path( 'timefmt' );
+ if ( -e $timefmt_path ) {
+ $self->session( 'timefmt', read_file $timefmt_path );
+ }
+
}
}
@@
-734,6
+742,14
@@
sub items {
$self->_switch_dataset;
$self->_switch_dataset;
+ if ( my $timefmt = $self->param('timefmt') ) {
+ $self->session('timefmt', $timefmt);
+ warn "session store timefmt $timefmt\n";
+ my $timefmt_path = $self->_permanent_path( 'timefmt' );
+ write_file $timefmt_path, $timefmt;
+ warn "## $timefmt_path $timefmt"
+ }
+
if ( my $show = $self->param('id') ) {
$self->param('show', $show);
warn "show $show\n";
if ( my $show = $self->param('id') ) {
$self->param('show', $show);
warn "show $show\n";