~ubuntu-branches/debian/sid/gource/sid

« back to all changes in this revision

Viewing changes to src/dirnode.cpp

  • Committer: Package Import Robot
  • Author(s): Andrew Caudwell
  • Date: 2014-04-15 16:30:17 UTC
  • mfrom: (1.2.15)
  • Revision ID: package-import@ubuntu.com-20140415163017-ucdr2josj1spzrga
Tags: 0.41-1
* New upstream release
* Made VCS URIs canonical
* Changed watch file to look at Github for releases

Show diffs side-by-side

added added

removed removed

Lines of Context:
214
214
    this->parent = parent;
215
215
 
216
216
    adjustPath();
217
 
 
218
 
    //set depth
 
217
    adjustDepth();
 
218
}
 
219
 
 
220
void RDirNode::adjustDepth() {
 
221
 
219
222
    if(parent == 0) {
220
 
        depth = 1.0;
 
223
        depth = 1;
221
224
    } else {
222
225
        depth = parent->getDepth() + 1;
223
226
    }
 
227
 
 
228
    for(RDirNode* child : children) {
 
229
        child->adjustDepth();
 
230
    }
224
231
}
225
232
 
226
233
void RDirNode::addNode(RDirNode* node) {
308
315
void RDirNode::printFiles() {
309
316
    for(std::list<RFile*>::iterator it = files.begin(); it != files.end(); it++) {
310
317
        RFile* file = (*it);
311
 
        fprintf(stderr, "%s: %s %s%s%s\n", getPath().c_str(), file->fullpath.c_str() , file->isExpiring() ? "expiring " : "", file->isRemoving() ? "removing " : "", file->isHidden() ? "hidden " : "");
 
318
        fprintf(stderr, "%s: %s %s\n", getPath().c_str(), file->fullpath.c_str() , file->isHidden() ? "hidden " : "");
312
319
    }
313
320
}
314
321
 
916
923
void RDirNode::drawDirName(FXFont& dirfont) const{
917
924
    if(parent==0) return;
918
925
    if(gGourceSettings.hide_dirnames) return;
 
926
    if(gGourceSettings.dir_name_depth > 0 && gGourceSettings.dir_name_depth < (depth-1)) return;
919
927
 
920
928
    if(!gGourceSettings.highlight_dirs && since_last_node_change > 5.0) return;
921
929