From kfm-devel Sun Jan 04 16:52:56 2004 From: Alexander Neundorf Date: Sun, 04 Jan 2004 16:52:56 +0000 To: kfm-devel Subject: [PATCH] support selecting xmlui file in konqy profile Message-Id: <200401041752.56122.neundorf () kde ! org> X-MARC-Message: https://marc.info/?l=kfm-devel&m=107323521905572 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_oTE+/gAb71j33WT" --Boundary-00=_oTE+/gAb71j33WT Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, attached is a patch for konqy which adds the ability to specify the xmlui file in the profile file. This would make it possible to use a simpler xmlui-file for the browser profile and a file management-specialized xmlui-file for the (guess what) file management profile. I think this might be a big step for KDE, since many people claim that "simple" webbrowsers are better suited for many users, and with this patch we can provide konqy also as a simple webbrowser. In order to do this, An entry like the following has to be added to the profile file: [Profile] XMLUIFile=konqweb.rc This entry is only evaluated when the browser is started with the profile. Loading another profile with another xmlui file keeps the original xmlui file. Ctrl-D and stuff works like exptected (IMO). I know it's quite late for 3.2, but it doesn't introduce new strings, and if somebody reviews it, I think it should be more or less bug-safe. Finally, if the new keyword in the profile isn't used, there should be no difference at all. Bye Alex -- Work: alexander.neundorf@jenoptik.com - http://www.jenoptik-los.de Home: neundorf@kde.org - http://www.kde.org alex@neundorf.net - http://www.neundorf.net --Boundary-00=_oTE+/gAb71j33WT Content-Type: text/x-c++src; charset="us-ascii"; name="konq_xmlui_in_profile.patch.cpp" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="konq_xmlui_in_profile.patch.cpp" ? konqueror/kfmexec/Makefile ? konqueror/kfmexec/Makefile.in ? konqueror/kfmexec/kfmexec Index: konqueror/konq_mainwindow.cc =================================================================== RCS file: /home/kde/kdebase/konqueror/konq_mainwindow.cc,v retrieving revision 1.1272 diff -b -u -p -r1.1272 konq_mainwindow.cc --- konqueror/konq_mainwindow.cc 3 Jan 2004 22:35:17 -0000 1.1272 +++ konqueror/konq_mainwindow.cc 4 Jan 2004 16:43:22 -0000 @@ -134,7 +134,7 @@ KonqExtendedBookmarkOwner::KonqExtendedB m_pKonqMainWindow = w; } -KonqMainWindow::KonqMainWindow( const KURL &initialURL, bool openInitialURL, const char *name ) +KonqMainWindow::KonqMainWindow( const KURL &initialURL, bool openInitialURL, const char *name, const QString& xmluiFile) : KParts::MainWindow( NoDCOPObject, 0L, name, WDestructiveClose | WStyle_ContextHelp ) { setPreloadedFlag( false ); @@ -217,7 +217,9 @@ KonqMainWindow::KonqMainWindow( const KU connect( kapp, SIGNAL( kdisplayFontChanged()), SLOT(slotReconfigure())); - setXMLFile( "konqueror.rc" ); + //load the xmlui file specified in the profile or the default konqueror.rc + m_xmluiFile=xmluiFile; + setXMLFile( m_xmluiFile ); setStandardToolBarMenuEnabled( true ); @@ -1202,7 +1204,7 @@ void KonqMainWindow::slotDuplicateWindow config.setGroup( "View Profile" ); m_pViewManager->saveViewProfile( config, true, true ); - KonqMainWindow *mainWindow = new KonqMainWindow( KURL(), false ); + KonqMainWindow *mainWindow = new KonqMainWindow( KURL(), false, "Konqueror", m_xmluiFile ); mainWindow->viewManager()->loadViewProfile( config, m_pViewManager->currentProfile() ); if (mainWindow->currentView()) { Index: konqueror/konq_mainwindow.h =================================================================== RCS file: /home/kde/kdebase/konqueror/konq_mainwindow.h,v retrieving revision 1.422 diff -b -u -p -r1.422 konq_mainwindow.h --- konqueror/konq_mainwindow.h 11 Dec 2003 17:53:19 -0000 1.422 +++ konqueror/konq_mainwindow.h 4 Jan 2004 16:43:22 -0000 @@ -95,7 +95,7 @@ class KonqMainWindow : public KParts::Ma public: enum ComboAction { ComboClear, ComboAdd, ComboRemove }; - KonqMainWindow( const KURL &initialURL = KURL(), bool openInitialURL = true, const char *name = 0 ); + KonqMainWindow( const KURL &initialURL = KURL(), bool openInitialURL = true, const char *name = 0, const QString& xmluiFile="konqueror.rc"); ~KonqMainWindow(); /** @@ -707,6 +707,7 @@ private: static time_t s_startupTime; static int s_preloadUsageCount; + QString m_xmluiFile; public: static QFile *s_crashlog_file; Index: konqueror/konq_misc.cc =================================================================== RCS file: /home/kde/kdebase/konqueror/konq_misc.cc,v retrieving revision 1.54 diff -b -u -p -r1.54 konq_misc.cc --- konqueror/konq_misc.cc 21 Dec 2003 09:59:23 -0000 1.54 +++ konqueror/konq_misc.cc 4 Jan 2004 16:43:22 -0000 @@ -135,13 +135,18 @@ KonqMainWindow * KonqMisc::createBrowser } else { - mainWindow = new KonqMainWindow( KURL(), false ); + KConfig cfg( path, true ); + cfg.setDollarExpansion( true ); + cfg.setGroup( "Profile" ); + QString xmluiFile=cfg.readEntry("XMLUIFile","konqueror.rc"); + + mainWindow = new KonqMainWindow( KURL(), false, "Konqueror", xmluiFile ); if ( forbidUseHTML ) mainWindow->setShowHTML( false ); //FIXME: obey args (like passing post-data (to KRun), etc.) KonqOpenURLRequest req; req.args = args; - mainWindow->viewManager()->loadViewProfile( path, filename, url, req ); + mainWindow->viewManager()->loadViewProfile( cfg, filename, url, req ); } mainWindow->setInitialFrameName( args.frameName ); mainWindow->show(); --Boundary-00=_oTE+/gAb71j33WT--