Commit 85b72cd7 authored by Aaron J. Seigo's avatar Aaron J. Seigo
Browse files

to wake up and then occupy myself during the art meeting, i got rid of various...

to wake up and then occupy myself during the art meeting, i got rid of various warnings related to not using dbus and using the old kconfig api.

interestingly: it appears one place in the code was using the [View Profile] group while everywhere else was using [Profile]?

svn path=/trunk/KDE/kdebase/konqueror/; revision=637825
parent b827ccae
......@@ -56,7 +56,7 @@ set(konqueror_KDEINIT_SRCS ${libkonqueror_intern_SRCS}
)
kde4_automoc(${konqueror_KDEINIT_SRCS})
QT4_ADD_DBUS_INTERFACE(konqueror_KDEINIT_SRCS org.kde.Konqueror.Main.xml konqueror_interface)
kde4_add_kdeinit_executable( konqueror ${konqueror_KDEINIT_SRCS})
......
......@@ -26,6 +26,7 @@
#include <QMouseEvent>
#include <kapplication.h>
#include <kconfig.h>
#include <kconfiggroup.h>
#include <kcompletionbox.h>
#include <kdebug.h>
#include <kiconloader.h>
......@@ -38,7 +39,8 @@
#include "konq_view.h"
#include "konq_combo.h"
#include <kconfiggroup.h>
#include "KonquerorAdaptor.h"
#include "konqueror_interface.h"
KConfig * KonqCombo::s_config = 0L;
const int KonqCombo::temporary = 0;
......@@ -153,17 +155,10 @@ void KonqCombo::setURL( const QString& url )
if ( m_returnPressed ) { // Really insert...
m_returnPressed = false;
#ifdef __GNUC__
#warning port to DBUS signal addToCombo
#endif
#if 0
QByteArray data;
QDataStream s( &data, QIODevice::WriteOnly );
s.setVersion(QDataStream::Qt_3_1);
s << url << kapp->dcopClient()->defaultObject();
kapp->dcopClient()->send( "konqueror*", "KonquerorIface",
"addToCombo(QString,QCString)", data);
#endif
org::kde::Konqueror::Main dbus( "org.kde.konqueror",
KONQ_MAIN_PATH,
QDBusConnection::sessionBus() );
dbus.addToCombo( url );
}
}
......@@ -255,6 +250,8 @@ void KonqCombo::insertItem( const QPixmap &pixmap, const QString& text, int inde
void KonqCombo::updateItem( const QPixmap& pix, const QString& t, int index, const QString& title )
{
Q_UNUSED( title )
// No need to flicker
if (itemText( index ) == t &&
(!pixmap(index).isNull() && pixmap(index).serialNumber() == pix.serialNumber()))
......@@ -517,16 +514,10 @@ void KonqCombo::selectWord(QKeyEvent *e)
void KonqCombo::slotCleared()
{
#ifdef __GNUC__
#warning port to DBUS signal comboCleared
#endif
#if 0
QByteArray data;
QDataStream s( &data, QIODevice::WriteOnly );
s.setVersion(QDataStream::Qt_3_1);
s << kapp->dcopClient()->defaultObject();
kapp->dcopClient()->send( "konqueror*", "KonquerorIface", "comboCleared(QCString)", data);
#endif
org::kde::Konqueror::Main dbus( "org.kde.konqueror",
KONQ_MAIN_PATH,
QDBusConnection::sessionBus() );
dbus.comboCleared( );
}
void KonqCombo::removeURL( const QString& url )
......
......@@ -72,9 +72,15 @@ KParts::ReadOnlyPart *KonqViewFactory::create( QWidget *parentWidget, QObject *
obj = m_factory->create( parentWidget, "KParts::ReadOnlyPart", m_args );
}
if ( !obj->inherits( "KParts::ReadOnlyPart" ) )
kError(1202) << "Part " << obj << " (" << obj->metaObject()->className() << ") doesn't inherit KParts::ReadOnlyPart !" << endl;
if ( !obj->inherits( "KParts::ReadOnlyPart" ) ) {
kError(1202) << "Part " << obj << " (" << obj->metaObject()->className() << ") doesn't inherit KParts::ReadOnlyPart !" << endl;
} else {
KParts::ReadOnlyPart* part = static_cast<KParts::ReadOnlyPart *>( obj );
QFrame* frame = qobject_cast<QFrame*>( part->widget() );
if ( frame ) {
frame->setFrameStyle( QFrame::NoFrame );
}
}
return static_cast<KParts::ReadOnlyPart *>(obj);
}
......
......@@ -324,21 +324,21 @@ void KonqFrame::listViews( ChildViewList *viewList )
viewList->append( childView() );
}
void KonqFrame::saveConfig( KConfig* config, const QString &prefix, bool saveURLs, KonqFrameBase* docContainer, int /*id*/, int /*depth*/ )
void KonqFrame::saveConfig( KConfigGroup& config, const QString &prefix, bool saveURLs, KonqFrameBase* docContainer, int /*id*/, int /*depth*/ )
{
if (saveURLs)
config->writePathEntry( QString::fromLatin1( "URL" ).prepend( prefix ),
config.writePathEntry( QString::fromLatin1( "URL" ).prepend( prefix ),
childView()->url().url() );
config->writeEntry( QString::fromLatin1( "ServiceType" ).prepend( prefix ), childView()->serviceType() );
config->writeEntry( QString::fromLatin1( "ServiceName" ).prepend( prefix ), childView()->service()->desktopEntryName() );
config->writeEntry( QString::fromLatin1( "PassiveMode" ).prepend( prefix ), childView()->isPassiveMode() );
config->writeEntry( QString::fromLatin1( "LinkedView" ).prepend( prefix ), childView()->isLinkedView() );
config->writeEntry( QString::fromLatin1( "ToggleView" ).prepend( prefix ), childView()->isToggleView() );
config->writeEntry( QString::fromLatin1( "LockedLocation" ).prepend( prefix ), childView()->isLockedLocation() );
//config->writeEntry( QString::fromLatin1( "ShowStatusBar" ).prepend( prefix ), statusbar()->isVisible() );
if (this == docContainer) config->writeEntry( QString::fromLatin1( "docContainer" ).prepend( prefix ), true );
KonqConfigEvent ev( config, prefix+"_", true/*save*/);
config.writeEntry( QString::fromLatin1( "ServiceType" ).prepend( prefix ), childView()->serviceType() );
config.writeEntry( QString::fromLatin1( "ServiceName" ).prepend( prefix ), childView()->service()->desktopEntryName() );
config.writeEntry( QString::fromLatin1( "PassiveMode" ).prepend( prefix ), childView()->isPassiveMode() );
config.writeEntry( QString::fromLatin1( "LinkedView" ).prepend( prefix ), childView()->isLinkedView() );
config.writeEntry( QString::fromLatin1( "ToggleView" ).prepend( prefix ), childView()->isToggleView() );
config.writeEntry( QString::fromLatin1( "LockedLocation" ).prepend( prefix ), childView()->isLockedLocation() );
//config.writeEntry( QString::fromLatin1( "ShowStatusBar" ).prepend( prefix ), statusbar()->isVisible() );
if (this == docContainer) config.writeEntry( QString::fromLatin1( "docContainer" ).prepend( prefix ), true );
KonqConfigEvent ev( config.config(), prefix+"_", true/*save*/);
QApplication::sendEvent( childView()->part(), &ev );
}
......
......@@ -34,8 +34,9 @@
#include <QResizeEvent>
#include <QMouseEvent>
#include <kpixmapeffect.h>
#include <kstatusbar.h>
#include <KConfig>
#include <KPixmapEffect>
#include <KStatusBar>
class QPixmap;
class QVBoxLayout;
......@@ -159,7 +160,7 @@ class KonqFrameBase
public:
virtual ~KonqFrameBase() {}
virtual void saveConfig( KConfig* config, const QString &prefix, bool saveURLs, KonqFrameBase* docContainer, int id = 0, int depth = 0) = 0;
virtual void saveConfig( KConfigGroup& config, const QString &prefix, bool saveURLs, KonqFrameBase* docContainer, int id = 0, int depth = 0) = 0;
virtual void copyHistory( KonqFrameBase *other ) = 0;
......@@ -246,7 +247,7 @@ public:
void setView( KonqView* child );
virtual void listViews( ChildViewList *viewList );
virtual void saveConfig( KConfig* config, const QString &prefix, bool saveURLs, KonqFrameBase* docContainer, int id = 0, int depth = 0 );
virtual void saveConfig( KConfigGroup& config, const QString &prefix, bool saveURLs, KonqFrameBase* docContainer, int id = 0, int depth = 0 );
virtual void copyHistory( KonqFrameBase *other );
virtual void printFrameInfo( const QString& spaces );
......
......@@ -61,12 +61,12 @@ void KonqFrameContainer::listViews( ChildViewList *viewList )
m_pSecondChild->listViews( viewList );
}
void KonqFrameContainer::saveConfig( KConfig* config, const QString &prefix, bool saveURLs, KonqFrameBase* docContainer, int id, int depth )
void KonqFrameContainer::saveConfig( KConfigGroup& config, const QString &prefix, bool saveURLs, KonqFrameBase* docContainer, int id, int depth )
{
int idSecond = id + (int)pow( 2.0, depth );
//write children sizes
config->writeEntry( QString::fromLatin1( "SplitterSizes" ).prepend( prefix ), sizes() );
config.writeEntry( QString::fromLatin1( "SplitterSizes" ).prepend( prefix ), sizes() );
//write children
QStringList strlst;
......@@ -75,7 +75,7 @@ void KonqFrameContainer::saveConfig( KConfig* config, const QString &prefix, boo
if( secondChild() )
strlst.append( QString::fromLatin1( secondChild()->frameType() ) + QString::number( idSecond ) );
config->writeEntry( QString::fromLatin1( "Children" ).prepend( prefix ), strlst );
config.writeEntry( QString::fromLatin1( "Children" ).prepend( prefix ), strlst );
//write orientation
QString o;
......@@ -83,13 +83,13 @@ void KonqFrameContainer::saveConfig( KConfig* config, const QString &prefix, boo
o = QString::fromLatin1("Horizontal");
else if( orientation() == Qt::Vertical )
o = QString::fromLatin1("Vertical");
config->writeEntry( QString::fromLatin1( "Orientation" ).prepend( prefix ), o );
config.writeEntry( QString::fromLatin1( "Orientation" ).prepend( prefix ), o );
//write docContainer
if (this == docContainer) config->writeEntry( QString::fromLatin1( "docContainer" ).prepend( prefix ), true );
if (this == docContainer) config.writeEntry( QString::fromLatin1( "docContainer" ).prepend( prefix ), true );
if (m_pSecondChild == m_pActiveChild) config->writeEntry( QString::fromLatin1( "activeChildIndex" ).prepend( prefix ), 1 );
else config->writeEntry( QString::fromLatin1( "activeChildIndex" ).prepend( prefix ), 0 );
if (m_pSecondChild == m_pActiveChild) config.writeEntry( QString::fromLatin1( "activeChildIndex" ).prepend( prefix ), 1 );
else config.writeEntry( QString::fromLatin1( "activeChildIndex" ).prepend( prefix ), 0 );
//write child configs
if( firstChild() ) {
......
......@@ -81,7 +81,7 @@ public:
virtual void listViews( ChildViewList *viewList );
virtual void saveConfig( KConfig* config, const QString &prefix, bool saveURLs, KonqFrameBase* docContainer, int id = 0, int depth = 0 );
virtual void saveConfig( KConfigGroup& config, const QString &prefix, bool saveURLs, KonqFrameBase* docContainer, int id = 0, int depth = 0 );
virtual void copyHistory( KonqFrameBase *other );
KonqFrameBase* firstChild() { return m_pFirstChild; }
......
......@@ -23,6 +23,7 @@
#include "konq_application.h"
#include "konq_guiclients.h"
#include "KonqMainWindowAdaptor.h"
#include "KonquerorAdaptor.h"
#include "konq_view.h"
#include "konq_run.h"
#include "konq_misc.h"
......@@ -33,6 +34,7 @@
#include "konq_actions.h"
#include "konq_settingsxt.h"
#include "konq_extensionmanager.h"
#include "konqueror_interface.h"
#include "delayedinitializer.h"
#include <konq_pixmapprovider.h>
#include <konq_operations.h>
......@@ -771,9 +773,9 @@ bool KonqMainWindow::openView( QString mimeType, const KUrl &_url, KonqView *chi
{
f.close();
KConfig config( urlDotDir.path(), KConfig::OnlyLocal);
config.setGroup( "URL properties" );
HTMLAllowed = config.readEntry( "HTMLAllowed", m_bHTMLAllowed);
serviceName = config.readEntry( "ViewMode", serviceName );
KConfigGroup urlProperties( &config, "URL properties" );
HTMLAllowed = urlProperties.readEntry( "HTMLAllowed", m_bHTMLAllowed);
serviceName = urlProperties.readEntry( "ViewMode", serviceName );
kDebug(1202) << "serviceName=" << serviceName << endl;
}
if ( HTMLAllowed &&
......@@ -1175,15 +1177,15 @@ void KonqMainWindow::slotCreateNewWindow( const KUrl &url, const KParts::URLArgs
}
QString profileName = QLatin1String( url.isLocalFile() ? "konqueror/profiles/filemanagement" : "konqueror/profiles/webbrowsing" );
KConfig cfg( KStandardDirs::locate( "data", profileName ) );
cfg.setGroup( "Profile" );
if ( windowArgs.x != -1 )
mainWindow->move( windowArgs.x, mainWindow->y() );
if ( windowArgs.y != -1 )
mainWindow->move( mainWindow->x(), windowArgs.y );
QSize size = KonqViewManager::readConfigSize( cfg, mainWindow );
KConfig cfg( KStandardDirs::locate( "data", profileName ) );
KConfigGroup profileGroup( &cfg, "Profile" );
QSize size = KonqViewManager::readConfigSize( profileGroup, mainWindow );
int width;
if ( windowArgs.width != -1 )
......@@ -1293,7 +1295,6 @@ void KonqMainWindow::slotDuplicateWindow()
KTemporaryFile tempFile;
tempFile.open();
KConfig config( tempFile.fileName() );
config.setGroup( "View Profile" );
m_pViewManager->saveViewProfile( config, true, true );
KonqMainWindow *mainWindow = new KonqMainWindow( KUrl(), false, xmlFile());
......@@ -1648,8 +1649,8 @@ void KonqMainWindow::slotViewModeToggle( bool toggle )
if ( u.isLocalFile() )
{
KConfig config( u.path(), KConfig::OnlyLocal ); // if we have no write access, just drop it
config.setGroup( "URL properties" );
config.writeEntry( "ViewMode", modeName );
KConfigGroup urlProperties( &config, "URL properties" );
urlProperties.writeEntry( "ViewMode", modeName );
config.sync();
}
} else
......@@ -1674,8 +1675,8 @@ void KonqMainWindow::showHTML( KonqView * _view, bool b, bool _activateView )
if ( u.isLocalFile() )
{
KConfig config( u.path(), KConfig::OnlyLocal ); // No checks for access
config.setGroup( "URL properties" );
config.writeEntry( "HTMLAllowed", b );
KConfigGroup urlProperties( &config, "URL properties" );
urlProperties.writeEntry( "HTMLAllowed", b );
config.sync();
}
} else
......@@ -2017,17 +2018,10 @@ void KonqMainWindow::slotRunFinished()
}
if ( run->hasError() ) { // we had an error
#ifdef __GNUC__
#warning port to DBUS signal removeFromCombo (and move to KonqCombo)
#endif
#if 0
QByteArray data;
QDataStream s( &data, QIODevice::WriteOnly );
s.setVersion(QDataStream::Qt_3_1);
s << run->url().prettyUrl() << kapp->dcopClient()->defaultObject();
kapp->dcopClient()->send( "konqueror*", "KonquerorIface",
"removeFromCombo(QString,QCString)", data);
#endif
org::kde::Konqueror::Main dbus( "org.kde.konqueror",
KONQ_MAIN_PATH,
QDBusConnection::sessionBus() );
dbus.removeFromCombo( run->url().prettyUrl() );
}
KonqView *childView = run->childView();
......@@ -5009,15 +5003,15 @@ void KonqMainWindow::reparseConfiguration()
(*it)->reparseConfiguration();
}
void KonqMainWindow::saveProperties( KConfig *config )
void KonqMainWindow::saveProperties( KConfig& config )
{
m_pViewManager->saveViewProfile( *config, true /* save URLs */, false );
m_pViewManager->saveViewProfile( config, true /* save URLs */, false );
}
void KonqMainWindow::readProperties( KConfig *config )
void KonqMainWindow::readProperties( KConfig& config )
{
kDebug(1202) << "KonqMainWindow::readProperties( KConfig *config )" << endl;
m_pViewManager->loadViewProfile( *config, QString() /*no profile name*/ );
m_pViewManager->loadViewProfile( config, QString() /*no profile name*/ );
}
void KonqMainWindow::setInitialFrameName( const QString &name )
......@@ -5730,7 +5724,7 @@ void KonqMainWindow::removeChildFrame( KonqFrameBase * /*frame*/ )
m_pActiveChild = 0;
}
void KonqMainWindow::saveConfig( KConfig* config, const QString &prefix, bool saveURLs, KonqFrameBase* docContainer, int id, int depth ) { if( m_pChildFrame ) m_pChildFrame->saveConfig( config, prefix, saveURLs, docContainer, id, depth); }
void KonqMainWindow::saveConfig( KConfigGroup& config, const QString &prefix, bool saveURLs, KonqFrameBase* docContainer, int id, int depth ) { if( m_pChildFrame ) m_pChildFrame->saveConfig( config, prefix, saveURLs, docContainer, id, depth); }
void KonqMainWindow::copyHistory( KonqFrameBase *other ) { if( m_pChildFrame ) m_pChildFrame->copyHistory( other ); }
......@@ -6032,6 +6026,5 @@ void KonqMainWindow::restoreWindowSize()
#include "konq_mainwindow.moc"
#include "konq_mainwindow_p.moc"
/* vim: et sw=4 ts=4
*/
......@@ -153,8 +153,8 @@ public:
virtual QWidget *createContainer( QWidget *parent, int index, const QDomElement &element, int &id );
virtual void removeContainer( QWidget *container, QWidget *parent, QDomElement &element, int id );
virtual void saveProperties( KConfig *config );
virtual void readProperties( KConfig *config );
virtual void saveProperties( KConfig& config );
virtual void readProperties( KConfig& config );
void setInitialFrameName( const QString &name );
......@@ -284,7 +284,7 @@ public:
*/
void removeChildFrame( KonqFrameBase * frame );
void saveConfig( KConfig* config, const QString &prefix, bool saveURLs, KonqFrameBase* docContainer, int id = 0, int depth = 0 );
void saveConfig( KConfigGroup& config, const QString &prefix, bool saveURLs, KonqFrameBase* docContainer, int id = 0, int depth = 0 );
void copyHistory( KonqFrameBase *other );
......
......@@ -152,8 +152,8 @@ KonqMainWindow * KonqMisc::createBrowserWindowFromProfile( const QString &path,
{
KConfig cfg( path );
cfg.setDollarExpansion( true );
cfg.setGroup( "Profile" );
QString xmluiFile=cfg.readEntry("XMLUIFile","konqueror.rc");
KConfigGroup profileGroup( &cfg, "Profile" );
QString xmluiFile = profileGroup.readEntry("XMLUIFile","konqueror.rc");
mainWindow = new KonqMainWindow( KUrl(), false, xmluiFile );
if ( forbidUseHTML )
......
......@@ -52,9 +52,9 @@ KonqProfileMap KonqProfileDlg::readAllProfiles()
KConfig cfg( *pIt, KConfig::OnlyLocal);
if ( cfg.hasGroup( "Profile" ) )
{
cfg.setGroup( "Profile" );
if ( cfg.hasKey( "Name" ) )
profileName = cfg.readEntry( "Name" );
KConfigGroup profileGroup( &cfg, "Profile" );
if ( profileGroup.hasKey( "Name" ) )
profileName = profileGroup.readEntry( "Name" );
mapProfiles.insert( profileName, *pIt );
}
......
......@@ -190,7 +190,7 @@ void KonqFrameTabs::listViews( ChildViewList *viewList ) {
frame->listViews(viewList);
}
void KonqFrameTabs::saveConfig( KConfig* config, const QString &prefix, bool saveURLs,
void KonqFrameTabs::saveConfig( KConfigGroup& config, const QString &prefix, bool saveURLs,
KonqFrameBase* docContainer, int id, int depth )
{
//write children
......@@ -206,9 +206,9 @@ void KonqFrameTabs::saveConfig( KConfig* config, const QString &prefix, bool sav
i++;
}
config->writeEntry( QString::fromLatin1( "Children" ).prepend( prefix ), strlst );
config.writeEntry( QString::fromLatin1( "Children" ).prepend( prefix ), strlst );
config->writeEntry( QString::fromLatin1( "activeChildIndex" ).prepend( prefix ),
config.writeEntry( QString::fromLatin1( "activeChildIndex" ).prepend( prefix ),
currentIndex() );
}
......
......@@ -57,7 +57,7 @@ public:
virtual void listViews( ChildViewList *viewList );
virtual void saveConfig( KConfig* config, const QString &prefix, bool saveURLs,
virtual void saveConfig( KConfigGroup& config, const QString &prefix, bool saveURLs,
KonqFrameBase* docContainer, int id = 0, int depth = 0 );
virtual void copyHistory( KonqFrameBase *other );
......
......@@ -430,14 +430,14 @@ void KonqViewManager::duplicateTab( KonqFrameBase* tab, bool openAfterCurrentPag
KTemporaryFile tempFile;
tempFile.open();
KConfig config( tempFile.fileName() );
config.setGroup( "View Profile" );
KConfigGroup profileGroup( &config, "Profile" );
QString prefix = QString::fromLatin1( currentFrame->frameType() ) + QString::number(0);
config.writeEntry( "RootItem", prefix );
profileGroup.writeEntry( "RootItem", prefix );
prefix.append( QLatin1Char( '_' ) );
currentFrame->saveConfig( &config, prefix, true, 0L, 0, 1);
currentFrame->saveConfig( profileGroup, prefix, true, 0L, 0, 1);
QString rootItem = config.readEntry( "RootItem", "empty" );
QString rootItem = profileGroup.readEntry( "RootItem", "empty" );
if (rootItem.isNull() || rootItem == "empty") return;
......@@ -445,7 +445,7 @@ void KonqViewManager::duplicateTab( KonqFrameBase* tab, bool openAfterCurrentPag
// from profile loading (e.g. in switchView)
m_bLoadingProfile = true;
loadItem( config, tabContainer, rootItem, KUrl(""), true, openAfterCurrentPage );
loadItem( profileGroup, tabContainer, rootItem, KUrl(""), true, openAfterCurrentPage );
m_bLoadingProfile = false;
......@@ -500,13 +500,13 @@ void KonqViewManager::breakOffTab( KonqFrameBase* tab )
KTemporaryFile tempFile;
tempFile.open();
KConfig config( tempFile.fileName() );
config.setGroup( "View Profile" );
KConfigGroup profileGroup( &config, "Profile" );
QString prefix = QString::fromLatin1( currentFrame->frameType() ) + QString::number(0);
config.writeEntry( "RootItem", prefix );
profileGroup.writeEntry( "RootItem", prefix );
prefix.append( QLatin1Char( '_' ) );
config.writeEntry( QString::fromLatin1( "docContainer" ).prepend( prefix ), true );
currentFrame->saveConfig( &config, prefix, true, 0L, 0, 1);
profileGroup.writeEntry( QString::fromLatin1( "docContainer" ).prepend( prefix ), true );
currentFrame->saveConfig( profileGroup, prefix, true, 0L, 0, 1);
KonqMainWindow *mainWindow = new KonqMainWindow( KUrl(), false );
if (mainWindow == 0L) return;
......@@ -1094,20 +1094,21 @@ void KonqViewManager::saveViewProfile( const QString & fileName, const QString &
void KonqViewManager::saveViewProfile( KConfig & cfg, bool saveURLs, bool saveWindowSize )
{
//kDebug(1202) << "KonqViewManager::saveViewProfile" << endl;
KConfigGroup profileGroup(&cfg, "Profile");
if( m_pMainWindow->childFrame() != 0L ) {
QString prefix = QString::fromLatin1( m_pMainWindow->childFrame()->frameType() )
+ QString::number(0);
cfg.writeEntry( "RootItem", prefix );
profileGroup.writeEntry( "RootItem", prefix );
prefix.append( QLatin1Char( '_' ) );
m_pMainWindow->saveConfig( &cfg, prefix, saveURLs, m_pDocContainer, 0, 1);
m_pMainWindow->saveConfig( profileGroup, prefix, saveURLs, m_pDocContainer, 0, 1);
}
cfg.writeEntry( "FullScreen", m_pMainWindow->fullScreenMode());
cfg.writeEntry("XMLUIFile", m_pMainWindow->xmlFile());
profileGroup.writeEntry( "FullScreen", m_pMainWindow->fullScreenMode());
profileGroup.writeEntry("XMLUIFile", m_pMainWindow->xmlFile());
if ( saveWindowSize )
{
cfg.writeEntry( "Width", m_pMainWindow->width() );
cfg.writeEntry( "Height", m_pMainWindow->height() );
profileGroup.writeEntry( "Width", m_pMainWindow->width() );
profileGroup.writeEntry( "Height", m_pMainWindow->height() );
}
// Save menu/toolbar settings in profile. Relys on konq_mainwindow calling
......@@ -1125,8 +1126,6 @@ void KonqViewManager::loadViewProfile( const QString & path, const QString & fil
bool resetWindow, bool openUrl )
{
KConfig cfg( path );
cfg.setDollarExpansion( true );
cfg.setGroup( "Profile" );
loadViewProfile( cfg, filename, forcedURL, req, resetWindow, openUrl );
}
......@@ -1134,6 +1133,9 @@ void KonqViewManager::loadViewProfile( KConfig &cfg, const QString & filename,
const KUrl & forcedURL, const KonqOpenURLRequest &req,
bool resetWindow, bool openUrl )
{
cfg.setDollarExpansion( true );
KConfigGroup profileGroup( &cfg, "Profile" );
if ( docContainer() && docContainer()->frameType()=="Tabs" )
{
KonqFrameTabs* tabContainer = static_cast<KonqFrameTabs*>(docContainer());
......@@ -1185,8 +1187,8 @@ void KonqViewManager::loadViewProfile( KConfig &cfg, const QString & filename,
bool alwaysTabbedMode = KonqSettings::alwaysTabbedMode();
m_currentProfile = filename;
m_currentProfileText = cfg.readPathEntry("Name",filename);
m_profileHomeURL = cfg.readEntry("HomeURL", QString());
m_currentProfileText = profileGroup.readPathEntry("Name",filename);
m_profileHomeURL = profileGroup.readEntry("HomeURL", QString());
m_pMainWindow->currentProfileChanged();
KUrl defaultURL;
......@@ -1195,7 +1197,7 @@ void KonqViewManager::loadViewProfile( KConfig &cfg, const QString & filename,
clear();
QString rootItem = cfg.readEntry( "RootItem", "empty" );
QString rootItem = profileGroup.readEntry( "RootItem", "empty" );
//kDebug(1202) << "KonqViewManager::loadViewProfile : loading RootItem " << rootItem <<
//" forcedURL " << forcedURL.url() << endl;
......@@ -1206,7 +1208,7 @@ void KonqViewManager::loadViewProfile( KConfig &cfg, const QString & filename,
// from profile loading (e.g. in switchView)
m_bLoadingProfile = true;
loadItem( cfg, m_pMainWindow, rootItem, defaultURL, openUrl && forcedURL.isEmpty() );
loadItem( profileGroup, m_pMainWindow, rootItem, defaultURL, openUrl && forcedURL.isEmpty() );
m_bLoadingProfile = false;
......@@ -1274,7 +1276,7 @@ void KonqViewManager::loadViewProfile( KConfig &cfg, const QString & filename,
// Window size
if ( !m_pMainWindow->initialGeometrySet() )
{
if (cfg.readEntry( "FullScreen",false ))
if (profileGroup.readEntry( "FullScreen",false ))
{
// Full screen on
m_pMainWindow->showFullScreen();
......@@ -1285,7 +1287,7 @@ void KonqViewManager::loadViewProfile( KConfig &cfg, const QString & filename,
if( m_pMainWindow->isFullScreen())
m_pMainWindow->showNormal();
QSize size = readConfigSize( cfg, m_pMainWindow );
QSize size = readConfigSize( profileGroup, m_pMainWindow );
if ( size.isValid() )
m_pMainWindow->resize( size );
else // no size in the profile; use last known size
......@@ -1395,7 +1397,7 @@ void KonqViewManager::emitActivePartChanged()
}
QSize KonqViewManager::readConfigSize( KConfig &cfg, QWidget *widget )
QSize KonqViewManager::readConfigSize( KConfigGroup &cfg, QWidget *widget )
{
bool ok;
......@@ -1440,7 +1442,7 @@ QSize KonqViewManager::readConfigSize( KConfig &cfg, QWidget *widget )
return QSize( width, height );
}
void KonqViewManager::loadItem( KConfig &cfg, KonqFrameContainerBase *parent,
void KonqViewManager::loadItem( KConfigGroup &cfg, KonqFrameContainerBase *parent,
const QString &name, const KUrl & defaultURL, bool openUrl, bool openAfterCurrentPage )
{
QString prefix;
......@@ -1525,7 +1527,7 @@ void KonqViewManager::loadItem( KConfig &cfg, KonqFrameContainerBase *parent,
}
}
}
KonqConfigEvent ev( &cfg, prefix+"_", false/*load*/);
KonqConfigEvent ev( cfg.config(), prefix+"_", false/*load*/);
QApplication::sendEvent( childView->part(), &ev );