| 1 | # Copyrights 2001-2020 by [Mark Overmeer]. | ||||||||||||||||||||||||||||
| 2 | # For other contributors see ChangeLog. | ||||||||||||||||||||||||||||
| 3 | # See the manual pages for details on the licensing terms. | ||||||||||||||||||||||||||||
| 4 | # Pod stripped from pm file by OODoc 2.02. | ||||||||||||||||||||||||||||
| 5 | # This code is part of distribution Mail-Box. Meta-POD processed with | ||||||||||||||||||||||||||||
| 6 | # OODoc into POD and HTML manual-pages. See README.md | ||||||||||||||||||||||||||||
| 7 | # Copyright Mark Overmeer. Licensed under the same terms as Perl itself. | ||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | package Mail::Box::Identity; | ||||||||||||||||||||||||||||
| 10 | 3 | ▶ | use vars '$VERSION'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 3 | $VERSION = '3.009'; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 3 | ▶ | use base qw/User::Identity::Item Mail::Reporter/; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 3 | ▶ | use Mail::Box::Collection; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | # tests in tests/52message/30collect.t | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 0 | ▶ | sub type { "mailbox" } | ||||||||||||||||||||||||||
|
Subroutine
type: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | sub new(@) | ||||||||||||||||||||||||||||
| 27 | 13 | ▶ | { my $class = shift; | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||||||||||||||||||
| 28 | 13 | ▶ | unshift @_, 'name' if @_ % 2; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 29 | 13 | $class->Mail::Reporter::new(@_); | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | sub init($) | ||||||||||||||||||||||||||||
| 33 | 13 | ▶ | { my ($self, $args) = @_; | ||||||||||||||||||||||||||
|
Subroutine
init: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 13 | $self->Mail::Reporter::init($args); | |||||||||||||||||||||||||||
| 36 | 13 | $self->User::Identity::init($args); | |||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 13 | $self->{MBI_location} = delete $args->{location}; | |||||||||||||||||||||||||||
| 39 | 13 | $self->{MBI_ftype} = delete $args->{folder_type}; | |||||||||||||||||||||||||||
| 40 | 13 | $self->{MBI_manager} = delete $args->{manager}; | |||||||||||||||||||||||||||
| 41 | 13 | ▶ | $self->{MBI_subf_type} = delete $args->{subf_type}||'Mail::Box::Collection'; | ||||||||||||||||||||||||||
|
Condition50%1/2
delete $args->{'subf_type'} || 'Mail::Box::Collection'
MC/DC0%0/1
delete $args->{'subf_type'} || 'Mail::Box::Collection'
delete $args->{'subf_type'}
Truth table50%1/2
A
A= delete $args->{'subf_type'}
| |||||||||||||||||||||||||||||
| 42 | 13 | $self->{MBI_only_subs} = delete $args->{only_subs}; | |||||||||||||||||||||||||||
| 43 | 13 | $self->{MBI_marked} = delete $args->{marked}; | |||||||||||||||||||||||||||
| 44 | 13 | $self->{MBI_deleted} = delete $args->{deleted}; | |||||||||||||||||||||||||||
| 45 | 13 | ▶ | $self->{MBI_inferiors} = exists $args->{inferiors} ? $args->{inferiors} : 1; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 13 | $self; | |||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | #------------------------------------------- | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | sub fullname(;$) | ||||||||||||||||||||||||||||
| 54 | 64 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
fullname: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||
| 55 | 64 | ▶ | my $delim = @_ && defined $_[0] ? shift : '/'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
@_ and defined $_[0]
MC/DC50%1/2
@_ and defined $_[0]
@_
defined $_[0]
Truth table66%2/3
A and B
A= @_B= defined $_[0]
| |||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 64 | ▶ | my $parent = $self->parent or return $self->name; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 58 | 42 | $parent->parent->fullname($delim) . $delim . $self->name; | |||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | sub location(;$) | ||||||||||||||||||||||||||||
| 64 | 77 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
location: called CC=4 SCAR=14.8
Pod
documented
| |||||||||||||||||||||||||||||
| 65 | 77 | ▶ | return ($self->{MBI_location} = shift) if @_; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 66 | 77 | ▶ | return $self->{MBI_location} if defined $self->{MBI_location}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | 52 | my $parent = $self->parent; | |||||||||||||||||||||||||||
| 69 | 52 | ▶ | unless(defined $parent) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 70 | 0 | { $self->log(ERROR => "Toplevel directory requires explicit location"); | |||||||||||||||||||||||||||
| 71 | 0 | return undef; | |||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | $self->folderType | ||||||||||||||||||||||||||||
| 75 | 52 | ->nameOfSubFolder($self->name, $parent->parent->location) | |||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | sub folderType() | ||||||||||||||||||||||||||||
| 81 | 222 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
folderType: called CC=3 SCAR=11.6
Pod
documented
| |||||||||||||||||||||||||||||
| 82 | 222 | ▶ | return $self->{MBI_ftype} if defined $self->{MBI_ftype}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | 147 | my $parent = $self->parent; | |||||||||||||||||||||||||||
| 85 | 147 | ▶ | unless(defined $parent) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 86 | 0 | { $self->log(ERROR => "Toplevel directory requires explicit folder type"); | |||||||||||||||||||||||||||
| 87 | 0 | return undef; | |||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | 147 | $parent->parent->folderType; | |||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | sub manager() | ||||||||||||||||||||||||||||
| 96 | 1 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
manager: called CC=3 SCAR=16.5
Pod
documented
| |||||||||||||||||||||||||||||
| 97 | 1 | ▶ | return $self->{MBI_manager} if $self->{MBI_manager}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 98 | 0 | ▶ | my $parent = $self->parent or return undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 99 | 0 | $self->parent->manager; | |||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||
| 104 | sub topfolder() | ||||||||||||||||||||||||||||
| 105 | 11 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
topfolder: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 106 | 11 | ▶ | my $parent = $self->parent or return $self; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 107 | 7 | $parent->parent->topfolder; | |||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||
| 112 | sub onlySubfolders(;$) | ||||||||||||||||||||||||||||
| 113 | 1 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
onlySubfolders: called CC=4 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 114 | 1 | ▶ | return($self->{MBI_only_subs} = shift) if @_; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 115 | 1 | ▶ | return $self->{MBI_only_subs} if exists $self->{MBI_only_subs}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 116 | 0 | ▶ | $self->parent ? 1 : ! $self->folderType->topFolderWithMessages; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||
| 121 | sub marked(;$) | ||||||||||||||||||||||||||||
| 122 | 0 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
marked: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 123 | 0 | ▶ | @_ ? ($self->{MBI_marked} = shift) : $self->{MBI_marked}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||
| 128 | sub inferiors(;$) | ||||||||||||||||||||||||||||
| 129 | 1 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
inferiors: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||||||||||||||||||||
| 130 | 1 | ▶ | @_ ? ($self->{MBI_inferiors} = shift) : $self->{MBI_inferiors}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 131 | } | ||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||
| 135 | sub deleted(;$) | ||||||||||||||||||||||||||||
| 136 | 0 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
deleted: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 137 | 0 | ▶ | @_ ? ($self->{MBI_deleted} = shift) : $self->{MBI_deleted}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||
| 140 | #------------------------------------------- | ||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||
| 143 | sub subfolders() | ||||||||||||||||||||||||||||
| 144 | 54 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
subfolders: called CC=10 SCAR=25.0
Pod
documented
| |||||||||||||||||||||||||||||
| 145 | 54 | my $subs = $self->collection('subfolders'); | |||||||||||||||||||||||||||
| 146 | 54 | ▶ | return (wantarray ? $subs->roles : $subs) | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 147 | if defined $subs; | ||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||
| 149 | 22 | my @subs; | |||||||||||||||||||||||||||
| 150 | 22 | ▶ | if(my $location = $self->location) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 151 | 22 | { @subs = $self->folderType->listSubFolders | |||||||||||||||||||||||||||
| 152 | ( folder => $location | ||||||||||||||||||||||||||||
| 153 | ); | ||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||
| 155 | else | ||||||||||||||||||||||||||||
| 156 | 0 | { my $mgr = $self->manager; | |||||||||||||||||||||||||||
| 157 | 0 | ▶ | my $top = defined $mgr ? $mgr->folderdir : '.'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||
| 159 | 0 | @subs = $self->folderType->listSubFolders | |||||||||||||||||||||||||||
| 160 | ( folder => $self->fullname | ||||||||||||||||||||||||||||
| 161 | , folderdir => $top | ||||||||||||||||||||||||||||
| 162 | ); | ||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||
| 164 | 22 | ▶ | @subs or return (); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||
| 166 | my $subf_type | ||||||||||||||||||||||||||||
| 167 | 4 | ▶ | = $self->{MBI_subf_type} || ref($self->parent) || 'Mail::Box::Collection'; | ||||||||||||||||||||||||||
|
Condition40%2/5
$self->{'MBI_subf_type'} || ref $self->parent || 'Mail::Box::Collection'
$self->{"MBI_subf_type"} or ref $self->parent
MC/DC0%0/2
$self->{'MBI_subf_type'} || ref $self->parent || 'Mail::Box::Collection'
$self->{"MBI_subf_type"}
ref $self->parent
Truth table33%1/3
A or B
A= $self->{"MBI_subf_type"}B= ref $self->parent
| |||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||
| 169 | 4 | $subs = $subf_type->new('subfolders'); | |||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||
| 171 | 4 | $self->addCollection($subs); | |||||||||||||||||||||||||||
| 172 | 4 | $subs->addRole(name => $_) for @subs; | |||||||||||||||||||||||||||
| 173 | 4 | ▶ | wantarray ? $subs->roles : $subs; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 174 | } | ||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||
| 178 | 3 | ▶ | sub subfolderNames() { map {$_->name} shift->subfolders } | ||||||||||||||||||||||||||
|
Subroutine
subfolderNames: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||
| 182 | sub folder(@) | ||||||||||||||||||||||||||||
| 183 | 30 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
folder: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||||||||
| 184 | 30 | ▶ | return $self unless @_ && defined $_[0]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
@_ and defined $_[0]
MC/DC50%1/2
@_ and defined $_[0]
@_
defined $_[0]
Truth table66%2/3
A and B
A= @_B= defined $_[0]
| |||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||
| 186 | 22 | ▶ | my $subs = $self->subfolders or return undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 187 | 21 | ▶ | my $nest = $subs->find(shift) or return undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 188 | 19 | $nest->folder(@_); | |||||||||||||||||||||||||||
| 189 | } | ||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||
| 193 | sub open(@) | ||||||||||||||||||||||||||||
| 194 | 0 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
open: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 195 | 0 | $self->manager->open($self->fullname, type => $self->folderType, @_); | |||||||||||||||||||||||||||
| 196 | } | ||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||
| 200 | sub foreach($) | ||||||||||||||||||||||||||||
| 201 | 24 | ▶ | { my ($self, $code) = @_; | ||||||||||||||||||||||||||
|
Subroutine
foreach: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 202 | 24 | $code->($self); | |||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||
| 204 | 24 | ▶ | my $subs = $self->subfolders or return (); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 205 | 8 | $_->foreach($code) for $subs->sorted; | |||||||||||||||||||||||||||
| 206 | 8 | $self; | |||||||||||||||||||||||||||
| 207 | } | ||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||
| 211 | sub addSubfolder(@) | ||||||||||||||||||||||||||||
| 212 | 1 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
addSubfolder: called CC=3 SCAR=12.6
Pod
undocumented
| |||||||||||||||||||||||||||||
| 213 | 1 | my $subs = $self->subfolders; | |||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||
| 215 | 1 | ▶ | if(defined $subs) { ; } | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 216 | elsif(!$self->inferiors) | ||||||||||||||||||||||||||||
| 217 | 0 | { my $name = $self->fullname; | |||||||||||||||||||||||||||
| 218 | 0 | $self->log(ERROR => "It is not permitted to add subfolders to $name"); | |||||||||||||||||||||||||||
| 219 | 0 | return undef; | |||||||||||||||||||||||||||
| 220 | } | ||||||||||||||||||||||||||||
| 221 | else | ||||||||||||||||||||||||||||
| 222 | 1 | { $subs = $self->{MBI_subf_type}->new('subfolders'); | |||||||||||||||||||||||||||
| 223 | 1 | $self->addCollection($subs); | |||||||||||||||||||||||||||
| 224 | } | ||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||
| 226 | 1 | $subs->addRole(@_); | |||||||||||||||||||||||||||
| 227 | } | ||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||
| 231 | sub remove(;$) | ||||||||||||||||||||||||||||
| 232 | 2 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
remove: called CC=4 SCAR=14.6
Pod
documented
| |||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||
| 234 | 2 | my $parent = $self->parent; | |||||||||||||||||||||||||||
| 235 | 2 | ▶ | unless(defined $parent) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 236 | 0 | { $self->log(ERROR => "The toplevel folder cannot be removed this way"); | |||||||||||||||||||||||||||
| 237 | 0 | return (); | |||||||||||||||||||||||||||
| 238 | } | ||||||||||||||||||||||||||||
| 239 | |||||||||||||||||||||||||||||
| 240 | 2 | ▶ | return $parent->removeRole($self->name) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 241 | unless @_; | ||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||
| 243 | 1 | my $name = shift; | |||||||||||||||||||||||||||
| 244 | 1 | ▶ | my $subs = $self->subfolders or return (); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 245 | 1 | $subs->removeRole($name); | |||||||||||||||||||||||||||
| 246 | } | ||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||
| 249 | |||||||||||||||||||||||||||||
| 250 | sub rename($;$) | ||||||||||||||||||||||||||||
| 251 | 1 | ▶ | { my ($self, $folder, $newname) = @_; | ||||||||||||||||||||||||||
|
Subroutine
rename: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||
| 252 | 1 | ▶ | $newname = $self->name unless defined $newname; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||
| 254 | 1 | my $away = $self->remove; | |||||||||||||||||||||||||||
| 255 | 1 | $away->name($newname); | |||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||
| 257 | 1 | $folder->addSubfolder($away); | |||||||||||||||||||||||||||
| 258 | } | ||||||||||||||||||||||||||||
| 259 | |||||||||||||||||||||||||||||
| 260 | #------------------------------------------- | ||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||
| 262 | |||||||||||||||||||||||||||||
| 263 | 3 | 1; | |||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||