本文整理汇总了C++中KStandardDirs::addResourceType方法的典型用法代码示例。如果您正苦于以下问题:C++ KStandardDirs::addResourceType方法的具体用法?C++ KStandardDirs::addResourceType怎么用?C++ KStandardDirs::addResourceType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KStandardDirs
的用法示例。
在下文中一共展示了KStandardDirs::addResourceType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scanMetaInfo
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: main
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, "[email protected]");
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();
}