コード例 #1
0
ファイル: placesview.cpp プロジェクト: rbazaud/pcmanfm-qt
void PlacesView::activateRow(int type, const QModelIndex& index) {
  if(!index.parent().isValid()) // ignore root items
    return;
  PlacesModelItem* item = static_cast<PlacesModelItem*>(model_->itemFromIndex(index));
  if(item) {
    FmPath* path = item->path();
    if(!path) {
      // check if mounting volumes is needed
      if(item->type() == PlacesModelItem::Volume) {
        PlacesModelVolumeItem* volumeItem = static_cast<PlacesModelVolumeItem*>(item);
        if(!volumeItem->isMounted()) {
          // Mount the volume
          GVolume* volume = volumeItem->volume();
          MountOperation* op = new MountOperation(true, this);
          op->mount(volume);
          // connect(op, SIGNAL(finished(GError*)), SLOT(onMountOperationFinished(GError*)));
          // blocking here until the mount operation is finished?

          // FIXME: update status of the volume after mount is finished!!
          if(!op->wait())
            return;
          path = item->path();
        }
      }
    }
    if(path) {
      Q_EMIT chdirRequested(type, path);
    }
  }
}
コード例 #2
0
ファイル: placesview.cpp プロジェクト: rbazaud/pcmanfm-qt
void PlacesView::onOpenNewWindow()
{
  PlacesModel::ItemAction* action = static_cast<PlacesModel::ItemAction*>(sender());
  if(!action->index().isValid())
      return;
  PlacesModelItem* item = static_cast<PlacesModelItem*>(model_->itemFromIndex(action->index()));
  if(item)
    Q_EMIT chdirRequested(2, item->path());
}
コード例 #3
0
ファイル: sidepane.cpp プロジェクト: npmiller/pcmanfm-qt
void SidePane::onDirTreeViewChdirRequested(int type, FmPath* path) {
  Q_EMIT chdirRequested(type, path);
}
コード例 #4
0
ファイル: sidepane.cpp プロジェクト: npmiller/pcmanfm-qt
void SidePane::onPlacesViewChdirRequested(int type, FmPath* path) {
  Q_EMIT chdirRequested(type, path);
}