~ubuntu-branches/ubuntu/intrepid/kdebase/intrepid-backports

« back to all changes in this revision

Viewing changes to apps/konqueror/src/konqviewmanager.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Steve Stalcup
  • Date: 2008-08-28 19:32:12 UTC
  • mfrom: (1.1.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20080828193212-ewf4jahol0qqghhg
Tags: 4:4.1.1-0ubuntu1
* New upstream release
* Removed obsolete debian/cdbs dir

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
  m_pamProfiles = 0L;
63
63
  m_bProfileListDirty = true;
64
64
  m_bLoadingProfile = false;
65
 
 
66
 
  m_activePartChangedTimer = new QTimer(this);
67
 
  m_activePartChangedTimer->setSingleShot(true);
68
 
 
69
65
  m_tabContainer = 0;
70
66
 
71
 
  connect(m_activePartChangedTimer, SIGNAL(timeout()), this, SLOT( emitActivePartChanged()));
72
67
  connect( this, SIGNAL( activePartChanged ( KParts::Part * ) ),
73
68
           this, SLOT( slotActivePartChanged ( KParts::Part * ) ) );
74
69
}
301
296
 
302
297
  KTemporaryFile tempFile;
303
298
  tempFile.open();
304
 
  KConfig config( tempFile.fileName() );
305
 
  KConfigGroup profileGroup( &config, "Profile" );
 
299
  KSharedConfigPtr config = KSharedConfig::openConfig( tempFile.fileName() );
 
300
  KConfigGroup profileGroup( config, "Profile" );
306
301
 
307
302
  QString prefix = QString::fromLatin1( currentFrame->frameType() ) + QString::number(0);
308
303
  profileGroup.writeEntry( "RootItem", prefix );
312
307
 
313
308
  KonqMainWindow *mainWindow = new KonqMainWindow(KUrl(), m_pMainWindow->xmlFile());
314
309
 
315
 
  mainWindow->viewManager()->loadViewProfileFromGroup( profileGroup, QString() );
 
310
  mainWindow->viewManager()->loadViewProfileFromConfig( config, QString(), currentProfile() );
316
311
 
317
312
  KonqFrameTabs * kft = mainWindow->viewManager()->tabContainer();
318
313
  KonqFrameBase *newFrame = dynamic_cast<KonqFrameBase*>(kft->currentWidget());
357
352
        // Window size comes from the applyMainWindowSettings call below
358
353
    }
359
354
 
360
 
    mainWindow->viewManager()->loadRootItem( configGroup, mainWindow->viewManager()->tabContainer(), KUrl(), true, KUrl() );
 
355
    mainWindow->viewManager()->loadRootItem( configGroup, mainWindow, KUrl(), true, KUrl() );
361
356
    mainWindow->applyMainWindowSettings( configGroup, true );
362
357
    mainWindow->activateChild();
363
358
    kDebug(1202) << "done";
417
412
 
418
413
void KonqViewManager::removeOtherTabs( KonqFrameBase* currentFrame )
419
414
{
 
415
  Q_ASSERT(currentFrame);
 
416
 
 
417
  // currentFrame might be a frame contained inside a splitted frame so what we'll
 
418
  // do here is just compare if the frames are inside the same tab.
 
419
  currentFrame = m_tabContainer->tabContaining(currentFrame);
420
420
  foreach ( KonqFrameBase* frame, m_tabContainer->childFrameList() )
421
421
  {
422
 
    if ( frame && frame != currentFrame )
 
422
    if ( frame && m_tabContainer->tabContaining(frame) != currentFrame )
423
423
      removeTab(frame);
424
424
  }
425
425
 
961
961
    //if ( part )
962
962
    //    kDebug(1202) << part->metaObject()->className() << part->name();
963
963
 
964
 
    // Due to the single-shot timer below, we need to also make sure that
965
 
    // the mainwindow also has the right part active already
966
964
    KParts::Part* mainWindowActivePart = m_pMainWindow->currentView()
967
965
                                         ? m_pMainWindow->currentView()->part() : 0;
968
966
    if (part == activePart() && (!immediate || mainWindowActivePart == part))
993
991
    if (part && part->widget())
994
992
        part->widget()->setFocus();
995
993
 
996
 
    if (!immediate && reason() != ReasonRightClick) {
997
 
        // We use a 0s single shot timer so that when left-clicking on a part,
998
 
        // we process the mouse event before rebuilding the GUI.
999
 
        // Otherwise, when e.g. dragging icons, the mouse pointer can already
1000
 
        // be very far from where it was...
1001
 
        // TODO: use a QTimer member var, so that if two conflicting calls to
1002
 
        // setActivePart(part,immediate=false) happen, the 1st one gets canceled.
1003
 
        m_activePartChangedTimer->start( 0 );
1004
 
        // This is not done with right-clicking so that the part is activated before the
1005
 
        // popup appears (#75201)
1006
 
    } else {
1007
 
        m_activePartChangedTimer->stop();
1008
 
        emitActivePartChanged();
1009
 
    }
 
994
    emitActivePartChanged();
1010
995
}
1011
996
 
1012
997
void KonqViewManager::slotActivePartChanged ( KParts::Part *newPart )