本文整理汇总了C++中ksharedconfig::Ptr::checkUpdate方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::checkUpdate方法的具体用法?C++ Ptr::checkUpdate怎么用?C++ Ptr::checkUpdate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ksharedconfig::Ptr
的用法示例。
在下文中一共展示了Ptr::checkUpdate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkConfigUpdates
void checkConfigUpdates() {
static const char * const updates[] = {
"9",
"3.1-update-identities",
"3.1-use-identity-uoids",
"3.1-new-mail-notification",
"3.2-update-loop-on-goto-unread-settings",
"3.1.4-dont-use-UOID-0-for-any-identity", //krazy:exclude=spelling
"3.2-misc",
"3.2-moves",
"3.3-use-ID-for-accounts",
"3.3-update-filter-rules",
"3.3-move-identities-to-own-file",
"3.3-aegypten-kpgprc-to-kmailrc",
"3.3-aegypten-kpgprc-to-libkleopatrarc",
"3.3-aegypten-emailidentities-split-sign-encr-keys",
"3.3-misc",
"3.3b1-misc",
"3.4-misc",
"3.4a",
"3.4b",
"3.4.1",
"3.5.4",
"3.5.7-imap-flag-migration",
"4.0-misc",
"4.2"
};
static const int numUpdates = sizeof updates / sizeof *updates;
// Warning: do not remove entries in the above array, or the update-level check below will break
KSharedConfig::Ptr config = KMKernel::config();
KConfigGroup startup( config, "Startup" );
const int configUpdateLevel = startup.readEntry( "update-level", 0 );
if ( configUpdateLevel == numUpdates ) // Optimize for the common case that everything is OK
return;
for ( int i = configUpdateLevel ; i < numUpdates ; ++i ) {
config->checkUpdate( updates[i], "kmail.upd" );
}
startup.writeEntry( "update-level", numUpdates );
}