本文整理汇总了C++中QCString函数的典型用法代码示例。如果您正苦于以下问题:C++ QCString函数的具体用法?C++ QCString怎么用?C++ QCString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了QCString函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: sendSignal
void KNNntpClient::doPostArticle()
{
KNLocalArticle *art = static_cast<KNLocalArticle *>(job->data());
sendSignal(TSsendArticle);
if(art->messageID(false) != 0)
{
int rep;
if(!sendCommand(QCString("STAT ") + art->messageID(false)->as7BitString(false), rep))
return;
if(rep == 223) // 223 n <a> article retrieved - request text separately
{
#ifndef NDEBUG
qDebug("knode: STAT successful, we have probably already sent this article.");
#endif
return; // the article is already on the server, lets put it silently into the send folder
}
}
if(!sendCommandWCheck("POST", 340)) // 340 send article to be posted. End with <CR-LF>.<CR-LF>
return;
if(art->messageID(false) == 0) // article has no message ID => search for a ID in the response
{
QCString s = getCurrentLine();
int start = s.findRev(QRegExp("<[^\\s]*@[^\\s]*>"));
if(start != -1) // post response includes a recommended id
{
int end = s.find('>', start);
art->messageID()->from7BitString(s.mid(start, end - start + 1));
art->assemble();
#ifndef NDEBUG
qDebug("knode: using the message-id recommended by the server: %s", s.mid(start, end - start + 1).data());
#endif
}
}
if(!sendMsg(art->encodedContent(true)))
return;
if(!checkNextResponse(240)) // 240 article posted ok
return;
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:45,代码来源:knnntpclient.cpp
示例2: KonferencePart
KParts::Part* KonferencePartFactory::createPartObject( QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name,
const char *classname, const QStringList &args )
{
// Create an instance of our Part
KonferencePart* obj = new KonferencePart( parentWidget, widgetName, parent, name );
// See if we are to be read-write or not
if (QCString(classname) == "KParts::ReadOnlyPart")
{
//this is only here, so that the compiler not complains about unused variables
}
//this as well
QString tmp = args.first();
//obj->setReadWrite(false);
return obj;
}
开发者ID:willemwouters,项目名称:Dump,代码行数:19,代码来源:konference_part.cpp
示例3: RemoveActionFromToolBarCommand
void QDesignerToolBar::buttonMouseMoveEvent( QMouseEvent *e, QObject *o )
{
if ( widgetInserting || ( e->state() & LeftButton ) == 0 )
return;
if ( QABS( QPoint( dragStartPos - e->pos() ).manhattanLength() ) < QApplication::startDragDistance() )
return;
QMap<QWidget*, QAction*>::Iterator it = actionMap.find( (QWidget*)o );
if ( it == actionMap.end() )
return;
QAction *a = *it;
if ( !a )
return;
int index = actionList.find( a );
RemoveActionFromToolBarCommand *cmd =
new RemoveActionFromToolBarCommand( tr( "Delete Action '%1' from Toolbar '%2'" ).
arg( a->name() ).arg( caption() ),
formWindow, a, this, index );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
QApplication::sendPostedEvents();
adjustSize();
QString type = ::qt_cast<QActionGroup*>(a) ? QString( "application/x-designer-actiongroup" ) :
::qt_cast<QSeparatorAction*>(a) ? QString( "application/x-designer-separator" ) : QString( "application/x-designer-actions" );
QStoredDrag *drag = new QStoredDrag( type, this );
QString s = QString::number( (long)a ); // #### huha, that is evil
drag->setEncodedData( QCString( s.latin1() ) );
drag->setPixmap( a->iconSet().pixmap() );
if ( ::qt_cast<QDesignerAction*>(a) ) {
if ( formWindow->widgets()->find( ( (QDesignerAction*)a )->widget() ) )
formWindow->selectWidget( ( (QDesignerAction*)a )->widget(), FALSE );
}
if ( !drag->drag() ) {
AddActionToToolBarCommand *cmd = new AddActionToToolBarCommand( tr( "Add Action '%1' to Toolbar '%2'" ).
arg( a->name() ).arg( caption() ),
formWindow, a, this, index );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
}
lastIndicatorPos = QPoint( -1, -1 );
indicator->hide();
}
开发者ID:app,项目名称:ananas-labs,代码行数:42,代码来源:actiondnd.cpp
示例4: while
void OutputList::parseDoc(const char *fileName,int startLine,
Definition *ctx,MemberDef * md,
const QCString &docStr,bool indexWords,
bool isExample,const char *exampleName,
bool singleLine,bool linkFromIndex)
{
int count=0;
if (docStr.isEmpty()) return;
OutputGenerator *og=outputs->first();
while (og)
{
if (og->isEnabled()) count++;
og=outputs->next();
}
if (count==0) return; // no output formats enabled.
DocNode *root=0;
if (docStr.at(docStr.length()-1)=='\n')
{
root = validatingParseDoc(fileName,startLine,
ctx,md,docStr,indexWords,isExample,exampleName,
singleLine,linkFromIndex);
}
else
{
root = validatingParseDoc(fileName,startLine,
ctx,md,docStr+"\n",indexWords,isExample,exampleName,
singleLine,linkFromIndex);
}
og=outputs->first();
while (og)
{
//printf("og->printDoc(extension=%s)\n",
// ctx?ctx->getDefFileExtension().data():"<null>");
if (og->isEnabled()) og->printDoc(root,ctx?ctx->getDefFileExtension():QCString(""));
og=outputs->next();
}
delete root;
}
开发者ID:tuxdna,项目名称:Doxygen,代码行数:42,代码来源:outputlist.cpp
示例5: serviceStateChanged
void ServiceListener::slotDBusSignal( const QDBusMessage& message )
{
odebug << "ConnMan: " << message.member() << oendl;
if( message.member() == "PropertyChanged" ) {
QString prop = message[0].toString();
if( prop == "State" ) {
QString oldState = m_state;
QString newState = message[1].toVariant().value.toString();
if( oldState != newState ) {
emit serviceStateChanged( QDBusObjectPath( QCString( m_proxy->path() )), oldState, newState );
m_state = newState;
sendSignalStrength();
}
}
else if( prop == "Strength" ) {
m_strength = message[1].toVariant().value.toByte();
sendSignalStrength();
}
}
}
开发者ID:opieproject,项目名称:opie,代码行数:20,代码来源:service.cpp
示例6: while
void MetaTranslator::stripEmptyContexts()
{
TMM newmm;
TMM::Iterator m = mm.begin();
while ( m != mm.end() ) {
if ( QCString(m.key().sourceText()) == ContextComment ) {
TMM::Iterator n = m;
++n;
// the context comment is followed by other messages
if ( n != newmm.end() &&
qstrcmp(m.key().context(), n.key().context()) == 0 )
newmm.insert( m.key(), *m );
} else {
newmm.insert( m.key(), *m );
}
++m;
}
mm = newmm;
}
开发者ID:OS2World,项目名称:LIB-QT3_Toolkit_Vbox,代码行数:20,代码来源:metatranslator.cpp
示例7: if
void KGPGFile::close(void)
{
// qDebug("KGPGFile::close()");
if(!isOpen()) {
// qDebug("File not open");
return;
}
// finish the KProcess and clean up things
if(m_process) {
if(isWritable()) {
// qDebug("Finish writing");
if(m_process->isRunning()) {
m_process->closeStdin();
// now wait for GPG to finish
m_needExitLoop = true;
qApp->enter_loop();
} else
m_process->kill();
} else if(isReadable()) {
// qDebug("Finish reading");
if(m_process->isRunning()) {
m_process->closeStdout();
// now wait for GPG to finish
m_needExitLoop = true;
qApp->enter_loop();
} else
m_process->kill();
}
}
m_ungetchBuffer = QCString();
setState(0);
m_recipient.clear();
// qDebug("File closed");
}
开发者ID:sajidji94,项目名称:kmymoney2,代码行数:36,代码来源:kgpgfile.cpp
示例8: while
void Nntp::parseArticle()
{
if ( !commandSocket->canReadLine() )
return;
// read an article one line after the other
while ( commandSocket->canReadLine() ) {
QString s = commandSocket->readLine();
// if the line starts with a dot, we finished reading something
if ( s[ 0 ] == '.' ) {
readArticle = FALSE;
operationInProgress()->setState( StDone );
emit finished( operationInProgress() );
return;
}
if ( s.right( 1 ) == "\n" )
s.remove( s.length() - 1, 1 );
// emit the new data of the article which we read
emit data( QCString( s.ascii() ), operationInProgress() );
}
}
开发者ID:AliYousuf,项目名称:univ-aca-mips,代码行数:24,代码来源:nntp.cpp
示例9: nextPart
void SearchIndex::addWord(const char *word,bool hiPriority,bool recurse)
{
static QRegExp nextPart("[_a-z:][A-Z]");
if (word==0 || word[0]=='\0') return;
QCString wStr = QCString(word).lower();
//printf("SearchIndex::addWord(%s,%d) wStr=%s\n",word,hiPriority,wStr.data());
IndexWord *w = m_words[wStr];
if (w==0)
{
int idx=charsToIndex(wStr);
//fprintf(stderr,"addWord(%s) at index %d\n",word,idx);
if (idx<0) return;
w = new IndexWord(wStr);
m_index[idx]->append(w);
m_words.insert(wStr,w);
}
w->addUrlIndex(m_urlIndex,hiPriority);
int i;
bool found=FALSE;
if (!recurse) // the first time we check if we can strip the prefix
{
i=getPrefixIndex(word);
if (i>0)
{
addWord(word+i,hiPriority,TRUE);
found=TRUE;
}
}
if (!found) // no prefix stripped
{
if ((i=nextPart.match(word))>=1)
{
addWord(word+i+1,hiPriority,TRUE);
}
}
}
开发者ID:basvodde,项目名称:doxygen,代码行数:36,代码来源:searchindex.cpp
示例10: definitionType
QCString Definition::briefDescriptionAsTooltip() const
{
if (m_impl->brief)
{
if (m_impl->brief->tooltip.isEmpty() && !m_impl->brief->doc.isEmpty())
{
static bool reentering=FALSE;
if (!reentering)
{
/* MemberDef *md = definitionType()==TypeMember ? (MemberDef*)this : 0;
const Definition *scope = definitionType()==TypeMember ? getOuterScope() : this;
reentering=TRUE; // prevent requests for tooltips while parsing a tooltip
m_impl->brief->tooltip = parseCommentAsText(
scope,md,
m_impl->brief->doc,
m_impl->brief->file,
m_impl->brief->line);
reentering=FALSE;
*/ }
}
return m_impl->brief->tooltip;
}
return QCString("");
}
开发者ID:kevinoupeng,项目名称:mydg,代码行数:24,代码来源:definition.cpp
示例11: KMainWindow
servercontroller::servercontroller( QWidget*, const char* name )
: KMainWindow( 0, name )
{
we_are_exiting = false;
m_notificationCount = 0;
m_ncm = new nickColourMaker();
MenuBar = menuBar();
KWin::setIcons( winId(), kapp->icon(), kapp->miniIcon() );
s_self = this;
switch (ksopts->displayMode)
{
case KSOptions::SDI:
displayMgr = new DisplayMgrSDI();
break;
case KSOptions::MDI:
displayMgr = new DisplayMgrMDI();
break;
}
sci = new scInside(this, QCString(name) + "_mainview");
setCentralWidget(sci);
sci->setFrameStyle(QFrame::Box | QFrame::Raised);
ConnectionTree = sci->ConnectionTree;
connect(ConnectionTree, SIGNAL(clicked( QListViewItem * )),
this, SLOT(WindowSelected(QListViewItem *)));
setFrameBorderWidth(5);
QPopupMenu *file = new QPopupMenu(this, QCString(name) + "_menu_file");
KStdAction::quit(this, SLOT(endksirc()), actionCollection())->plug(file);
#ifndef NDEBUG
file->insertItem(i18n("Dump Object Tree"), this, SLOT(dump_obj()));
file->insertItem(i18n("Server Debug Window"), this, SLOT(server_debug()));
#endif
MenuBar->insertItem(i18n("&File"), file);
connections = new QPopupMenu(this, QCString(name) + "_menu_connections");
server_id = connections->insertItem(i18n("&New Server..."), this, SLOT(new_connection()), Key_F2 );
join_id = connections->insertItem(i18n("&Join Channel..."), this, SLOT(new_channel()), Key_F3 );
connections->insertSeparator();
connections->insertItem(i18n("&Do Autoconnect..."), this, SLOT(start_autoconnect_check()));
connections->setItemEnabled(join_id, FALSE);
MenuBar->insertItem(i18n("&Connections"), connections);
options = new QPopupMenu(this, QCString(name) + "_menu_options");
options->setCheckable(TRUE);
options->insertItem(SmallIcon( "filter" ), i18n("&Filter Rule Editor..."),
this, SLOT(filter_rule_editor()));
options->insertSeparator();
KStdAction::configureNotifications(this, SLOT(notification_prefs()), actionCollection())->plug(options);
KStdAction::preferences(this, SLOT(general_prefs()), actionCollection())->plug(options);
MenuBar->insertItem(i18n("&Settings"), options);
KHelpMenu *help = new KHelpMenu( this, kapp->aboutData() );
MenuBar->insertItem( KStdGuiItem::help().text(), help->menu() );
m_kga = new KGlobalAccel(this, "globalAccess");
m_kga->insert("New Server", i18n("New Server"),
i18n("This action allows you to open a new server more easily "
"when in docked mode, since you don't need to click on the "
"dock icon."),
ALT+CTRL+Key_C, KKey::QtWIN+CTRL+Key_C, this,
SLOT(new_connection()));
open_toplevels = 0;
pic_server = UserIcon("server");
pic_gf = UserIcon("ksirc_a");
pic_run = UserIcon("mini-run");
pic_ppl = UserIcon("channels");
pic_icon = UserIcon("ksirc_b");
setCaption( i18n("Server Control") );
KWin::setIcons(winId(), pic_icon, pic_server);
resize( 450,200 );
dockWidget = new dockServerController(this, 0x0, "servercontroller_dock");
KWin::setSystemTrayWindowFor( dockWidget->winId(), winId() );
m_kga->readSettings();
m_kga->updateConnections();
checkDocking();
}
开发者ID:serghei,项目名称:kde3-kdenetwork,代码行数:95,代码来源:servercontroller.cpp
示例12: assert
void SearchIndex::setCurrentDoc(Definition *ctx,const char *anchor,bool isSourceFile)
{
if (ctx==0) return;
assert(!isSourceFile || ctx->definitionType()==Definition::TypeFile);
//printf("SearchIndex::setCurrentDoc(%s,%s,%s)\n",name,baseName,anchor);
QCString url=isSourceFile ? ((FileDef*)ctx)->getSourceFileBase() : ctx->getOutputFileBase();
url+=Config_getString("HTML_FILE_EXTENSION");
if (anchor) url+=QCString("#")+anchor;
QCString name=ctx->qualifiedName();
if (ctx->definitionType()==Definition::TypeMember)
{
MemberDef *md = (MemberDef *)ctx;
name.prepend((md->getLanguage()==SrcLangExt_Fortran ?
theTranslator->trSubprogram(TRUE,TRUE) :
theTranslator->trMember(TRUE,TRUE))+" ");
}
else // compound type
{
SrcLangExt lang = ctx->getLanguage();
QCString sep = getLanguageSpecificSeparator(lang);
if (sep!="::")
{
name = substitute(name,"::",sep);
}
switch (ctx->definitionType())
{
case Definition::TypePage:
{
PageDef *pd = (PageDef *)ctx;
if (!pd->title().isEmpty())
{
name = theTranslator->trPage(TRUE,TRUE)+" "+pd->title();
}
else
{
name = theTranslator->trPage(TRUE,TRUE)+" "+pd->name();
}
}
break;
case Definition::TypeClass:
{
ClassDef *cd = (ClassDef *)ctx;
name.prepend(cd->compoundTypeString()+" ");
}
break;
case Definition::TypeNamespace:
{
if (lang==SrcLangExt_Java || lang==SrcLangExt_CSharp)
{
name = theTranslator->trPackage(name);
}
else if (lang==SrcLangExt_Fortran)
{
name.prepend(theTranslator->trModule(TRUE,TRUE)+" ");
}
else
{
name.prepend(theTranslator->trNamespace(TRUE,TRUE)+" ");
}
}
break;
case Definition::TypeGroup:
{
GroupDef *gd = (GroupDef *)ctx;
if (gd->groupTitle())
{
name = theTranslator->trGroup(TRUE,TRUE)+" "+gd->groupTitle();
}
else
{
name.prepend(theTranslator->trGroup(TRUE,TRUE)+" ");
}
}
break;
default:
break;
}
}
int *pIndex = m_url2IdMap.find(url);
if (pIndex==0)
{
++m_urlIndex;
m_url2IdMap.insert(url,new int(m_urlIndex));
m_urls.insert(m_urlIndex,new URL(name,url));
}
else
{
m_urls.insert(*pIndex,new URL(name,url));
}
}
开发者ID:basvodde,项目名称:doxygen,代码行数:91,代码来源:searchindex.cpp
示例13: generatePlantUMLOutput
void generatePlantUMLOutput(const char *baseName,const char *outDir,PlantUMLOutputFormat format)
{
static QCString plantumlJarPath = Config_getString("PLANTUML_JAR_PATH");
QCString pumlExe = "java";
QCString pumlArgs = "";
QStrList &pumlIncludePathList = Config_getList("PLANTUML_INCLUDE_PATH");
char *s=pumlIncludePathList.first();
if (s)
{
pumlArgs += "-Dplantuml.include.path=\"";
pumlArgs += s;
s = pumlIncludePathList.next();
}
while (s)
{
pumlArgs += portable_pathListSeparator();
pumlArgs += s;
s = pumlIncludePathList.next();
}
if (pumlIncludePathList.first()) pumlArgs += "\" ";
pumlArgs += "-Djava.awt.headless=true -jar \""+plantumlJarPath+"plantuml.jar\" ";
pumlArgs+="-o \"";
pumlArgs+=outDir;
pumlArgs+="\" ";
QCString extension;
switch (format)
{
case PUML_BITMAP:
pumlArgs+="-tpng";
extension=".png";
break;
case PUML_EPS:
pumlArgs+="-teps";
extension=".eps";
break;
case PUML_SVG:
pumlArgs+="-tsvg";
extension=".svg";
break;
}
pumlArgs+=" \"";
pumlArgs+=baseName;
pumlArgs+=".pu\" ";
pumlArgs+="-charset " + Config_getString("INPUT_ENCODING") + " ";
int exitCode;
//printf("*** running: %s %s outDir:%s %s\n",pumlExe.data(),pumlArgs.data(),outDir,outFile);
msg("Running PlantUML on generated file %s.pu\n",baseName);
portable_sysTimerStart();
if ((exitCode=portable_system(pumlExe,pumlArgs,FALSE))!=0)
{
err("Problems running PlantUML. Verify that the command 'java -jar \"%splantuml.jar\" -h' works from the command line. Exit code: %d\n",
plantumlJarPath.data(),exitCode);
}
else if (Config_getBool("DOT_CLEANUP"))
{
QFile(QCString(baseName)+".pu").remove();
}
portable_sysTimerStop();
if ( (format==PUML_EPS) && (Config_getBool("USE_PDFLATEX")) )
{
QCString epstopdfArgs(maxCmdLine);
epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"",baseName,baseName);
portable_sysTimerStart();
if (exitCode=portable_system("epstopdf",epstopdfArgs)!=0)
{
err("Problems running epstopdf. Check your TeX installation! Exit code: %d\n",exitCode);
}
portable_sysTimerStop();
}
}
开发者ID:drxaero,项目名称:doxygen,代码行数:72,代码来源:plantuml.cpp
示例14: generateJSNavTree
static void generateJSNavTree(const QList<FTVNode> &nodeList)
{
QCString htmlOutput = Config_getString("HTML_OUTPUT");
QFile f(htmlOutput+"/navtreedata.js");
NavIndexEntryList navIndex;
if (f.open(IO_WriteOnly) /*&& fidx.open(IO_WriteOnly)*/)
{
//FTextStream tidx(&fidx);
//tidx << "var NAVTREEINDEX =" << endl;
//tidx << "{" << endl;
FTextStream t(&f);
t << "var NAVTREE =" << endl;
t << "[" << endl;
t << " [ ";
QCString &projName = Config_getString("PROJECT_NAME");
if (projName.isEmpty())
{
if (Doxygen::mainPage && !Doxygen::mainPage->title().isEmpty()) // Use title of main page as root
{
t << "\"" << convertToJSString(Doxygen::mainPage->title()) << "\", ";
}
else // Use default section title as root
{
LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::MainPage);
t << "\"" << convertToJSString(lne->title()) << "\", ";
}
}
else // use PROJECT_NAME as root tree element
{
t << "\"" << convertToJSString(projName) << "\", ";
}
t << "\"index" << Doxygen::htmlFileExtension << "\", ";
// add special entry for index page
navIndex.append(new NavIndexEntry("index"+Doxygen::htmlFileExtension,""));
// related page index is written as a child of index.html, so add this as well
navIndex.append(new NavIndexEntry("pages"+Doxygen::htmlFileExtension,""));
bool first=TRUE;
generateJSTree(navIndex,t,nodeList,1,first);
if (first)
t << "]" << endl;
else
t << endl << " ] ]" << endl;
t << "];" << endl << endl;
// write the navigation index (and sub-indices)
navIndex.sort();
int subIndex=0;
int elemCount=0;
const int maxElemCount=250;
//QFile fidx(htmlOutput+"/navtreeindex.js");
QFile fsidx(htmlOutput+"/navtreeindex0.js");
if (/*fidx.open(IO_WriteOnly) &&*/ fsidx.open(IO_WriteOnly))
{
//FTextStream tidx(&fidx);
FTextStream tsidx(&fsidx);
t << "var NAVTREEINDEX =" << endl;
t << "[" << endl;
tsidx << "var NAVTREEINDEX" << subIndex << " =" << endl;
tsidx << "{" << endl;
QListIterator<NavIndexEntry> li(navIndex);
NavIndexEntry *e;
bool first=TRUE;
for (li.toFirst(); (e=li.current());) // for each entry
{
if (elemCount==0)
{
if (!first)
{
t << "," << endl;
}
else
{
first=FALSE;
}
t << "\"" << e->url << "\"";
}
tsidx << "\"" << e->url << "\":[" << e->path << "]";
++li;
if (li.current() && elemCount<maxElemCount-1) tsidx << ","; // not last entry
tsidx << endl;
elemCount++;
if (li.current() && elemCount>=maxElemCount) // switch to new sub-index
{
tsidx << "};" << endl;
elemCount=0;
fsidx.close();
subIndex++;
fsidx.setName(htmlOutput+"/navtreeindex"+QCString().setNum(subIndex)+".js");
if (!fsidx.open(IO_WriteOnly)) break;
tsidx.setDevice(&fsidx);
tsidx << "var NAVTREEINDEX" << subIndex << " =" << endl;
tsidx << "{" << endl;
}
}
tsidx << "};" << endl;
t << endl << "];" << endl;
//.........这里部分代码省略.........
开发者ID:LianYangCn,项目名称:doxygen,代码行数:101,代码来源:ftvhelp.cpp
示例15: kdemain
extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
{
{
QCString multiHead = getenv("KDE_MULTIHEAD");
if(multiHead.lower() == "true")
{
Display *dpy = XOpenDisplay(NULL);
if(!dpy)
{
fprintf(stderr, "%s: FATAL ERROR: couldn't open display %s\n", argv[0], XDisplayName(NULL));
exit(1);
}
int number_of_screens = ScreenCount(dpy);
kicker_screen_number = DefaultScreen(dpy);
int pos;
QCString display_name = XDisplayString(dpy);
XCloseDisplay(dpy);
dpy = 0;
if((pos = display_name.findRev('.')) != -1)
display_name.remove(pos, 10);
QCString env;
if(number_of_screens != 1)
{
for(int i = 0; i < number_of_screens; i++)
{
if(i != kicker_screen_number && fork() == 0)
{
kicker_screen_number = i;
// break here because we are the child process, we don't
// want to fork() anymore
break;
}
}
env.sprintf("DISPLAY=%s.%d", display_name.data(), kicker_screen_number);
if(putenv(strdup(env.data())))
{
fprintf(stderr, "%s: WARNING: unable to set DISPLAY environment variable\n", argv[0]);
perror("putenv()");
}
}
}
}
KGlobal::locale()->setMainCatalogue("kicker");
QCString appname;
if(kicker_screen_number == 0)
appname = "kicker";
else
appname.sprintf("kicker-screen-%d", kicker_screen_number);
KAboutData aboutData(appname.data(), I18N_NOOP("KDE Panel"), version, description, KAboutData::License_BSD,
I18N_NOOP("(c) 1999-2004, The KDE Team"));
aboutData.addAuthor("Aaron J. Seigo", I18N_NOOP("Current maintainer"), "[email protected]");
aboutData.addAuthor("Matthias Elter", 0, "[email protected]");
aboutData.addAuthor("Matthias Ettrich", 0, "[email protected]");
aboutData.addAuthor("Wilco Greven", 0, "[email protected]");
aboutData.addAuthor("Rik Hemsley", 0, "[email protected]");
aboutData.addAuthor("Daniel M. Duley", 0, "[email protected]");
aboutData.addAuthor("Preston Brown", 0, "[email protected]");
aboutData.addAuthor("John Firebaugh", 0, "[email protected]");
aboutData.addAuthor("Waldo Bastian", I18N_NOOP("Kiosk mode"), "[email protected]");
aboutData.addCredit("Jessica Hall", /* I18N_NOOP("KConfigXT") */ 0, "[email protected]");
aboutData.addCredit("Stefan Nikolaus", /* I18N_NOOP("Bug fixes") */ 0, "[email protected]");
aboutData.addCredit("Benoît Minisini", /* I18N_NOOP("Bug fixes") */ 0, "[email protected]");
KCmdLineArgs::init(argc, argv, &aboutData);
if(!Kicker::start())
{
kdError() << "kicker is already running!" << endl;
return 0;
}
if(signal(SIGTERM, sighandler) == SIG_IGN)
signal(SIGTERM, SIG_IGN);
if(signal(SIGINT, sighandler) == SIG_IGN)
signal(SIGINT, SIG_IGN);
if(signal(SIGHUP, sighandler) == SIG_IGN)
signal(SIGHUP, SIG_IGN);
// send it even before KApplication ctor, because ksmserver will launch another app as soon
// as QApplication registers with it
DCOPClient *cl = new DCOPClient;
cl->attach();
DCOPRef r("ksmserver", "ksmserver");
r.setDCOPClient(cl);
r.send("suspendStartup", QCString("kicker"));
delete cl;
Kicker *kicker = new Kicker;
int rv = kicker->exec();
delete kicker;
return rv;
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:100,代码来源:main.cpp
示例16: TagAnchorInfo
TagAnchorInfo(const QCString &f,
const QCString &l,
const QCString &t=QCString())
: label(l), fileName(f), title(t) {}
开发者ID:kaos,项目名称:doxygen,代码行数:4,代码来源:tagreader.cpp
示例17: countDecMembers
void MemberList::writePlainDeclarations(OutputList &ol,
ClassDef *cd,NamespaceDef *nd,FileDef *fd,
GroupDef *gd, const DefinitionIntf::DefType compoundType,
ClassDef *inheritedFrom,const char *inheritId
)
{
//printf("----- writePlainDeclaration() ----\n");
countDecMembers();
if (numDecMembers()==0)
{
//printf(" --> no members!\n");
return; // no members in this list
}
//printf(" --> writePlainDeclaration() numDecMembers()=%d\n",
// numDecMembers());
ol.pushGeneratorState();
bool first=TRUE;
MemberDef *md;
MemberListIterator mli(*this);
for ( ; (md=mli.current()); ++mli )
{
//printf(">>> Member `%s' type=%d visible=%d\n",
// md->name().data(),md->memberType(),md->isBriefSectionVisible());
if ((inheritedFrom==0 || !md->isReimplementedBy(inheritedFrom)) &&
md->isBriefSectionVisible())
{
//printf(">>> rendering\n");
switch(md->memberType())
{
case MemberType_Define: // fall through
//case MemberType_Prototype: // fall through
case MemberType_Typedef: // fall through
case MemberType_Variable: // fall through
case MemberType_Function: // fall through
case MemberType_Signal: // fall through
case MemberType_Slot: // fall through
case MemberType_DCOP: // fall through
case MemberType_Property: // fall through
case MemberType_Interface: // fall through
case MemberType_Service: // fall through
case MemberType_Event:
{
if (first) ol.startMemberList(),first=FALSE;
md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup,compoundType,inheritedFrom,inheritId);
break;
}
case MemberType_Enumeration:
{
int enumVars=0;
MemberListIterator vmli(*this);
MemberDef *vmd;
QCString name(md->name());
int i=name.findRev("::");
if (i!=-1) name=name.right(name.length()-i-2); // strip scope (TODO: is this needed?)
if (name[0]=='@') // anonymous enum => append variables
{
for ( ; (vmd=vmli.current()) ; ++vmli)
{
QCString vtype=vmd->typeString();
if ((vtype.find(name))!=-1)
{
enumVars++;
vmd->setAnonymousEnumType(md);
}
}
}
// if this is an anonymous enum and there are variables of this
// enum type (i.e. enumVars>0), then we do not show the enum here.
if (enumVars==0) // show enum here
{
//printf("Enum!!\n");
if (first)
{
ol.startMemberList();
first=FALSE;
}
ol.startMemberDeclaration();
ol.startMemberItem(md->anchor(),0,inheritId);
bool detailsLinkable = md->isDetailedSectionLinkable();
if (!detailsLinkable)
{
ol.startDoxyAnchor(md->getOutputFileBase(),0,md->anchor(),md->name(),QCString());
}
ol.writeString("enum ");
ol.insertMemberAlign();
md->writeEnumDeclaration(ol,cd,nd,fd,gd,compoundType);
if (!detailsLinkable)
{
ol.endDoxyAnchor(md->getOutputFileBase(),md->anchor());
}
ol.endMemberItem();
if (!md->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
{
DocRoot *rootNode = validatingParseDoc(
md->briefFile(),md->briefLine(),
cd,md,
md->briefDescription(),
TRUE,FALSE,0,TRUE,FALSE
//.........这里部分代码省略.........
开发者ID:Acidburn0zzz,项目名称:doxygen,代码行数:101,代码来源:memberlist.cpp
示例18: Config_getBool
void ClangParser::start(const char *fileName,QStrList &filesInTranslationUnit)
{
static bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING);
static QStrList &includePath = Config_getList(INCLUDE_PATH);
static QStrList clangOptions = Config_getList(CLANG_OPTIONS);
static QCString clangCompileDatabase = Config_getList(CLANG_COMPILATION_DATABASE_PATH);
if (!clangAssistedParsing) return;
//printf("ClangParser::start(%s)\n",fileName);
p->fileName = fileName;
p->index = clang_createIndex(0, 0);
p->curLine = 1;
p->curToken = 0;
QDictIterator<void> di(Doxygen::inputPaths);
int argc=0;
std::string error;
// load a clang compilation database (https://clang.llvm.org/docs/JSONCompilationDatabase.html)
// this only needs to be loaded once, and could be refactored to a higher level function
static std::unique_ptr<clang::tooling::CompilationDatabase> db =
clang::tooling::CompilationDatabase::loadFromDirectory(clangCompileDatabase.data(), error);
int clang_option_len = 0;
std::vector<clang::tooling::CompileCommand> command;
if (strcmp(clangCompileDatabase, "0") != 0) {
if (db == nullptr) {
// user specified a path, but DB file was not found
err("%s using clang compilation database path of: \"%s\"\n", error.c_str(),
clangCompileDatabase.data());
} else {
// check if the file we are parsing is in the DB
command = db->getCompileCommands(fileName);
if (!command.empty() ) {
// it's possible to have multiple entries for the same file, so use the last entry
clang_option_len = command[command.size()-1].CommandLine.size();
}
}
}
char **argv = (char**)malloc(sizeof(char*)*(4+Doxygen::inputPaths.count()+includePath.count()+clangOptions.count()+clang_option_len));
if (!command.empty() ) {
std::vector<std::string> options = command[command.size()-1].CommandLine;
// copy each compiler option used from the database. Skip the first which is compiler exe.
for (auto option = options.begin()+1; option != options.end(); option++) {
argv[argc++] = strdup(option->c_str());
}
// this extra addition to argv is accounted for as we are skipping the first entry in
argv[argc++]=strdup("-w"); // finally, turn off warnings.
} else {
// add include paths for input files
for (di.toFirst();di.current();++di,++argc)
{
QCString inc = QCString("-I")+di.currentKey();
argv[argc]=strdup(inc.data());
//printf("argv[%d]=%s\n",argc,argv[argc]);
}
// add external include paths
for (uint i=0;i<includePath.count();i++)
{
QCString inc = QCString("-I")+includePath.at(i);
argv[argc++]=strdup(inc.data());
}
// user specified options
for (uint i=0;i<clangOptions.count();i++)
{
argv[argc++]=strdup(clangOptions.at(i));
}
// extra options
argv[argc++]=strdup("-ferror-limit=0");
argv[argc++]=strdup("-x");
// Since we can be presented with a .h file that can contain C/C++ or
// Objective C code and we need to configure the parser before knowing this,
// we use the source file to detected the language. Detection will fail if you
// pass a bunch of .h files containing ObjC code, and no sources :-(
SrcLangExt lang = getLanguageFromFileName(fileName);
if (lang==SrcLangExt_ObjC || p->detectedLang!=ClangParser::Private::Detected_Cpp)
{
QCString fn = fileName;
if (p->detectedLang==ClangParser::Private::Detected_Cpp &&
(fn.right(4).lower()==".cpp" || fn.right(4).lower()==".cxx" ||
fn.right(3).lower()==".cc" || fn.right(2).lower()==".c"))
{ // fall back to C/C++ once we see an extension that indicates this
p->detectedLang = ClangParser::Private::Detected_Cpp;
}
else if (fn.right(3).lower()==".mm") // switch to Objective C++
{
p->detectedLang = ClangParser::Private::Detected_ObjCpp;
}
else if (fn.right(2).lower()==".m") // switch to Objective C
{
p->detectedLang = ClangParser::Private::Detected_ObjC;
}
}
switch(p->detectedLang)
{
case ClangParser::Private::Detected_Cpp:
argv[argc++]=strdup("c++");
break;
case ClangParser::Private::Detected_ObjC:
argv[argc++]=strdup("objective-c");
break;
case ClangParser::Private::Detected_ObjCpp:
argv[argc++]=strdup("objective-c++");
//.........这里部分代码省略.........
开发者ID:bithium,项目名称:doxygen,代码行数:101,代码来源:clangparser.cpp
注:本文中的QCString函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论