[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdegraphics/kviewshell
From:       Stefan Kebekus <kebekus () kde ! org>
Date:       2006-05-26 18:05:47
Message-ID: 1148666747.556895.20540.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 545068 by kebekus:

minor source code cleanup


 D             DESIGN  
 M  +24 -38    shell/kviewpart.cpp  
 M  +0 -2      shell/kviewpart.h  


--- trunk/KDE/kdegraphics/kviewshell/shell/kviewpart.cpp #545067:545068
@@ -195,6 +195,7 @@
       connect(pageView(), SIGNAL(localLink(const QString &)), this, \
                SLOT(handleLocalLink(const QString &)));
       connect(pageView(), SIGNAL(setStatusBarText(const QString&)), this, \
                SIGNAL(setStatusBarText(const QString&)) );
       connect(pageView(), SIGNAL(clearSelection()), this, SLOT(clearSelection()));
+      connect(this, SIGNAL(zoomChanged()), pageView(), \
SLOT(repaintAllVisibleWidgets()));  
       // The next signal is relayed to the DocumentWidgets.
       // TODO: find a better way to do this.
@@ -415,11 +416,7 @@
 
   m_extension = new KViewPartExtension(this);
 
-  initializeMultiPage();
-
-
   checkActions();
-
 }
 
 
@@ -433,33 +430,6 @@
 }
 
 
-void KViewPart::initializeMultiPage()
-{
-  if (multiPage.isNull())
-    return;
-
-  // The new renderer und page cache need to be reconnected
-  if (multiPage->getRenderer() == 0)
-    kError(kvs::shell) << "KViewPart::initializeMultiPage(): \
                multiPage->getRenderer() == 0"  << endl;
-  else
-    connect(multiPage->getRenderer(), SIGNAL(setStatusBarText(const QString&)), \
                this, SIGNAL(setStatusBarText(const QString&)));
-
-  // connect to the multi page view
-  connect(multiPage, SIGNAL(setStatusBarText(const QString& ) ), this, \
                SLOT(setStatusBarTextFromMultiPage(const QString& ) ) );
-  connect(multiPage, SIGNAL(documentHasBeenModified()), this, SLOT(setModified()));
-  connect(multiPage, SIGNAL(renderModeChanged()), this, SLOT(renderModeChanged()));
-
-  pageView()->setMultiPage(multiPage);
-
-  // Initialize documentPageCache.
-  pageCache.setMultiPage(multiPage);
-
-  // allow parts to have a GUI, too :-)
-  // (will be merged automatically)
-  insertChildClient( multiPage );
-}
-
-
 void KViewPart::slotStartFitTimer()
 {
   fitTimer.setSingleShot(true);
@@ -893,24 +863,40 @@
     pageView()->clear();
 
     // Relay signals.
-    connect(multiPage->getRenderer(), SIGNAL(setStatusBarText(const QString&)), \
                this, SIGNAL(setStatusBarText(const QString&)));
-    connect(this, SIGNAL(zoomChanged()), pageView(), \
SLOT(repaintAllVisibleWidgets())); +    connect(multiPage, \
SIGNAL(setStatusBarText(const QString& ) ), this, \
SLOT(setStatusBarTextFromMultiPage(const QString& ) ) ); +    connect(multiPage, \
SIGNAL(documentHasBeenModified()), this, SLOT(setModified())); +    \
connect(multiPage, SIGNAL(renderModeChanged()), this, SLOT(renderModeChanged())); +   \
if (multiPage->getRenderer().isNull()) +      kdError(kvs::shell) << \
"KViewPart::openFile(): multiPage->getRenderer() == 0, cannot connect renderer"  << \
endl; +    else
+      connect(multiPage->getRenderer(), SIGNAL(setStatusBarText(const QString&)), \
this, SIGNAL(setStatusBarText(const QString&)));  
     // Remember the name of the part. So only need to switch if really necessary.
     multiPageLibrary = service->library();
-
+    
     if (oldMultiPage != 0) {
       factory()->removeClient(oldMultiPage);
       delete oldMultiPage;
     }
-
-    initializeMultiPage();
+    
+    pageView()->setMultiPage(multiPage);
+    
+    // Initialize documentPageCache.
+    pageCache.setMultiPage(multiPage);
+    
+    // This makes sure that the GUI of the multipage is switched on and
+    // off whenever the GUI of this part is switched on or off --for
+    // instance, in konqueror when this kviewpart is shown in one TAB,
+    // and the used switches to another tab, both the GUI of this
+    // kviewpart, and the GUI of the multipage must vanish.
+    insertChildClient( multiPage );
+    
     readSettings();
   }
-
+  
   // Set the multipage to the current viewmode.
   slotSetViewMode(viewModeAction->currentItem());
-
+  
   // Load the URL
   pageCache.deselectText();
   dataModel->history()->clear();
--- trunk/KDE/kdegraphics/kviewshell/shell/kviewpart.h #545067:545068
@@ -204,8 +204,6 @@
   // If set to false the search is interrupted.
   bool searchInProgress;
 
-  void initializeMultiPage();
-
   // This method reads the configuration file. It should only be
   // called when no document is loaded.
   void readSettings();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic