From kfm-devel Sun Jan 04 17:45:22 2004 From: Alexander Neundorf Date: Sun, 04 Jan 2004 17:45:22 +0000 To: kfm-devel Subject: Re: [PATCH] support selecting xmlui file in konqy profile Message-Id: <200401041845.22097.neundorf () kde ! org> X-MARC-Message: https://marc.info/?l=kfm-devel&m=107323844008240 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_yEF+/5w04zFi3nR" --Boundary-00=_yEF+/5w04zFi3nR Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline You wrote: ... > But why should it go in now, if we don't have separate ui.rc files for > various profiles until the next release anyway? Or do you expect people to > write their own? Well, maybe not users, but distributions. E.g. the discussions on UserLinux tend to prefer the simpler browsers, and AFAIK mozilla is now also developping a simpler browser as the main user browser. We can do it without coding at all :-) Could a simpler xmlui-file also be added to the stable branch, e.g. between 3.2.0 and 3.2.1 ? After all, it doesn't change code and it doesn't have to change strings. I think creating two specialized xmlui files for file managing/webbrowsing could even still be done for 3.2.0. I guess adding the patch (it's a feature) between 3.2.0 and 3.2.1 is completely out of discussion. Modified patch attached. 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=_yEF+/5w04zFi3nR Content-Type: text/x-c++src; charset="us-ascii"; name="konq_xmlui_in_profile.patch-2.cpp" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="konq_xmlui_in_profile.patch-2.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 17:42:19 -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,8 @@ 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 + setXMLFile( xmluiFile ); setStandardToolBarMenuEnabled( true ); @@ -1202,7 +1203,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, 0, xmlFile()); 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 17:42:19 -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(); /** 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 17:42:19 -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, 0, 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=_yEF+/5w04zFi3nR--