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

List:       kde-commits
Subject:    branches/work/kde4/kdegraphics/kpdf
From:       Albert Astals Cid <tsdgeos () terra ! es>
Date:       2005-06-06 21:08:57
Message-ID: 1118092137.686183.13921.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 422910 by aacid:

Fordward port fix for 106771


 M  +15 -3     part.cpp  
 M  +4 -0      part.h  


--- branches/work/kde4/kdegraphics/kpdf/part.cpp #422909:422910
@@ -80,13 +80,13 @@
            QObject *parent, const char *name,
            const QStringList & /*args*/ )
 	: DCOPObject("kpdf"), KParts::ReadOnlyPart(parent, name), m_showMenuBarAction(0), \
                m_showFullScreenAction(0),
-	m_actionsSearched(false), m_searchStarted(false)
+	m_actionsSearched(false), m_searchStarted(false), m_notifyOpening(false)
 {
 	// load catalog for translation
 	KGlobal::locale()->insertCatalogue("kpdf");
 
 	// create browser extension (for printing when embedded into browser)
-	new BrowserExtension(this);
+	m_bExtension = new BrowserExtension(this);
 
 	// xpdf 'extern' global class (m_count is a static instance counter)
 	//if ( m_count ) TODO check if we need to insert these lines..
@@ -102,7 +102,7 @@
 	m_document = new KPDFDocument();
 	connect( m_document, SIGNAL( linkFind() ), this, SLOT( slotFind() ) );
 	connect( m_document, SIGNAL( linkGoToPage() ), this, SLOT( slotGoToPage() ) );
-	connect( m_document, SIGNAL( openURL(const KURL &) ), this, SLOT( openURL(const \
KURL &) ) ); +	connect( m_document, SIGNAL( openURL(const KURL &) ), this, SLOT( \
openURLFromDocument(const KURL &) ) );  
 	// widgets: ^searchbar (toolbar containing label and SearchWidget)
 //	m_searchToolBar = new KToolBar( parentWidget, "searchBar" );
@@ -371,6 +371,12 @@
     return true;
 }
 
+void Part::openURLFromDocument(const KURL &url)
+{
+    m_notifyOpening = true;
+    openURL(url);
+}
+
 bool Part::openURL(const KURL &url)
 {
     // note: this can be the right place to check the file for gz or bz2 extension
@@ -379,6 +385,12 @@
 
     // this calls the above 'openURL' method
     bool b = KParts::ReadOnlyPart::openURL(url);
+    if (m_notifyOpening)
+    {
+        m_bExtension->openURLNotify();
+        m_bExtension->setLocationBarURL(url.prettyURL());
+        m_notifyOpening = false;
+    }
     if ( !b )
         KMessageBox::error( widget(), i18n("Could not open %1").arg( url.prettyURL() \
) );  else
--- branches/work/kde4/kdegraphics/kpdf/part.h #422909:422910
@@ -106,6 +106,8 @@
 	// can be connected to widget elements
 	void updateViewActions();
 	void enableTOC(bool enable);
+	
+	void openURLFromDocument(const KURL &url);
 
 public slots:
 	// connected to Shell action (and browserExtension), not local one
@@ -156,6 +158,8 @@
 	KToggleAction* m_showFullScreenAction;
 	bool m_actionsSearched;
 	bool m_searchStarted;
+	BrowserExtension *m_bExtension;
+	bool m_notifyOpening;
 };
 
 


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

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