Ignore:
Timestamp:
06/23/14 19:51:11 (11 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, enter/10, releng/10.0.3, releng/10.1, releng/10.1.1, releng/10.1.2
Children:
bb3f61c
Parents:
060b819
Message:

Clean up the directory searching and recursive removal in lumina-fm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lumina/lumina-fm/MainUI.cpp

    r603a75a r08438b40  
    3030    ui->tree_dir_view->setContextMenuPolicy(Qt::CustomContextMenu); 
    3131  dirCompleter = new QCompleter(fsmod, this); 
     32    dirCompleter->setModelSorting( QCompleter::CaseInsensitivelySortedModel ); 
    3233    currentDir->setCompleter(dirCompleter); 
    3334  snapmod = new QFileSystemModel(this); 
     
    185186  if(!info.isDir() || !info.exists() ){  
    186187    qDebug() << "Invalid Directory:" << dir; 
    187     return;  
     188    //Try to just go up the dir tree one level 
     189    dir.chop(dir.section("/",-1).length()); 
     190    if(!QFile::exists(dir)){ 
     191      //Still bad dir - try to return to previously shown dir 
     192      if(currentDir->whatsThis().isEmpty()){ return; } //nothing to return to 
     193      else{ dir = currentDir->whatsThis(); } 
     194    } 
    188195  } //do nothing 
    189196  //qDebug() << "Show Directory:" << dir; 
     
    194201  //Update the directory viewer and update the line edit 
    195202  ui->tree_dir_view->setRootIndex( fsmod->setRootPath(dir) ); 
    196   dir.replace(QDir::homePath()+"/", "~/"); 
     203  //dir.replace(QDir::homePath()+"/", "~/"); 
    197204  currentDir->setText(dir); 
    198205  //Adjust the tab data 
     
    441448  }else if(old==currentDir){ 
    442449    QString dir = currentDir->text(); 
    443       dir.replace(QDir::homePath()+"/", "~/"); 
    444       currentDir->setText(dir); 
     450      setCurrentDir(dir); 
    445451  } 
    446452} 
Note: See TracChangeset for help on using the changeset viewer.