Sophie

Sophie

distrib > Mandriva > 2006.0 > i586 > media > main-src > by-pkgid > a6bc312ce50b5c8d0c51736e58ac32bc > files > 353

kdebase-3.4.2-55mdk.src.rpm

--- konqueror/about/konq_aboutpage.h--	2005-04-11 12:37:48.752170482 -0400
+++ konqueror/about/konq_aboutpage.h	2005-04-11 12:46:26.782478818 -0400
@@ -24,12 +24,12 @@ public:
     static QString specs();
     static QString tips();
     static QString plugins();
-
+	static QString mandrake();
 private:
-    static QString loadFile( const QString& file );
+    static QString loadFile( const QString& file, bool utf=false );
 
     static KInstance *s_instance;
-    static QString *s_launch_html, *s_intro_html, *s_specs_html, *s_tips_html, *s_plugins_html;
+    static QString *s_launch_html, *s_intro_html, *s_specs_html, *s_tips_html, *s_plugins_html,*s_plugins_mandrake;
 };
 
 class KonqAboutPage : public KHTMLPart
--- konqueror/about/konq_aboutpage.cc--	2005-04-11 12:42:46.028982004 -0400
+++ konqueror/about/konq_aboutpage.cc	2005-04-11 12:47:32.349215489 -0400
@@ -24,6 +24,7 @@ QString *KonqAboutPageFactory::s_intro_h
 QString *KonqAboutPageFactory::s_specs_html = 0;
 QString *KonqAboutPageFactory::s_tips_html = 0;
 QString *KonqAboutPageFactory::s_plugins_html = 0;
+QString *KonqAboutPageFactory::s_plugins_mandrake = 0;
 
 KonqAboutPageFactory::KonqAboutPageFactory( QObject *parent, const char *name )
     : KParts::Factory( parent, name )
@@ -45,6 +46,8 @@ KonqAboutPageFactory::~KonqAboutPageFact
     s_tips_html = 0;
     delete s_plugins_html;
     s_plugins_html = 0;
+	delete s_plugins_mandrake;
+	s_plugins_mandrake = 0;
 }
 
 KParts::Part *KonqAboutPageFactory::createPartObject( QWidget *parentWidget, const char *widgetName,
@@ -58,7 +61,7 @@ KParts::Part *KonqAboutPageFactory::crea
                               parentWidget, widgetName, parent, name );
 }
 
-QString KonqAboutPageFactory::loadFile( const QString& file )
+QString KonqAboutPageFactory::loadFile( const QString& file, bool utf )
 {
     QString res;
     if ( file.isEmpty() )
@@ -70,7 +73,10 @@ QString KonqAboutPageFactory::loadFile( 
 	return res;
 
     QTextStream t( &f );
-
+	if(utf)
+		t.setEncoding(QTextStream::UnicodeUTF8);
+	
+	
     res = t.read();
 
     // otherwise all embedded objects are referenced as about:/...
@@ -154,6 +160,20 @@ QString KonqAboutPageFactory::launch()
   return res;
 }
 
+QString KonqAboutPageFactory::mandrake()
+{
+  if ( s_plugins_mandrake )
+        return *s_plugins_mandrake;
+
+  QString res = loadFile( "/usr/share/doc/HTML/index.html",true );
+  if ( res.isEmpty() )
+    return res;
+  s_plugins_mandrake = new QString( res );
+
+  return res;
+}
+
+
 QString KonqAboutPageFactory::intro()
 {
     if ( s_intro_html )
@@ -424,6 +444,8 @@ bool KonqAboutPage::openURL( const KURL 
 {
     if (u.url() == "about:plugins")
        serve( KonqAboutPageFactory::plugins(), "plugins" );
+    else if (u.url() == "about:mandrakelinux")
+       serve( KonqAboutPageFactory::mandrake(), "mandrakelinux" );	
     else serve( KonqAboutPageFactory::launch(), "konqueror" );
     return true;
 }
@@ -479,6 +501,12 @@ void KonqAboutPage::urlSelected( const Q
         serve( KonqAboutPageFactory::intro(), "konqueror" );
         return;
     }
+    else if ( url == QString::fromLatin1("index.html") )
+    {
+        emit browserExtension()->openURLNotify();
+   serve( KonqAboutPageFactory::mandrake(), "mandrakelinux" );
+        return;
+    }
     else if ( url == QString::fromLatin1("specs.html") )
     {
         emit browserExtension()->openURLNotify();
--- konqueror/konq_mainwindow.cc--	2005-04-11 12:36:06.775030972 -0400
+++ konqueror/konq_mainwindow.cc	2005-04-11 12:37:08.323163123 -0400
@@ -558,7 +558,7 @@ void KonqMainWindow::openURL( KonqView *
 
   kdDebug(1202) << "trying openView for " << url << " (serviceType " << serviceType << ")" << endl;
   if ( ( !serviceType.isEmpty() && serviceType != "application/octet-stream") ||
-         url.url() == "about:konqueror" || url.url() == "about:plugins" )
+         url.url() == "about:konqueror" || url.url() == "about:plugins" || url.url() == "about:mandrakelinux")
   {
     KService::Ptr offer = KServiceTypeProfile::preferredService(serviceType, "Application");
     // If the associated app is konqueror itself, then make sure we try to embed before bailing out.
@@ -727,7 +727,7 @@ bool KonqMainWindow::openView( QString s
 
   QString serviceName; // default: none provided
 
-  if ( url.url() == "about:konqueror" || url.url() == "about:plugins" )
+  if ( url.url() == "about:konqueror" || url.url() == "about:plugins" || url.url() == "about:mandrakelinux")
   {
       serviceType = "KonqAboutPage"; // not KParts/ReadOnlyPart, it fills the Location menu ! :)
       serviceName = "konq_aboutpage";
--- konqueror/konq_misc.cc--	2005-04-11 12:37:16.142554325 -0400
+++ konqueror/konq_misc.cc	2005-04-11 12:37:42.307853009 -0400
@@ -215,6 +215,8 @@ QString KonqMisc::konqFilteredURL( QWidg
     // We can't use "about:" as it is, KURL doesn't parse it.
     if (_url == "about:plugins")
        return "about:plugins";
+    else if (_url == "about:mandrakelinux")
+       return "about:mandrakelinux";
     return "about:konqueror";
   }
   return _url;  // return the original url if it cannot be filtered.