Logo Search packages:      
Sourcecode: qtiplot version File versions  Download package

void ApplicationWindow::moveFolder ( FolderListItem src,
FolderListItem dest 
) [slot]

moves a folder item to another

Parameters:
src source folder item
dest destination folder item

Definition at line 14038 of file ApplicationWindow.cpp.

References Folder::addWindow(), Folder::birthDate(), FolderListItem::folder(), Folder::modificationDate(), Folder::removeWindow(), Folder::setBirthDate(), Folder::setFolderListItem(), Folder::setModificationDate(), and Folder::windowsList().

Referenced by dropFolderItems().

{
      folders->blockSignals(true);

      Folder *dest_f = dest->folder();
      Folder *src_f = src->folder();

      dest_f = new Folder(dest_f, src_f->objectName());
      dest_f->setBirthDate(src_f->birthDate());
      dest_f->setModificationDate(src_f->modificationDate());

      FolderListItem *copy_item = new FolderListItem(dest, dest_f);
      copy_item->setText(0, src_f->objectName());
      dest_f->setFolderListItem(copy_item);

      QList<MyWidget *> lst = QList<MyWidget *>(src_f->windowsList());
      foreach(MyWidget *w, lst)
      {
            src_f->removeWindow(w);
            w->hide();
            dest_f->addWindow(w);
      }

      if ( !(src_f->children()).isEmpty() )
      {
            FolderListItem *item = (FolderListItem *)src->firstChild();
            int initial_depth = item->depth();
            while (item && item->depth() >= initial_depth)
            {
                  src_f = (Folder *)item->folder();

                  dest_f = new Folder(dest_f, src_f->objectName());
                  dest_f->setBirthDate(src_f->birthDate());
                  dest_f->setModificationDate(src_f->modificationDate());

                  copy_item = new FolderListItem(copy_item, dest_f);
                  copy_item->setText(0, src_f->objectName());
                  dest_f->setFolderListItem(copy_item);

                  lst = QList<MyWidget *>(src_f->windowsList());
                  foreach(MyWidget *w, lst)
                  {
                        src_f->removeWindow(w);
                        w->hide();
                        dest_f->addWindow(w);
                  }

                  item = (FolderListItem *)item->itemBelow();
            }
      }

      src_f = src->folder();
      delete src_f;
      delete src;
      folders->blockSignals(false);
}


Generated by  Doxygen 1.6.0   Back to index