Logo Search packages:      
Sourcecode: kmess version File versions  Download package

KConfigGroup KMessConfig::getGlobalConfig ( const QString &  groupName  ) 

Select a group from the application-wide config.

This method returns a directly usable configuration group. It will be the config group named groupName contained in the KMess global configuration file.

Parameters:
groupName The name of the config group

Definition at line 274 of file kmessconfig.cpp.

References getInvalidConfig(), and warnUser().

Referenced by FileTransferP2P::contactStarted2_UserAccepts(), FileTransfer::contactStarted2_UserAccepts(), KMessShared::openBrowser(), KMessShared::openEmailClient(), AddEmoticonDialog::~AddEmoticonDialog(), and ContactAddedUserDialog::~ContactAddedUserDialog().

{
  QString generalGroup( "KMess" );

   // Search for config in QHash
  if( accountsConfigs_.contains( generalGroup ) )
  {
    return accountsConfigs_.value( generalGroup )->group( groupName );
  }

  KConfig *config = new KConfig();

  // insert current config into QHash for future search
  accountsConfigs_.insert( generalGroup, config );

  KConfigGroup configGroup( config->group( groupName ) );

  // We're unable to write on the configuration files,
  // avoid crashing (when kdelibs are compiled in debug mode)
  if( configGroup.accessMode() != KConfigBase::ReadWrite )
  {
    warnUser();
    return getInvalidConfig();
  }

  return configGroup;
}


Generated by  Doxygen 1.6.0   Back to index