~ubuntu-branches/debian/sid/kde-baseapps/sid

« back to all changes in this revision

Viewing changes to konqueror/src/konqviewmanager.cpp

  • Committer: Package Import Robot
  • Author(s): Modestas Vainius, Eshat Cakar, Pino Toscano
  • Date: 2012-06-09 22:18:08 UTC
  • mfrom: (4.2.1) (6.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20120609221808-h1l0ekd5qmb8nefr
Tags: 4:4.8.4-1
* New upstream release.

[ Eshat Cakar ]
* Add watch file.
* Bump kde-sc-dev-latest build dependency to version 4:4.8.4.
* Update installed files.

[ Pino Toscano ]
* Move files of the konqueror documentation from kde-baseapps-data to
  konqueror itself.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
*/
20
20
 
21
21
#include "konqviewmanager.h"
 
22
 
22
23
#include "konqcloseditem.h"
23
24
#include "konqundomanager.h"
 
25
#include "konqmisc.h"
 
26
#include "konqview.h"
 
27
#include "konqframestatusbar.h"
 
28
#include "konqtabs.h"
 
29
#include "konqprofiledlg.h"
 
30
#include "konqsettingsxt.h"
 
31
#include "konqframevisitor.h"
 
32
#include <konq_events.h>
24
33
 
25
34
#include <QtCore/QFileInfo>
26
35
#include <QtDBus/QDBusMessage>
37
46
#include <klocale.h>
38
47
#include <kmessagebox.h>
39
48
#include <ktoolbarpopupaction.h>
40
 
 
41
49
#include <kmenu.h>
42
50
 
43
 
#include <assert.h>
44
 
 
45
 
#include "konqmisc.h"
46
 
 
47
 
#include "konqview.h"
48
 
#include "konqframestatusbar.h"
49
 
#include "konqtabs.h"
50
 
#include "konqprofiledlg.h"
51
 
#include <konq_events.h>
52
 
#include "konqsettingsxt.h"
53
 
#include "konqframevisitor.h"
54
 
 
55
51
//#define DEBUG_VIEWMGR
56
52
 
57
53
KonqViewManager::KonqViewManager( KonqMainWindow *mainWindow )
64
60
  m_bLoadingProfile = false;
65
61
  m_tabContainer = 0;
66
62
 
67
 
  connect( this, SIGNAL( activePartChanged ( KParts::Part * ) ),
68
 
           this, SLOT( slotActivePartChanged ( KParts::Part * ) ) );
 
63
  connect( this, SIGNAL(activePartChanged(KParts::Part*)),
 
64
           this, SLOT(slotActivePartChanged(KParts::Part*)) );
69
65
}
70
66
 
71
67
KonqView* KonqViewManager::createFirstView( const QString &mimeType, const QString &serviceName )
114
110
  if( newViewFactory.isNull() )
115
111
    return 0; //do not split at all if we can't create the new view
116
112
 
117
 
  assert( splitFrame );
 
113
  Q_ASSERT( splitFrame );
118
114
 
119
115
  KonqFrameContainerBase* parentContainer = splitFrame->parentContainer();
120
116
 
152
148
    parentKonqFrameContainer->setSizes( parentSplitterSizes );
153
149
  }
154
150
 
155
 
  assert( newView->frame() );
156
 
  assert( newView->part() );
 
151
  Q_ASSERT( newView->frame() );
 
152
  Q_ASSERT( newView->part() );
157
153
  newContainer->setActiveChild( newView->frame() );
158
154
  setActivePart( newView->part() );
159
155
 
674
670
  // Passive mode parts aren't registered to the part manager,
675
671
  // so we have to handle suicidal ones ourselves
676
672
  KParts::ReadOnlyPart * part = const_cast<KParts::ReadOnlyPart *>( static_cast<const KParts::ReadOnlyPart *>( sender() ) );
677
 
  disconnect( part, SIGNAL( destroyed() ), this, SLOT( slotPassiveModePartDeleted() ) );
 
673
  disconnect( part, SIGNAL(destroyed()), this, SLOT(slotPassiveModePartDeleted()) );
678
674
  kDebug() << "part=" << part;
679
675
  KonqView * view = m_pMainWindow->childView( part );
680
676
  kDebug() << "view=" << view;
840
836
                              m_pMainWindow, service, partServiceOffers, appServiceOffers, sType, passiveMode );
841
837
  //kDebug() << "KonqView created - v=" << v << "v->part()=" << v->part();
842
838
 
843
 
  QObject::connect( v, SIGNAL( sigPartChanged( KonqView *, KParts::ReadOnlyPart *, KParts::ReadOnlyPart * ) ),
844
 
                    m_pMainWindow, SLOT( slotPartChanged( KonqView *, KParts::ReadOnlyPart *, KParts::ReadOnlyPart * ) ) );
 
839
  QObject::connect( v, SIGNAL(sigPartChanged(KonqView*,KParts::ReadOnlyPart*,KParts::ReadOnlyPart*)),
 
840
                    m_pMainWindow, SLOT(slotPartChanged(KonqView*,KParts::ReadOnlyPart*,KParts::ReadOnlyPart*)) );
845
841
 
846
842
  m_pMainWindow->insertChildView( v );
847
843
 
864
860
  else
865
861
  {
866
862
    // Passive views aren't registered, but we still want to detect the suicidal ones
867
 
    connect( v->part(), SIGNAL( destroyed() ), this, SLOT( slotPassiveModePartDeleted() ) );
 
863
    connect( v->part(), SIGNAL(destroyed()), this, SLOT(slotPassiveModePartDeleted()) );
868
864
  }
869
865
 
870
866
  if (!m_bLoadingProfile)
1371
1367
void KonqViewManager::setProfiles( KActionMenu *profiles )
1372
1368
{
1373
1369
    m_pamProfiles = profiles;
1374
 
    connect(m_pamProfiles->menu(), SIGNAL(triggered(QAction *)),
1375
 
            this, SLOT(slotProfileActivated(QAction *)));
 
1370
    connect(m_pamProfiles->menu(), SIGNAL(triggered(QAction*)),
 
1371
            this, SLOT(slotProfileActivated(QAction*)));
1376
1372
    connect(m_pamProfiles->menu(), SIGNAL(aboutToShow()),
1377
1373
            this, SLOT(slotProfileListAboutToShow()));
1378
1374
    //KonqMainWindow::enableAllActions will call it anyway
1611
1607
#endif
1612
1608
    m_tabContainer = new KonqFrameTabs( parent, parentContainer, this );
1613
1609
    // Delay the opening of the URL for #106641
1614
 
    bool ok = connect( m_tabContainer, SIGNAL(openUrl(KonqView*, KUrl)), m_pMainWindow, SLOT(openUrl(KonqView*, KUrl)), Qt::QueuedConnection);
 
1610
    bool ok = connect( m_tabContainer, SIGNAL(openUrl(KonqView*,KUrl)), m_pMainWindow, SLOT(openUrl(KonqView*,KUrl)), Qt::QueuedConnection);
1615
1611
    Q_ASSERT(ok);
1616
1612
    Q_UNUSED(ok);
1617
1613
    applyConfiguration();
1620
1616
void KonqViewManager::applyConfiguration()
1621
1617
{
1622
1618
    tabContainer()->setAlwaysTabbedMode( KonqSettings::alwaysTabbedMode() );
 
1619
    tabContainer()->setTabsClosable( KonqSettings::permanentCloseButton() );
1623
1620
}
1624
1621
 
1625
1622
KonqMainWindow* KonqViewManager::duplicateWindow()