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

void KBearFileSysPart::slotSynch ( const QString &  localPath,
const QString &  remotePath 
) [private, slot]

Definition at line 1940 of file kbearfilesyspart.cpp.

References KBearPart::closeMe(), KBearPart::logMessage(), KBearPart::openConnection(), KBearChildViewPart::openFile(), KBearPart::setDirLister(), Connection::setLocalPath(), Connection::setRemotePath(), showFileView(), slotDeleteFinished(), slotFinishedLoading(), slotInfoMessage(), and slotStartLoading().

                                                                                   {
      if( ! m_url.hasHost() ) // shouldn't happend
            return;

      Connection c = m_connection;
      c.setLocalPath( localDir );
      c.setRemotePath( remoteDir );

      if( m_partViewerWidget && m_partViewer ) { // this shouldn't happend but just in case
            m_partViewer->manager()->replacePart( m_partViewer, this );
            delete m_partViewerWidget;
            m_partViewerWidget = 0L;
            m_partViewer = 0L;
            m_splitter->setSizes( m_splitterSizes );
      }
      m_splitterSizes = m_splitter->sizes();
      m_splitterSizes.append( m_splitterSizes[1] );
      m_partViewerWidget = new QWidget( m_splitter, "PartViewerWidget");
      m_partViewer = KParts::ComponentFactory::createPartInstanceFromLibrary
                                                      <KParts::ReadOnlyPart>("libkbeardirsynchpart",
                                                      m_partViewerWidget, "KBearDirSynchPartWidget", m_partViewerWidget, "KBearDirSynchPart" );

      if( ! m_partViewer ) {
            delete m_partViewerWidget;
            m_partViewerWidget = 0L;
            m_partViewer = 0L;
            return;
      }
      QObject::disconnect( m_dirLister, SIGNAL( newItems( const KFileItemList &) ), this, SLOT( slotNewItems( const KFileItemList &) ) );
      QObject::disconnect( m_dirLister, SIGNAL( newItems( const KFileItemList &) ), m_leftView, SLOT( slotInsertItems( const KFileItemList &) ) );
      QObject::disconnect( m_dirLister, SIGNAL( deleteItem( KFileItem* ) ), this, SLOT( slotDeleteItem( KFileItem* ) ) );
      QObject::disconnect( m_dirLister, SIGNAL( deleteItem( KFileItem* ) ), m_leftView, SLOT( slotDeleteItem( KFileItem* )));
      QObject::disconnect( m_dirLister, SIGNAL( openDir( const KFileItem* ) ), this, SLOT( slotOpenDir( const KFileItem* ) ) );
      QObject::disconnect( m_dirLister, SIGNAL( openFile( const KFileItem* ) ), this, SLOT( slotOpenFile( const KFileItem* ) ) );
      QObject::disconnect( m_dirLister, SIGNAL( redirection( const KURL& ) ), this, SLOT( slotRedirected( const KURL& ) ) );
      QObject::disconnect( m_dirLister, SIGNAL( clear() ), this, SLOT( slotClear() ) );
      QObject::disconnect( m_dirLister, SIGNAL( deleteFinished() ), this, SLOT( slotDeleteFinished() ) );
     QObject::disconnect( m_dirLister, SIGNAL( started() ), this, SLOT( slotStartLoading() ) );
      QObject::disconnect( m_dirLister, SIGNAL( finishedLoading() ), this, SLOT( slotFinishedLoading() ) );
      QObject::disconnect( m_dirLister, SIGNAL( speed(int) ), this, SLOT( slotSpeed(int) ) );

      connect( m_partViewer, SIGNAL( setStatusBarText( const QString& ) ),
                        this, SLOT( slotInfoMessage( const QString& ) ) );
      connect( m_partViewer, SIGNAL( started( KIO::Job* ) ), this, SLOT( slotStartLoading() ) );
      connect( m_partViewer, SIGNAL( completed() ), this, SLOT( slotFinishedLoading() ) );
      connect( static_cast<KBearPart*>(m_partViewer), SIGNAL( logMessage( const QString& ) ),
                        this, SLOT( slotInfoMessage( const QString& ) ) );

      static_cast<KBearPart*>( m_partViewer )->setDirLister( m_dirLister );
      manager()->replacePart( this, m_partViewer );
      enableGUI( false );
      m_leftView->hide();
      m_fileView->widget()->hide();
      QVBoxLayout* layout = new QVBoxLayout( m_partViewerWidget );
      layout->addWidget( m_partViewer->widget() );
      m_partViewerWidget->show();

      KBearPart* p = static_cast<KBearPart*>( m_partViewer );
      p->openConnection( c );
      connect( p, SIGNAL( closeMe() ), this, SLOT( showFileView() ) );
}


Generated by  Doxygen 1.6.0   Back to index