本文整理汇总了C++中displayName函数的典型用法代码示例。如果您正苦于以下问题:C++ displayName函数的具体用法?C++ displayName怎么用?C++ displayName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了displayName函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: displayName
void SmileyCategoryListType::AddAccountAsCategory(PROTOACCOUNT *acc, const CMString &defaultFile)
{
if (Proto_IsAccountEnabled(acc) && acc->szProtoName && IsSmileyProto(acc->szModuleName)) {
CMString displayName(acc->tszAccountName ? acc->tszAccountName : _A2T(acc->szModuleName));
CMString PhysProtoName, paths;
DBVARIANT dbv;
if (db_get_ts(NULL, acc->szModuleName, "AM_BaseProto", &dbv) == 0) {
PhysProtoName = _T("AllProto");
PhysProtoName += dbv.ptszVal;
db_free(&dbv);
}
if (!PhysProtoName.IsEmpty())
paths = g_SmileyCategories.GetSmileyCategory(PhysProtoName) ? g_SmileyCategories.GetSmileyCategory(PhysProtoName)->GetFilename() : _T("");
if (paths.IsEmpty()) {
const char *packnam = acc->szProtoName;
if (mir_strcmp(packnam, "JABBER") == 0)
packnam = "JGMail";
else if (strstr(packnam, "SIP") != NULL)
packnam = "MSN";
char path[MAX_PATH];
mir_snprintf(path, "Smileys\\nova\\%s.msl", packnam);
paths = _A2T(path);
CMString patha;
pathToAbsolute(paths, patha);
if (_taccess(patha.c_str(), 0) != 0)
paths = defaultFile;
}
CMString tname(_A2T(acc->szModuleName));
AddCategory(tname, displayName, acc->bIsVirtual ? smcVirtualProto : smcProto, paths);
}
}
示例2: Q_UNUSED
void BaseCheckoutWizard::runWizard(const QString &path, QWidget *parent, const QString & /*platform*/, const QVariantMap &extraValues)
{
Q_UNUSED(extraValues)
// Create dialog and launch
d->parameterPages = createParameterPages(path);
Internal::CheckoutWizardDialog dialog(d->parameterPages, parent);
d->dialog = &dialog;
connect(&dialog, SIGNAL(progressPageShown()), this, SLOT(slotProgressPageShown()));
dialog.setWindowTitle(displayName());
if (dialog.exec() != QDialog::Accepted)
return;
// Now try to find the project file and open
const QString checkoutPath = d->checkoutPath;
d->clear();
QString errorMessage;
const QString projectFile = openProject(checkoutPath, &errorMessage);
if (projectFile.isEmpty()) {
QMessageBox msgBox(QMessageBox::Warning, tr("Cannot Open Project"),
tr("Failed to open project in '%1'.").arg(QDir::toNativeSeparators(checkoutPath)));
msgBox.setDetailedText(errorMessage);
msgBox.exec();
}
}
示例3: foreach
void DeadCodeFinder::dumpResults()
{
for (int i = 0; i < m_fileSet->size(); ++i) {
auto file = m_fileSet->file(i);
// this only makes sense for libraries
if (file->header()->type() == ET_EXEC)
continue;
bool skip = false;
foreach (const auto &excludePrefix, m_excludePrefixes) {
if (file->fileName().startsWith(excludePrefix)) {
skip = true;
break;
}
}
if (skip)
continue;
std::cout << "Unreferenced exported symbols in " << qPrintable(file->displayName()) << ":" << std::endl;
dumpResultsForFile(file);
std::cout << std::endl;
}
}
示例4: fopen
bool CursorInfo::isValid(const Location &location) const
{
const Path p = location.path();
bool ret = false;
FILE *f = fopen(p.constData(), "r");
if (f && fseek(f, location.offset(), SEEK_SET) != -1) {
const String display = displayName();
// int paren = symbolName.indexOf('(');
// int bracket = symbolName.indexOf('<');
// int end = symbolName.size();
// if (paren != -1) {
// if (bracket != -1) {
// end = std::min(paren, bracket);
// } else {
// end = paren;
// }
// } else if (bracket != -1) {
// end = bracket;
// }
// int start = end;
// while (start > 0 && RTags::isSymbol(symbolName.at(start - 1)))
// --start;
char buf[1024];
const int length = display.size();
if (length && length < static_cast<int>(sizeof(buf)) - 1 && fread(buf, std::min<int>(length, sizeof(buf) - 1), 1, f)) {
buf[length] = '\0';
ret = display == buf;
if (!ret) {
error("Different:\n[%s]\n[%s]", buf, display.constData());
}
}
}
if (f)
fclose(f);
return ret;
}
示例5: opts
analysis::SamplingAlgorithm SamplingAlgorithmRecord_Impl::samplingAlgorithm() const {
analysis::SamplingAlgorithmOptions opts(m_sampleType,
m_rngType,
options());
OptionalFileReference restartFile, outFile;
OptionalFileReferenceRecord ofr = restartFileReferenceRecord();
if (ofr) {
restartFile = ofr->fileReference();
}
ofr = outFileReferenceRecord();
if (ofr) {
outFile = ofr->fileReference();
}
boost::optional<runmanager::Job> job;
if (this->jobUUID()){
try {
job = this->projectDatabase().runManager().getJob(this->jobUUID().get());
}
catch (const std::exception& e) {
LOG(Error, "Job " << toString(this->jobUUID().get()) << " not found in RunManager. "
<< e.what());
}
}
return analysis::SamplingAlgorithm(handle(),
uuidLast(),
displayName(),
description(),
complete(),
failed(),
iter(),
opts,
restartFile,
outFile,
job);
}
示例6: webFinger
QString QASActor::displayNameOrWebFinger() const {
if (displayName().isEmpty())
return webFinger();
return displayName();
}
示例7: startFile
void DirDef::writeDocumentation(OutputList &ol)
{
ol.pushGeneratorState();
QCString shortTitle=theTranslator->trDirReference(m_shortName);
QCString title=theTranslator->trDirReference(m_dispName);
startFile(ol,getOutputFileBase(),name(),title,HLI_None,TRUE);
// write navigation path
writeNavigationPath(ol);
ol.endQuickIndices();
ol.startContents();
startTitle(ol,getOutputFileBase());
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
ol.parseText(shortTitle);
ol.enableAll();
ol.disable(OutputGenerator::Html);
ol.parseText(title);
ol.popGeneratorState();
endTitle(ol,getOutputFileBase(),title);
if (!Config_getString("GENERATE_TAGFILE").isEmpty())
{
Doxygen::tagFile << " <compound kind=\"dir\">" << endl;
Doxygen::tagFile << " <name>" << convertToXML(displayName()) << "</name>" << endl;
Doxygen::tagFile << " <path>" << convertToXML(name()) << "</path>" << endl;
Doxygen::tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>" << endl;
}
//---------------------------------------- start flexible part -------------------------------
QListIterator<LayoutDocEntry> eli(
LayoutDocManager::instance().docEntries(LayoutDocManager::Directory));
LayoutDocEntry *lde;
for (eli.toFirst();(lde=eli.current());++eli)
{
switch (lde->kind())
{
case LayoutDocEntry::BriefDesc:
writeBriefDescription(ol);
break;
case LayoutDocEntry::DirGraph:
writeDirectoryGraph(ol);
break;
case LayoutDocEntry::MemberDeclStart:
startMemberDeclarations(ol);
break;
case LayoutDocEntry::DirSubDirs:
writeSubDirList(ol);
break;
case LayoutDocEntry::DirFiles:
writeFileList(ol);
break;
case LayoutDocEntry::MemberDeclEnd:
endMemberDeclarations(ol);
break;
case LayoutDocEntry::DetailedDesc:
{
LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
writeDetailedDescription(ol,ls->title);
}
break;
case LayoutDocEntry::ClassIncludes:
case LayoutDocEntry::ClassInheritanceGraph:
case LayoutDocEntry::ClassNestedClasses:
case LayoutDocEntry::ClassCollaborationGraph:
case LayoutDocEntry::ClassAllMembersLink:
case LayoutDocEntry::ClassUsedFiles:
case LayoutDocEntry::NamespaceNestedNamespaces:
case LayoutDocEntry::NamespaceClasses:
case LayoutDocEntry::FileClasses:
case LayoutDocEntry::FileNamespaces:
case LayoutDocEntry::FileIncludes:
case LayoutDocEntry::FileIncludeGraph:
case LayoutDocEntry::FileIncludedByGraph:
case LayoutDocEntry::FileSourceLink:
case LayoutDocEntry::GroupClasses:
case LayoutDocEntry::GroupNamespaces:
case LayoutDocEntry::GroupDirs:
case LayoutDocEntry::GroupNestedGroups:
case LayoutDocEntry::GroupFiles:
case LayoutDocEntry::GroupGraph:
case LayoutDocEntry::GroupPageDocs:
case LayoutDocEntry::AuthorSection:
case LayoutDocEntry::MemberGroups:
case LayoutDocEntry::MemberDecl:
case LayoutDocEntry::MemberDef:
case LayoutDocEntry::MemberDefStart:
case LayoutDocEntry::MemberDefEnd:
err("Internal inconsistency: member %d should not be part of "
"LayoutDocManager::Directory entry list\n",lde->kind());
break;
}
}
//---------------------------------------- end flexible part -------------------------------
//.........这里部分代码省略.........
示例8: Q_ASSERT
void AccountsListDelegate::updateItemWidgets(const QList<QWidget *> widgets, const QStyleOptionViewItem &option, const QPersistentModelIndex &index) const
{
// draws:
// AccountName
// Checkbox | Icon | | ConnectionIcon | ConnectionState
// errorMessage
if (!index.isValid()) {
return;
}
Q_ASSERT(widgets.size() == 6);
// Get the widgets
QCheckBox* checkbox = qobject_cast<QCheckBox*>(widgets.at(0));
ChangeIconButton* changeIconButton = qobject_cast<ChangeIconButton*>(widgets.at(1));
QLabel *statusTextLabel = qobject_cast<QLabel*>(widgets.at(2));
QLabel *statusIconLabel = qobject_cast<QLabel*>(widgets.at(3));
EditDisplayNameButton *displayNameButton = qobject_cast<EditDisplayNameButton*>(widgets.at(4));
QLabel *connectionErrorLabel = qobject_cast<QLabel*>(widgets.at(5));
Q_ASSERT(checkbox);
Q_ASSERT(changeIconButton);
Q_ASSERT(statusTextLabel);
Q_ASSERT(statusIconLabel);
Q_ASSERT(displayNameButton);
Q_ASSERT(connectionErrorLabel);
bool isSelected(itemView()->selectionModel()->isSelected(index) && itemView()->hasFocus());
bool isEnabled(index.data(KTp::AccountsListModel::EnabledRole).toBool());
KIcon accountIcon(index.data(Qt::DecorationRole).value<QIcon>());
KIcon statusIcon(index.data(KTp::AccountsListModel::ConnectionStateIconRole).value<QIcon>());
QString statusText(index.data(KTp::AccountsListModel::ConnectionStateDisplayRole).toString());
QString displayName(index.data(Qt::DisplayRole).toString());
QString connectionError(index.data(KTp::AccountsListModel::ConnectionErrorMessageDisplayRole).toString());
Tp::AccountPtr account(index.data(KTp::AccountsListModel::AccountRole).value<Tp::AccountPtr>());
if (!account->isEnabled()) {
connectionError = i18n("Click checkbox to enable");
}
QRect outerRect(0, 0, option.rect.width(), option.rect.height());
QRect contentRect = outerRect.adjusted(m_hpadding,m_vpadding,-m_hpadding,-m_vpadding); //add some padding
// checkbox
if (isEnabled) {
checkbox->setChecked(true);;
checkbox->setToolTip(i18n("Disable account"));
} else {
checkbox->setChecked(false);
checkbox->setToolTip(i18n("Enable account"));
}
int checkboxLeftMargin = contentRect.left();
int checkboxTopMargin = (outerRect.height() - checkbox->height()) / 2;
checkbox->move(checkboxLeftMargin, checkboxTopMargin);
// changeIconButton
changeIconButton->setIcon(accountIcon);
changeIconButton->setAccount(account);
// At the moment (KDE 4.8.1) decorationSize is not passed from KWidgetItemDelegate
// through the QStyleOptionViewItem, therefore we leave default size unless
// the user has a more recent version.
if (option.decorationSize.width() > -1) {
changeIconButton->setButtonIconSize(option.decorationSize.width());
}
int changeIconButtonLeftMargin = checkboxLeftMargin + checkbox->width();
int changeIconButtonTopMargin = (outerRect.height() - changeIconButton->height()) / 2;
changeIconButton->move(changeIconButtonLeftMargin, changeIconButtonTopMargin);
// statusTextLabel
QFont statusTextFont = option.font;
QPalette statusTextLabelPalette = option.palette;
if (isEnabled) {
statusTextLabel->setEnabled(true);
statusTextFont.setItalic(false);
} else {
statusTextLabel->setDisabled(true);
statusTextFont.setItalic(true);
}
if (isSelected) {
statusTextLabelPalette.setColor(QPalette::Text, statusTextLabelPalette.color(QPalette::Active, QPalette::HighlightedText));
}
statusTextLabel->setPalette(statusTextLabelPalette);
statusTextLabel->setFont(statusTextFont);
statusTextLabel->setText(statusText);
statusTextLabel->setFixedSize(statusTextLabel->fontMetrics().boundingRect(statusText).width(),
statusTextLabel->height());
int statusTextLabelLeftMargin = contentRect.right() - statusTextLabel->width();
int statusTextLabelTopMargin = (outerRect.height() - statusTextLabel->height()) / 2;
statusTextLabel->move(statusTextLabelLeftMargin, statusTextLabelTopMargin);
// statusIconLabel
statusIconLabel->setPixmap(statusIcon.pixmap(KIconLoader::SizeSmall));
//.........这里部分代码省略.........
示例9: displayName
void TypeConstraint::verifyFail(const Func* func, TypedValue* tv,
int id, bool useStrictTypes) const {
VMRegAnchor _;
std::string name = displayName(func);
auto const givenType = describe_actual_type(tv, isHHType());
if (UNLIKELY(!useStrictTypes)) {
if (auto dt = underlyingDataType()) {
// In non-strict mode we may be able to coerce a type failure. For object
// typehints there is no possible coercion in the failure case, but HNI
// builtins currently only guard on kind not class so the following wil
// generate false positives for objects.
if (*dt != KindOfObject) {
// HNI conversions implicitly unbox references, this behavior is wrong,
// in particular it breaks the way type conversion works for PHP 7
// scalar type hints
if (tv->m_type == KindOfRef) {
auto inner = tv->m_data.pref->var()->asTypedValue();
if (tvCoerceParamInPlace(inner, *dt)) {
tvAsVariant(tv) = tvAsVariant(inner);
return;
}
} else {
if (tvCoerceParamInPlace(tv, *dt)) return;
}
}
}
} else if (UNLIKELY(!func->unit()->isHHFile() &&
!RuntimeOption::EnableHipHopSyntax)) {
// PHP 7 allows for a widening conversion from Int to Float. We still ban
// this in HH files.
if (auto dt = underlyingDataType()) {
if (*dt == KindOfDouble && tv->m_type == KindOfInt64 &&
tvCoerceParamToDoubleInPlace(tv)) {
return;
}
}
}
// Handle return type constraint failures
if (id == ReturnId) {
std::string msg;
if (func->isClosureBody()) {
msg =
folly::format(
"Value returned from {}closure must be of type {}, {} given",
func->isAsync() ? "async " : "",
name,
givenType
).str();
} else {
msg =
folly::format(
"Value returned from {}{} {}() must be of type {}, {} given",
func->isAsync() ? "async " : "",
func->preClass() ? "method" : "function",
func->fullName(),
name,
givenType
).str();
}
if (RuntimeOption::EvalCheckReturnTypeHints >= 2 && !isSoft()) {
raise_return_typehint_error(msg);
} else {
raise_warning_unsampled(msg);
}
return;
}
// Handle implicit collection->array conversion for array parameter type
// constraints
auto c = tvToCell(tv);
if (isArray() && !isSoft() && !func->mustBeRef(id) &&
c->m_type == KindOfObject && c->m_data.pobj->isCollection()) {
// To ease migration, the 'array' type constraint will implicitly cast
// collections to arrays, provided the type constraint is not soft and
// the parameter is not by reference. We raise a notice to let the user
// know that there was a type mismatch and that an implicit conversion
// was performed.
raise_notice(
folly::format(
"Argument {} to {}() must be of type {}, {} given; argument {} was "
"implicitly cast to array",
id + 1, func->fullName(), name, givenType, id + 1
).str()
);
tvCastToArrayInPlace(tv);
return;
}
// Handle parameter type constraint failures
if (isExtended() && isSoft()) {
// Soft extended type hints raise warnings instead of recoverable
// errors, to ease migration.
raise_warning_unsampled(
folly::format(
"Argument {} to {}() must be of type {}, {} given",
id + 1, func->fullName(), name, givenType
).str()
);
//.........这里部分代码省略.........
示例10: displayName
QString BareMetalGdbCommandsDeployStepWidget::summaryText() const
{
return displayName();
}
示例11: openCtrl
void
openCtrl(struct display *d)
{
CtrlRec *cr;
const char *dname;
char *sockdir;
struct sockaddr_un sa;
if (!*fifoDir)
return;
if (d)
cr = &d->ctrl, dname = displayName(d);
else
cr = &ctrl, dname = 0;
if (cr->fd < 0) {
if (mkdir(fifoDir, 0755)) {
if (errno != EEXIST) {
logError("mkdir %\"s failed: %m; no control sockets will be available\n",
fifoDir);
return;
}
} else {
chmod(fifoDir, 0755); /* override umask */
}
sockdir = 0;
strApp(&sockdir, fifoDir, dname ? "/dmctl-" : "/dmctl",
dname, (char *)0);
if (sockdir) {
strApp(&cr->path, sockdir, "/socket", (char *)0);
if (cr->path) {
if (strlen(cr->path) >= sizeof(sa.sun_path)) {
logError("path %\"s too long; control socket will not be available\n",
cr->path);
#ifdef HONORS_SOCKET_PERMS
} else if (mkdir(sockdir, 0700) && errno != EEXIST) {
logError("mkdir %\"s failed: %m; control socket will not be available\n",
sockdir);
} else if (unlink(cr->path) && errno != ENOENT) {
logError("unlink %\"s failed: %m; control socket will not be available\n",
cr->path);
} else {
#else
} else if (unlink(sockdir) && errno != ENOENT) {
logError("unlink %\"s failed: %m; control socket will not be available\n",
sockdir);
} else if (!strApp(&cr->realdir, sockdir, "-XXXXXX", (char *)0)) {
} else if (!mkTempDir(cr->realdir)) {
logError("mkdir %\"s failed: %m; control socket will not be available\n",
cr->realdir);
free(cr->realdir);
cr->realdir = 0;
} else if (symlink(cr->realdir, sockdir)) {
logError("symlink %\"s => %\"s failed: %m; control socket will not be available\n",
sockdir, cr->realdir);
rmdir(cr->realdir);
free(cr->realdir);
cr->realdir = 0;
} else {
chown(sockdir, 0, d ? 0 : fifoGroup);
chmod(sockdir, 0750);
#endif
if ((cr->fd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) {
logError("Cannot create control socket: %m\n");
} else {
sa.sun_family = AF_UNIX;
strcpy(sa.sun_path, cr->path);
if (!bind(cr->fd, (struct sockaddr *)&sa, sizeof(sa))) {
if (!listen(cr->fd, 5)) {
#ifdef HONORS_SOCKET_PERMS
chmod(cr->path, 0660);
if (!d)
chown(cr->path, -1, fifoGroup);
chmod(sockdir, 0755);
#else
chmod(cr->path, 0666);
#endif
registerCloseOnFork(cr->fd);
registerInput(cr->fd);
free(sockdir);
return;
}
unlink(cr->path);
logError("Cannot listen on control socket %\"s: %m\n",
cr->path);
} else {
logError("Cannot bind control socket %\"s: %m\n",
cr->path);
}
close(cr->fd);
cr->fd = -1;
}
#ifdef HONORS_SOCKET_PERMS
rmdir(sockdir);
#else
unlink(sockdir);
rmdir(cr->realdir);
free(cr->realdir);
cr->realdir = 0;
#endif
}
//.........这里部分代码省略.........
示例12: getMemberList
void NamespaceDef::writeMemberDocumentation(OutputList &ol,MemberListType lt,const QCString &title)
{
MemberList * ml = getMemberList(lt);
if (ml) ml->writeDocumentation(ol,displayName(),this,title);
}
示例13: fileLoading
void sf2Instrument::openFile( const QString & _sf2File, bool updateTrackName )
{
emit fileLoading();
// Used for loading file
char * sf2Ascii = qstrdup( qPrintable( SampleBuffer::tryToMakeAbsolute( _sf2File ) ) );
QString relativePath = SampleBuffer::tryToMakeRelative( _sf2File );
// free reference to soundfont if one is selected
freeFont();
m_synthMutex.lock();
s_fontsMutex.lock();
// Increment Reference
if( s_fonts.contains( relativePath ) )
{
qDebug() << "Using existing reference to " << relativePath;
m_font = s_fonts[ relativePath ];
m_font->refCount++;
m_fontId = fluid_synth_add_sfont( m_synth, m_font->fluidFont );
}
// Add to map, if doesn't exist.
else
{
m_fontId = fluid_synth_sfload( m_synth, sf2Ascii, true );
if( fluid_synth_sfcount( m_synth ) > 0 )
{
// Grab this sf from the top of the stack and add to list
m_font = new sf2Font( fluid_synth_get_sfont( m_synth, 0 ) );
s_fonts.insert( relativePath, m_font );
}
else
{
collectErrorForUI( sf2Instrument::tr( "A soundfont %1 could not be loaded." ).arg( QFileInfo( _sf2File ).baseName() ) );
// TODO: Why is the filename missing when the file does not exist?
}
}
s_fontsMutex.unlock();
m_synthMutex.unlock();
if( m_fontId >= 0 )
{
// Don't reset patch/bank, so that it isn't cleared when
// someone resolves a missing file
//m_patchNum.setValue( 0 );
//m_bankNum.setValue( 0 );
m_filename = relativePath;
emit fileChanged();
}
delete[] sf2Ascii;
if( updateTrackName || instrumentTrack()->displayName() == displayName() )
{
instrumentTrack()->setName( QFileInfo( _sf2File ).baseName() );
}
}
示例14: DatabaseDetails
DatabaseDetails DatabaseBackendBase::details() const
{
// This code path is only used for database quota delegate calls, so file dates are irrelevant and left uninitialized.
return DatabaseDetails(stringIdentifier(), displayName(), estimatedSize(), 0, 0, 0);
}
示例15: BuildStep
BareMetalGdbCommandsDeployStep::BareMetalGdbCommandsDeployStep(BuildStepList *bsl)
: BuildStep(bsl, stepId())
{
setDefaultDisplayName(displayName());
}