示例#1
0
void DocMetaInfo::scanMetaInfo( bool force )
{
  if ( mLoaded && !force ) return;

  mLanguages = KGlobal::locale()->languagesTwoAlpha();

  kdDebug( 1400 ) << "LANGS: " << mLanguages.join( " " ) << endl;

  QStringList::ConstIterator it;
  for( it = mLanguages.begin(); it != mLanguages.end(); ++it ) {
    mLanguageNames.insert( *it, languageName( *it ) );
  }

  KConfig config( "khelpcenterrc" );
  config.setGroup( "General" );
  QStringList metaInfos = config.readListEntry( "MetaInfoDirs" );

  if ( metaInfos.isEmpty() ) {
    KStandardDirs* kstd = KGlobal::dirs();
    kstd->addResourceType( "data", "share/apps/khelpcenter" );
    metaInfos = kstd->findDirs( "data", "plugins" );
  }
  for( it = metaInfos.begin(); it != metaInfos.end(); it++) {
    kdDebug() << "DocMetaInfo::scanMetaInfo(): scanning " << *it << endl;
    scanMetaInfoDir( *it, &mRootEntry );
  }

  mLoaded = true;
}
示例#2
0
int main(int argc, char **argv)
{
    KAboutData about("kapptemplate", 0, ki18n("KAppTemplate"), version, ki18n(description),
                     KAboutData::License_GPL, ki18n("(C) 2008 Anne-Marie Mahfouf"),KLocalizedString(), 0, "*****@*****.**");
    about.addAuthor( ki18n("Anne-Marie Mahfouf"), KLocalizedString(), "annma AT kde DOT org");
    about.addAuthor( ki18n("Sean Wilson"), ki18n("Icons from Oxygen Team icons"), "suseux AT googlemail DOT com");
    
    KCmdLineArgs::init(argc, argv, &about);

    KCmdLineOptions options;
    KCmdLineArgs::addCmdLineOptions(options);
    KApplication app;

    KStandardDirs* dirs = KGlobal::dirs();
    dirs->addResourceType( "apptemplates", "data", "kdevappwizard/templates/" );
    dirs->addResourceType( "apptemplate_descriptions", "data", "kdevappwizard/template_descriptions/" );
    dirs->addResourceType( "apptemplate_previews", "data", "kdevappwizard/template_previews/" );

    KAppTemplate appTemplate(0);
    appTemplate.show();


    return app.exec();
}