KDesktopFile::KDesktopFile(const QString &fileName) : KConfig(*new KDesktopFilePrivate(QStandardPaths::ApplicationsLocation, fileName)) { Q_D(KDesktopFile); reparseConfiguration(); d->desktopGroup = KConfigGroup(this, "Desktop Entry"); }
KDesktopFile::KDesktopFile(QStandardPaths::StandardLocation resourceType, const QString &fileName) : KConfig(*new KDesktopFilePrivate(resourceType, fileName)) { Q_D(KDesktopFile); reparseConfiguration(); d->desktopGroup = KConfigGroup(this, "Desktop Entry"); }
KConfig::KConfig(const QString &file, OpenFlags mode, QStandardPaths::StandardLocation resourceType) : d_ptr(new KConfigPrivate(mode, resourceType)) { d_ptr->changeFileName(file); // set the local file name // read initial information off disk reparseConfiguration(); }
void KConfig::checkUpdate(const QString &id, const QString &updateFile) { const KConfigGroup cg(this, "$Version"); const QString cfg_id = updateFile + QLatin1Char(':') + id; const QStringList ids = cg.readEntry("update_info", QStringList()); if (!ids.contains(cfg_id)) { QProcess::execute(QStringLiteral(KCONF_UPDATE_INSTALL_LOCATION), QStringList() << QStringLiteral("--check") << updateFile); reparseConfiguration(); } }
KConfig::KConfig(const QString &file, const QString &backend, QStandardPaths::StandardLocation resourceType) : d_ptr(new KConfigPrivate(SimpleConfig, resourceType)) { d_ptr->mBackend = KConfigBackend::create(file, backend); d_ptr->bDynamicBackend = false; d_ptr->changeFileName(file); // set the local file name // read initial information off disk reparseConfiguration(); }
KDesktopFile::KDesktopFile(const QString &fileName, bool bReadOnly, const char *resType) : KConfig(QString::fromLatin1(""), bReadOnly, false) { // KConfigBackEnd will try to locate the filename that is provided // based on the resource type specified, _only_ if the filename // is not an absolute path. backEnd->changeFileName(fileName, resType, false); setReadOnly(bReadOnly); reparseConfiguration(); setDesktopGroup(); }
//_________________________________________________________ ShadowDemoDialog::ShadowDemoDialog( QWidget* parent ): QDialog( parent ), _helper(), _cache( _helper ) { setWindowTitle( i18n( "Oxygen Shadow Demo" ) ); setupUi( this ); inactiveRoundWidget->setHelper( _helper ); inactiveSquareWidget->setHelper( _helper ); activeRoundWidget->setHelper( _helper ); activeSquareWidget->setHelper( _helper ); // reparse configuration reparseConfiguration(); // customize button box QList<QDialogButtonBox*> children( findChildren<QDialogButtonBox*>() ); if( !children.isEmpty() ) { QDialogButtonBox* buttonBox( children.front() ); _backgroundCheckBox = new QCheckBox( i18n( "Draw window background" ) ); _backgroundCheckBox->setChecked( true ); buttonBox->addButton( _backgroundCheckBox, QDialogButtonBox::ResetRole ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), inactiveRoundWidget, SLOT(toggleBackground(bool)) ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), inactiveSquareWidget, SLOT(toggleBackground(bool)) ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), activeRoundWidget, SLOT(toggleBackground(bool)) ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), activeSquareWidget, SLOT(toggleBackground(bool)) ); } // use DBus connection to update on oxygen configuration change QDBusConnection dbus = QDBusConnection::sessionBus(); dbus.connect( QString(), QStringLiteral( "/OxygenWindeco" ), QStringLiteral( "org.kde.Oxygen.Style" ), QStringLiteral( "reparseConfiguration" ), this, SLOT(reparseConfiguration()) ); }
//=========================================================================== SMBSlave::SMBSlave(const QByteArray& pool, const QByteArray& app) : SlaveBase( "smb", pool, app ), m_openFd(-1) { m_initialized_smbc = false; //read in the default workgroup info... reparseConfiguration(); //initialize the library... auth_initialize_smbc(); }
//=========================================================================== SMBSlave::SMBSlave(const TQCString& pool, const TQCString& app) : SlaveBase( "smb", pool, app ) { m_initialized_smbc = false; //read in the default workgroup info... reparseConfiguration(); //initialize the library... auth_initialize_smbc(); }
KSimpleConfig::KSimpleConfig(const QString &fileName, bool bReadOnly) : KConfig(QString::fromLatin1(""), bReadOnly, false) { // the difference between KConfig and KSimpleConfig is just that // for KSimpleConfig an absolute filename is guaranteed if (!fileName.isNull() && QDir::isRelativePath(fileName)) { backEnd->changeFileName( KGlobal::dirs()-> saveLocation("config", QString::null, !bReadOnly)+fileName, "config", false); } else { backEnd->changeFileName(fileName, "config", false); } setReadOnly( bReadOnly ); reparseConfiguration(); }
//_________________________________________________________ ShadowDemoDialog::ShadowDemoDialog( QWidget* parent ): KDialog( parent ), _helper( "oxygen" ), _cache( _helper ) { setWindowTitle( i18n( "Oxygen Shadow Demo" ) ); setButtons( KDialog::Cancel|KDialog::Apply ); button( KDialog::Apply )->setText( i18n("Save") ); button( KDialog::Apply )->setIcon( KIcon("document-save-as") ); button( KDialog::Apply )->setToolTip( i18n( "Save shadows as pixmaps in provided directory" ) ); QWidget *mainWidget( new QWidget( this ) ); ui.setupUi( mainWidget ); setMainWidget( mainWidget ); ui.inactiveRoundWidget->setHelper( _helper ); ui.inactiveSquareWidget->setHelper( _helper ); ui.activeRoundWidget->setHelper( _helper ); ui.activeSquareWidget->setHelper( _helper ); // reparse configuration reparseConfiguration(); // customize button box QList<QDialogButtonBox*> children( findChildren<QDialogButtonBox*>() ); if( !children.isEmpty() ) { QDialogButtonBox* buttonBox( children.front() ); _backgroundCheckBox = new QCheckBox( i18n( "Draw window background" ) ); _backgroundCheckBox->setChecked( true ); buttonBox->addButton( _backgroundCheckBox, QDialogButtonBox::ResetRole ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), ui.inactiveRoundWidget, SLOT(toggleBackground(bool)) ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), ui.inactiveSquareWidget, SLOT(toggleBackground(bool)) ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), ui.activeRoundWidget, SLOT(toggleBackground(bool)) ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), ui.activeSquareWidget, SLOT(toggleBackground(bool)) ); }
_backgroundCheckBox->setChecked( true ); buttonBox->addButton( _backgroundCheckBox, QDialogButtonBox::ResetRole ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), ui.inactiveRoundWidget, SLOT(toggleBackground(bool)) ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), ui.inactiveSquareWidget, SLOT(toggleBackground(bool)) ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), ui.activeRoundWidget, SLOT(toggleBackground(bool)) ); connect( _backgroundCheckBox, SIGNAL(toggled(bool)), ui.activeSquareWidget, SLOT(toggleBackground(bool)) ); } // connections connect( button( KDialog::Apply ), SIGNAL(clicked()), SLOT(save()) ); // use DBus connection to update on oxygen configuration change QDBusConnection dbus = QDBusConnection::sessionBus(); dbus.connect( QString(), "/OxygenWindeco", "org.kde.Oxygen.Style", "reparseConfiguration", this, SLOT(reparseConfiguration()) ); } //_________________________________________________________ void ShadowDemoDialog::reparseConfiguration( void ) { // read shadow configurations KConfig config( "oxygenrc" ); _cache.invalidateCaches(); _cache.setEnabled( true ); _cache.setShadowConfiguration( ShadowConfiguration( QPalette::Inactive, KConfigGroup( &config, "InactiveShadow") ) ); _cache.setShadowConfiguration( ShadowConfiguration( QPalette::Active, KConfigGroup( &config, "ActiveShadow") ) ); // pass tileSets to UI