1. Herbert Breunung
  2. Kephra

Commits

Herbert Breunung  committed 9e97a12

renaming the doc file attributes

  • Participants
  • Parent commits 59801bf
  • Branches default

Comments (0)

Files changed (2)

File lib/Kephra/App/Panel/Editor.pm

View file
  • Ignore whitespace
 sub create_document {
     my $file = shift;
     my $doc = Kephra::Document->new(file_path => $file);
-    $doc->editor( $doc_bar{'leftup'}->add_edit_page(1, $doc->label) );
+    $doc->editor( $doc_bar{'leftup'}->add_edit_page(1, $doc->file_name) );
     Kephra::DocumentStash::add( $doc );
     return $doc;
 }

File lib/Kephra/Document.pm

View file
  • Ignore whitespace
     #default => sub { },
 );
 has file_path    => ( is  => 'rw', required => 1 );
-has label        => ( is  => 'rw', default => sub {
+has file_dir     => ( is  => 'rw', default => sub {
+    return '' unless $_[0]->file_path;
+    my $file_path = ( File::Spec->splitpath( $_[0]->file_path ) )[1];
+    # cut off ending ??
+    # $file_name  = substr $file_name, 0, index ($file_name,'.') if index ($file_name,'.');
+} );
+has file_name    => ( is  => 'rw', default => sub {
     return '' unless $_[0]->file_path;
     my $file_name = ( File::Spec->splitpath( $_[0]->file_path ) )[2];
     # cut off ending ??