当前位置: 首页>>代码示例>>C++>>正文


C++ QCString函数代码示例

本文整理汇总了C++中QCString函数的典型用法代码示例。如果您正苦于以下问题:C++ QCString函数的具体用法?C++ QCString怎么用?C++ QCString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了QCString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的QCString函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。