void KonqProfileDlg::slotItemRenamed( QListWidgetItem * item )
{
    if (!item) {
        return;
    }

  KonqProfileItem * profileItem = static_cast<KonqProfileItem *>( item );

  QString newName = profileItem->text();
  QString oldName = profileItem->m_profileName;

  if ( newName == oldName )
    return;

  if (!newName.isEmpty())
  {
    KonqProfileMap::ConstIterator it = d->m_mapEntries.constFind( oldName );

    if ( it != d->m_mapEntries.constEnd() )
    {
      QString fileName = it.value();
      KConfig _cfg( fileName, KConfig::SimpleConfig );
      KConfigGroup cfg(&_cfg, "Profile" );
      cfg.writeEntry( "Name", newName );
      cfg.sync();
      // Didn't find how to change a key...
      d->m_mapEntries.remove( oldName );
      d->m_mapEntries.insert( newName, fileName );
      d->m_pProfileNameLineEdit->setText( newName );
      profileItem->m_profileName = newName;
    }
  }
}
int main(int ac, char* av[])
{
  /// Non-silent mode: Start gui
  QApplication _a(ac, av);

  tbd::Config _cfg("json.cfg");
  tbd::qt::ConfigTree _tree(&_cfg);

  _tree.show();

  return _a.exec();
}
void AddresseeWidget::restoreSettings()
{
  KConfig _config( "kabcrc" );
  KConfigGroup config(&_config, "General" );

  mPrefix->setNameParts( config.readEntry( "Prefixes" , QStringList() ) );
  mInclusion->setNameParts( config.readEntry( "Inclusions" , QStringList() ) );
  mSuffix->setNameParts( config.readEntry( "Suffixes" , QStringList() ) );

  KConfig _cfg( "kaddressbookrc" );
  KConfigGroup cfg(&_cfg, "General" );
  mFormattedNameCombo->setCurrentIndex( cfg.readEntry( "FormattedNameType", 1 ) );
}
Exemple #4
0
/*
 * KdmThemer. The main theming interface
 */
KdmThemer::KdmThemer( const QString &_filename, const QString &mode,
                      const QMap<QString, bool> &showTypes, QWidget *w )
	: QObject()
	, m_currentMode( mode )
	, m_showTypes( showTypes )
	, rootItem( 0 )
	, m_geometryOutdated( true )
	, m_geometryInvalid( true )
	, m_widget( 0 )
{
	// read the XML file and create DOM tree
	QString filename = _filename;
	if (!::access( QFile::encodeName( filename + "/KdmGreeterTheme.desktop" ), R_OK )) {
		KConfig _cfg( filename + "/KdmGreeterTheme.desktop", KConfig::SimpleConfig );
		KConfigGroup cfg( &_cfg, "KdmGreeterTheme" );
		filename += '/' + cfg.readEntry( "Greeter" );
	}
	QFile opmlFile( filename );
	if (!opmlFile.open( QIODevice::ReadOnly )) {
		FDialog::box( w, errorbox, i18n( "Cannot open theme file %1" , filename) );
		return;
	}
	QDomDocument domTree;
	if (!domTree.setContent( &opmlFile )) {
		FDialog::box( w, errorbox, i18n( "Cannot parse theme file %1" , filename) );
		return;
	}
	// generate all the items defined in the theme
	const QDomElement &theme = domTree.documentElement();
	// Get its tag, and check it's correct ("greeter")
	if (theme.tagName() != "greeter") {
		FDialog::box( w, errorbox, i18n( "%1 does not seem to be a correct theme file" , filename) );
		return;
	}

	// Set the root (screen) item
	rootItem = new KdmRect( this, theme );

	basedir = QFileInfo( filename ).absolutePath();

	generateItems( rootItem, theme );
	rootItem->updateVisible();

/*	*TODO*
	// Animation timer
	QTimer *time = new QTimer( this );
	time->start( 500 );
	connect( time, SIGNAL(timeout()), SLOT(update()) )
*/
}
void AddresseeWidget::saveSettings()
{
  KConfig _config( "kabcrc" );
  KConfigGroup config(&_config, "General" );

  config.writeEntry( "Prefixes", mPrefix->nameParts() );
  config.writeEntry( "Inclusions", mInclusion->nameParts() );
  config.writeEntry( "Suffixes", mSuffix->nameParts() );

  KConfig _cfg( "kaddressbookrc" );
  KConfigGroup cfg(&_cfg, "General" );
  cfg.writeEntry( "FormattedNameType", mFormattedNameCombo->currentIndex() );

  QDBusMessage message = 
      QDBusMessage::createSignal( "/KABC", "org.kde.kabc.AddressBookConfig", 
                                  "changed" );
  QDBusConnection::sessionBus().send( message );
}
Exemple #6
0
void SystemWidget::save()
{
    KConfig _cfg(QStringLiteral("kdedrc"));
    KConfigGroup cfg(&_cfg, "General");
    cfg.writeEntry("DelayedCheck", cb_disable_kbuildsycoca->isChecked());
}
Exemple #7
0
void SystemWidget::load()
{
    KConfig _cfg(QStringLiteral("kdedrc"));
    KConfigGroup cfg(&_cfg, "General");
    cb_disable_kbuildsycoca->setChecked(cfg.readEntry("DelayedCheck", false));
}