Commits

Herbert Breunung committed 90fc1df

renamed doc attribute old_file_path => prev_file_path

Comments (0)

Files changed (2)

lib/Kephra/API/Doc.pm

 	my $doc = find( shift );
 	Kephra::Log::warning('need a ' . DOC_CLASS . " thats in stash, not $doc!", 1)
 		unless is($doc);
-	my $file = $doc->old_file_path;
+	my $file = $doc->prev_file_path;
 	delete $document{'file'}{$file} if $file and $document{'file'}{$file};
 	if ($doc->file_path){
 		$document{'file'}{$doc->file_path} = $doc;
-		unless ($doc->old_file_path) {
+		unless ($doc->prev_file_path) {
 			delete $document{'anon'}{$doc->anon_NR};
 			$doc->anon_NR(0);
 		}
 	} else {
-		if ($doc->old_file_path) {
+		if ($doc->prev_file_path) {
 			$doc->anon_NR( $lowest_free_anon_NR++ );
 			$document{'anon'}{$doc->anon_NR} = $doc;
 		}

lib/Kephra/Document.pm

 
 my $max_title_width = 15;                               # export SUB_QUOTE_DEBUG=1
 
-has ID     => ( is  => 'rwp' );                             # API::Doc ID
-has title  => ( is  => 'rwp' );                             # shown as tab label
-has editor => ( is  => 'rwp', default => sub { {} } );
-has panel  => ( is  => 'rwp', default => sub { {} } );
-has anon_NR=> ( is  => 'rw' );
-has file_path=>( 
-	is      => 'rw',
-	coerce  =>  sub { Kephra::File::normalize_path($_[0]) },
-	trigger =>  sub {
+has ID       => ( is  => 'rwp' );                             # API::Doc ID
+has title    => ( is  => 'rwp' );                             # shown as tab label
+has editor   => ( is  => 'rwp', default => sub { {} } );
+has panel    => ( is  => 'rwp', default => sub { {} } );
+has anon_NR  => ( is  => 'rw' );
+has file_path=> ( 
+	is       => 'rw',
+	coerce   =>  sub { Kephra::File::normalize_path($_[0]) },
+	trigger  =>  sub {
 		my $self = shift;
-		return if $self->old_file_path and $self->file_path
-				and $self->old_file_path eq $self->file_path;
+		return if $self->prev_file_path and $self->file_path
+				and $self->prev_file_path eq $self->file_path;
 		Kephra::API::Doc::rename_file($self) if $self->ID;
 
 		if ($self->file_path) {
 			$self->_set_title('<untitled '.$self->anon_NR.'>');
 		}
 
-		$self->_set_old_file_path( $self->file_path );
+		$self->_set_prev_file_path( $self->file_path );
 		$_->set_page_title( $self->title, $self->panel->{$_} ) for Kephra::API::all_docbars();
 	});
-has file_dir     => ( is => 'rwp', );
-has file_name    => ( is => 'rwp', );
-has old_file_path=> ( is => 'rwp' );
-has content      => ( is => 'rw', reader=> sub{ $_[0] } );
-has notes        => ( is => 'rw', );
+has file_dir      => ( is => 'rwp', );
+has file_name     => ( is => 'rwp', );
+has prev_file_path=> ( is => 'rwp' );
+has content       => ( is => 'rw', reader=> sub{ $_[0] } );
+has notes         => ( is => 'rw', );
 
-has syntax_mode  => ( is => 'rw', default => sub { 'perl' } );
-has readonly     => ( is => 'rw', );
-has active_config=> ( is => 'rw', );
-has caret_pos    => ( is => 'rw', );
-has edit_pos     => ( is => 'rw', );
-has encoding     => ( is => 'rw', );
-has EOL          => ( is => 'rw', );
-has tab_size     => ( is => 'rw', );
-has tab_use      => ( is => 'rw', );
-has folded_lines => ( is => 'rw', );
-has marked_lines => ( is => 'rw', );
+has syntax_mode   => ( is => 'rw', default => sub { 'perl' } );
+has readonly      => ( is => 'rw', );
+has active_config => ( is => 'rw', );
+has caret_pos     => ( is => 'rw', );
+has edit_pos      => ( is => 'rw', );
+has encoding      => ( is => 'rw', );
+has EOL           => ( is => 'rw', );
+has tab_size      => ( is => 'rw', );
+has tab_use       => ( is => 'rw', );
+has folded_lines  => ( is => 'rw', );
+has marked_lines  => ( is => 'rw', );
 
 
 sub BUILDARGS {