MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); left_panel=new FilePanel(ui->centralWidget); right_panel=new FilePanel(ui->centralWidget); currentPanel=left_panel; menu=new QMenu; ui->gridLayout->addWidget(left_panel->layoutWidget,1,0,1,1); ui->gridLayout->addWidget(right_panel->layoutWidget,1,1,1,1); connect(left_panel,SIGNAL(tryOpen(QModelIndex)),this,SLOT(open(QModelIndex))); connect(left_panel,SIGNAL(tryJump(QString)),this,SLOT(jumpTo(QString))); connect(left_panel,SIGNAL(panelActivated(FilePanel*)),this,SLOT(setCurrentPanel(FilePanel*))); connect(left_panel,SIGNAL(tryDelete()),this,SLOT(start_del())); connect(right_panel,SIGNAL(tryOpen(QModelIndex)),this,SLOT(open(QModelIndex))); connect(right_panel,SIGNAL(tryJump(QString)),this,SLOT(jumpTo(QString))); connect(right_panel,SIGNAL(panelActivated(FilePanel*)),this,SLOT(setCurrentPanel(FilePanel*))); connect(right_panel,SIGNAL(tryDelete()),this,SLOT(start_del())); initDrives(); connect(right_panel,SIGNAL(tryMount(QString)),this,SLOT(mountDrive(QString))); connect(left_panel,SIGNAL(tryMount(QString)),this,SLOT(mountDrive(QString))); left_panel->setModel(new fileModel); right_panel->setModel(new fileModel); setup_contextMenu(); left_panel->setPopupMenu(menu); right_panel->setPopupMenu(menu); setup_toolbar(); setup_favoritiesPath(); left_panel->loadSettings("Left"); right_panel->loadSettings("Right"); connect(left_panel,SIGNAL(tryDrop(QList<QUrl>,QString,Qt::DropAction)),this,SLOT(drop(QList<QUrl>,QString,Qt::DropAction))); connect(right_panel,SIGNAL(tryDrop(QList<QUrl>,QString,Qt::DropAction)),this,SLOT(drop(QList<QUrl>,QString,Qt::DropAction))); connect(left_panel,SIGNAL(moveChecked(bool)),right_panel,SLOT(checkMove(bool))); connect(right_panel,SIGNAL(moveChecked(bool)),left_panel,SLOT(checkMove(bool))); QFileSystemWatcher *watcher=new QFileSystemWatcher; watcher->addPath("/dev/disk/by-uuid"); connect(watcher,SIGNAL(directoryChanged(QString)),this,SLOT(drivesChanged(QString))); }
void ProxyEntity::iDestroyed(ProxyObjectPtr ptr, Liveness::Token lt) { if (!lt) return; assert(ptr == mProxy); // Not explicitly deleted here, we just mark it as a candidate for // destruction. mCanDestroy = true; tryDelete(); }
void ProxyEntity::iHandleDestroyTimeout(Liveness::Token lt) { if (!lt) return; SILOG(ogre, detailed, "Handling destruction timeout for ProxyEntity " << mProxy->getObjectReference().toString()); assert(mProxy); assert(mActive); getScene()->downloadPlanner()->removeObject(mProxy); mActive = false; tryDelete(); }
void rtZone::operator()() { // // thread entry point each executing zone // // create an eyecatcher -- a unique string for the zone/thread. Use the path of the initial frame in the zone for this. Note: initial zone will have zero-length eyecatcher. // this is used mainly as part of the per-zone/per-thread log file names. // Having multiple threads writing to the same log file requires syncronization which slows things down too much eyeCatcher=activeFrames.begin()->second->pathStr(); // // open a log file for this zone only-- useful because sharing an ostream between zones/threads is not practical due to resulting interleaved output // //erfc logFile.open("/tmp/{"+eyeCatcher+"}",std::ios::out); //erfc logFile<<"zone starting"<<std::endl; executeActivePhase(); // make state transitions for the frame(s) in the zone until no active frames remain // note: dormant frames may still remain afterwards myTree->forwardLinksEncountered += forwardLinksEncountered; // for you performance and accounting types myTree->newFramesCreated += newFramesCreated; myTree->oldFramesDeleted += oldFramesDeleted; myTree->oldFramesReused += oldFramesReused; myTree->predicatesEvaluatedFalse += predicatesEvaluatedFalse; myTree->predicatesEvaluatedTrue += predicatesEvaluatedTrue; myTree->totalSlept += totalSlept; myTree->transitionCount += transitionCount; //erfc logFile<<"operator(): zone done, locking self"<<std::endl; zoneLock.lock(); //erfc logFile<<"operator(): zone done, self locked"<<std::endl; // // make a sweep with the zone locked to delete any remaining dormant frames with no children // unsigned int dormantFramesFreed=0; while (dormantFramesFreed>0) { // while loop always loops at least once dormantFramesFreed=0; for(auto i=dormantFrames.begin();i!=dormantFrames.end();i++) { //erfc logFile<<"operator(): considering: {"<<i->second->pathStr()<<"}"<<std::endl; hsmAtomicUint & candidatenumChildFrames = ( (hsmVariable<hsmAtomicUint> *) i->second->instantiations["numChildFrames"])->getReference(); hsmPath & candidateabsolutePath = ( (hsmVariable<hsmPath> *) i->second->instantiations["absolutePath"])->getReference(); if (candidatenumChildFrames==0) { //erfc logFile<<"operator(): considering: {"<<i->second->pathStr()<<"} has no childFrames"<<std::endl; dormantFramesFreed++; dormantFrames.erase(candidateabsolutePath); // note: deleting from the map currently being iterated, best to start over //erfc if (i->second->parentFrame != 0) { //erfc logFile<<"operator(): C: {"<<i->second->parentFrame->pathStr()<<"} numChildFrames: "<<i->second->parentFrame->numChildFrames<<std::endl; //erfc } freeFrames.insert(std::pair<std::string,rtFrame *>(i->second->mySubMachine->name,i->second)); break; } //erfc else { //erfc logFile<<"operator(): considering: {"<<i->second->pathStr()<<"} has childFrames"<<std::endl; //erfc } } } //erfc logFile<<"operator(): marking zone ("<<eyeCatcher<<") inactive"<<std::endl; zoneIsInactive=true; if (superiorZone!=0) { //erfc logFile<<"operator(): decrementing superior zone ("<<superiorZone->eyeCatcher<<") numActiveChildZones"<<std::endl; superiorZone->zoneLock.lock(); superiorZone->numActiveInferiorZones--; superiorZone->zoneLock.unlock(); //erfc logFile<<"operator(): done decrementing superior zone ("<<superiorZone->eyeCatcher<<") numActiveChildZones"<<std::endl; } //erfc logFile<<"operator(): zone done, unlocking self"<<std::endl; zoneLock.unlock(); //erfc logFile<<"zone done, self lock released, deleting"<<std::endl; //erfc logFile<<"operator(): zone done, tryDeleting"<<std::endl; // note: don't do anything with "this" after tryDelete() call (this will likely get deleted) rtTree * originalTree=myTree; if (tryDelete(this) ) { originalTree->wait_c.notify_all(); // if we deleted the top zone... we are done! } return; // note: this is where the thread associated with the zone exits }