Ignore:
Timestamp:
Sep 9, 2013 8:18:58 PM (7 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1
Children:
33f74f7
Parents:
e4d9ea3
Message:

Add a new class to life-preserver that handles all the log/error/process tracking from lpreserver. Not implemented in the tray yet, still needs a bit more work before it is ready to replace a lot of the code in LPTray.
Also add the beginnings of a couple new device management functions to the LPBackend.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/life-preserver/LPBackend.cpp

    r845aaf6 r284b216  
    316316} 
    317317 
     318// ====================== 
     319//          Device Management 
     320// ====================== 
     321QStringList LPBackend::listDevices(){ 
     322  //Scan the system for all valid da* and ada* devices (USB/SCSI, SATA) 
     323  //Return format: "<device node> (<device information>)" 
     324  QDir devDir("/dev"); 
     325  QStringList devs = devDir.entryList(QStringList() << "da*"<<"ada*", QDir::System | QDir::NoSymLinks, QDir::Name); 
     326  QStringList camOut = LPBackend::getCmdOutput("camcontrol devlist"); 
     327  QStringList output, flist;     
     328  for(int i=0; i<devs.length(); i++){ 
     329    flist = camOut.filter("("+devs[i]+","); 
     330    //still need to add an additional device filter to weed out devices currently in use. 
     331    if(!flist.isEmpty()){ output << devs[i] + " ("+flist[0].section(">",0,0).remove("<").simplified()+")"; } 
     332  } 
     333  return output; 
     334} 
     335 
     336bool LPBackend::isMounted(QString device){ 
     337  qDebug() << "Device mount check not implemented yet"; 
     338  return false; 
     339} 
     340 
     341bool LPBackend::unmountDevice(QString device){ 
     342  qDebug() << "Device unmounting not implemented yet"; 
     343  return false; 
     344} 
    318345 
    319346// ========================= 
Note: See TracChangeset for help on using the changeset viewer.