本文整理汇总了C++中Author::setEmail方法的典型用法代码示例。如果您正苦于以下问题:C++ Author::setEmail方法的具体用法?C++ Author::setEmail怎么用?C++ Author::setEmail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Author
的用法示例。
在下文中一共展示了Author::setEmail方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotOk
void UploadDialog::slotOk()
{
if (mNameEdit->text().isEmpty()) {
KMessageBox::error(this, i18n("Please put in a name."));
//return;
reject(); // FIXME - huh? return should work here but it accept()s!
}
QString language = m_languages.value(mLanguageCombo->currentText());
Author author;
author.setName(mAuthorEdit->text());
author.setEmail(mEmailEdit->text());
KTranslatable previewurl;
KUrl purl = mPreviewUrl->url();
//purl.setFileName(QString());
// FIXME: what does this do?
previewurl.addString(language, purl.url());
KTranslatable summary;
summary.addString(language, mSummaryEdit->toPlainText());
KTranslatable name;
name.addString(language, mNameEdit->text());
m_entry = new Entry;
m_entry->setName(name);
m_entry->setAuthor(author);
m_entry->setVersion(mVersionEdit->text());
m_entry->setLicense(mLicenseCombo->currentText());
m_entry->setPreview(previewurl);
m_entry->setSummary(summary);
if (mPayloadUrl.isValid()) {
KConfigGroup cg(KGlobal::config(), QString("KNewStuffUpload:%1").arg(mPayloadUrl.fileName()));
cg.writeEntry("name", mNameEdit->text());
cg.writeEntry("author", mAuthorEdit->text());
cg.writeEntry("author-email", mEmailEdit->text());
cg.writeEntry("version", mVersionEdit->text());
cg.writeEntry("license", mLicenseCombo->currentText());
cg.writeEntry("preview", mPreviewUrl->url().url());
cg.writeEntry("summary", mSummaryEdit->toPlainText());
cg.writeEntry("language", mLanguageCombo->currentText());
KGlobal::config()->sync();
}
accept();
}
示例2: parsXml
Application* XmlAppLoader::parsXml(const char* szFile)
{
app.clear();
ErrorLogger* logger = ErrorLogger::Instance();
TiXmlDocument doc(szFile);
if(!doc.LoadFile())
{
OSTRINGSTREAM err;
err<<"Syntax error while loading "<<szFile<<" at line "\
<<doc.ErrorRow()<<": ";
err<<doc.ErrorDesc();
logger->addError(err);
return NULL;
}
/* retrieving root element */
TiXmlElement *root = doc.RootElement();
if(!root)
{
OSTRINGSTREAM err;
err<<"Syntax error while loading "<<szFile<<" . ";
err<<"No root element.";
logger->addError(err);
return NULL;
}
if(!compareString(root->Value(), "application"))
{
//OSTRINGSTREAM err;
//err<<"File "<<szFile<<" has no tag <application>.";
//logger->addError(err);
return NULL;
}
/* retrieving name */
TiXmlElement* name = (TiXmlElement*) root->FirstChild("name");
if(!name || !name->GetText())
{
OSTRINGSTREAM err;
err<<"Module from "<<szFile<<" has no name.";
logger->addError(err);
//return NULL;
}
app.setXmlFile(szFile);
if(name)
{
string strname = name->GetText();
for(unsigned int i=0; i<strname.size(); i++)
if(strname[i] == ' ')
strname[i] = '_';
app.setName(strname.c_str());
}
/* retrieving description */
TiXmlElement* desc;
if((desc = (TiXmlElement*) root->FirstChild("description")))
app.setDescription(desc->GetText());
/* retrieving version */
TiXmlElement* ver;
if((ver = (TiXmlElement*) root->FirstChild("version")))
app.setVersion(ver->GetText());
/*
* TODO: setting prefix of the main application is inactivated.
* Check this should be supported in future or not!
*/
/*
//retrieving application prefix
TiXmlElement* pref;
if((pref = (TiXmlElement*) root->FirstChild("prefix")))
app.setPrefix(pref->GetText());
*/
/* retrieving authors information*/
TiXmlElement* authors;
if((authors = (TiXmlElement*) root->FirstChild("authors")))
for(TiXmlElement* ath = authors->FirstChildElement(); ath;
ath = ath->NextSiblingElement())
{
if(compareString(ath->Value(), "author"))
{
Author author;
if(ath->GetText())
author.setName(ath->GetText());
if(ath->Attribute("email"))
author.setEmail(ath->Attribute("email"));
app.addAuthor(author);
}
else
{
OSTRINGSTREAM war;
war<<"Unrecognized tag from "<<szFile<<" at line "\
<<ath->Row()<<".";
logger->addWarning(war);
}
//.........这里部分代码省略.........
示例3: parsXml
//.........这里部分代码省略.........
module.addArgument(arg);
}
}
else
{
OSTRINGSTREAM war;
war<<"Unrecognized tag from "<<szFile<<" at line "\
<<param->Row()<<".";
logger->addWarning(war);
}
}
/* retrieving rank */
TiXmlElement* rank;
if((rank = (TiXmlElement*) root->FirstChild("rank")) &&
rank->GetText())
module.setRank(atoi(parser->parseText(rank->GetText()).c_str()));
/* retrieving authors information*/
TiXmlElement* authors;
if((authors = (TiXmlElement*) root->FirstChild("authors")))
for(TiXmlElement* ath = authors->FirstChildElement(); ath;
ath = ath->NextSiblingElement())
{
if(compareString(ath->Value(), "author"))
{
Author author;
if(ath->GetText())
author.setName(parser->parseText(ath->GetText()).c_str());
if(ath->Attribute("email"))
author.setEmail(ath->Attribute("email"));
module.addAuthor(author);
}
else
{
OSTRINGSTREAM war;
war<<"Unrecognized tag from "<<szFile<<" at line "\
<<ath->Row()<<".";
logger->addWarning(war);
}
}
/* retrieving data */
if(root->FirstChild("data"))
for(TiXmlElement* data = root->FirstChild("data")->FirstChildElement();
data; data = data->NextSiblingElement())
{
/* output data */
if(compareString(data->Value(), "output"))
{
OutputData output;
if(compareString(data->Attribute("port_type"), "stream") || !data->Attribute("port_type"))
output.setPortType(STREAM_PORT);
else if(compareString(data->Attribute("port_type"), "event"))
output.setPortType(EVENT_PORT);
else if(compareString(data->Attribute("port_type"), "service"))
output.setPortType(SERVICE_PORT);
else
{
OSTRINGSTREAM war;