本文整理汇总了C++中KStaticDeleter::setObject方法的典型用法代码示例。如果您正苦于以下问题:C++ KStaticDeleter::setObject方法的具体用法?C++ KStaticDeleter::setObject怎么用?C++ KStaticDeleter::setObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KStaticDeleter
的用法示例。
在下文中一共展示了KStaticDeleter::setObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProgressManager
ProgressManager *ProgressManager::instance()
{
if(!mInstance)
{
progressManagerDeleter.setObject(mInstance, new ProgressManager());
}
return mInstance;
}
示例2:
KstSettings *KstSettings::globalSettings() {
if (!_self) {
kstsettingssd.setObject(_self, new KstSettings);
_self->reload();
}
return _self;
}
示例3: SyncProcessManager
SyncProcessManager *SyncProcessManager::self()
{
if(!mSelf)
{
selfDeleter.setObject(mSelf, new SyncProcessManager());
}
return mSelf;
}
示例4: count
int KstColorSequence::count() {
if (!_self) {
sdColorSequence.setObject(_self, new KstColorSequence);
}
_self->createPalette();
return _self->_count * 2;
}
示例5: ServerTypeManager
ServerTypeManager *ServerTypeManager::self()
{
if(!mSelf)
serverManagerDeleter.setObject(mSelf, new ServerTypeManager(0,
"ServerTypeManager"));
return mSelf;
}
示例6: self
TagActionManager* TagActionManager::self()
{
if (!s_mSelf)
{
staticDeleter.setObject(s_mSelf, new TagActionManager());
}
return s_mSelf;
}
示例7: kdDebug
FormatFactory *FormatFactory::self()
{
kdDebug(5700) << "FormatFactory::self()" << endl;
if(!mSelf)
factoryDeleter.setObject(mSelf, new FormatFactory);
return mSelf;
}
示例8: XineCfg
XineCfg *XineCfg::self()
{
if ( !mSelf ) {
staticXineCfgDeleter.setObject( mSelf, new XineCfg() );
mSelf->readConfig();
}
return mSelf;
}
示例9: GlobalSettings
GlobalSettings *GlobalSettings::self()
{
if ( !mSelf ) {
staticGlobalSettingsDeleter.setObject( mSelf, new GlobalSettings() );
mSelf->readConfig();
}
return mSelf;
}
示例10: KIMProxy
KIMProxy * KIMProxy::instance( DCOPClient * client )
{
if ( client )
{
if ( !s_instance )
_staticDeleter.setObject( s_instance, new KIMProxy( client ) );
return s_instance;
}
else
return 0L;
}
示例11:
QStringList *ArgExtractor::regExpList()
{
if(!_argList)
{
sdAL.setObject( _argList, new QStringList );
//Build the default arg list
_argList->append("%[ndioxXucsfeEgGp]");
_argList->append("%([0-9]+(\\$))?[-+'#0]?[0-9]*(.[0-9]+)?[hlL]?[dioxXucsfeEgGp]");
_argList->append("%[0-9]+");
}
return _argList;
}
示例12: entry
QColor KstColorSequence::entry(int ptr) {
if (!_self) {
sdColorSequence.setObject(_self, new KstColorSequence);
}
_self->createPalette();
if (ptr >= _self->_count * 2) {
ptr = 0;
}
int dark_factor = 100 + ( 50 * ( ptr / _self->_count ) );
return _self->_pal->color( ptr % _self->_count).dark(dark_factor);
}
示例13: safeSmsGenerateClientID
static char * safeSmsGenerateClientID( SmsConn /*c*/ )
{
// Causes delays with misconfigured network :-/.
// char *ret = SmsGenerateClientID(c);
char* ret = NULL;
if (!ret) {
static QString *my_addr = 0;
if (!my_addr) {
// qWarning("Can't get own host name. Your system is severely misconfigured\n");
smy_addr.setObject(my_addr,new QString);
/* Faking our IP address, the 0 below is "unknown" address format
(1 would be IP, 2 would be DEC-NET format) */
char hostname[ 256 ];
if( gethostname( hostname, 255 ) != 0 )
my_addr->sprintf("0%.8x", KApplication::random());
else {
// create some kind of hash for the hostname
int addr[ 4 ] = { 0, 0, 0, 0 };
int pos = 0;
for( unsigned int i = 0;
i < strlen( hostname );
++i, ++pos )
addr[ pos % 4 ] += hostname[ i ];
*my_addr = "0";
for( int i = 0;
i < 4;
++i )
*my_addr += QString::number( addr[ i ], 16 );
}
}
/* Needs to be malloc(), to look the same as libSM */
ret = (char *)malloc(1+my_addr->length()+13+10+4+1 + /*safeness*/ 10);
static int sequence = 0;
if (ret == NULL)
return NULL;
sprintf(ret, "1%s%.13ld%.10d%.4d", my_addr->latin1(), (long)time(NULL),
getpid(), sequence);
sequence = (sequence + 1) % 10000;
}
return ret;
}
示例14: readShareList
void KFileShare::readShareList()
{
KFileSharePrivate::self();
if(!s_shareList)
sdShareList.setObject(s_shareList, new QStringList);
else
s_shareList->clear();
// /usr/sbin on Mandrake, $PATH allows flexibility for other distributions
QString exe = findExe("filesharelist");
if(exe.isEmpty())
{
s_authorization = ErrorNotFound;
return;
}
KProcIO proc;
proc << exe;
if(!proc.start(KProcess::Block))
{
kdError() << "Can't run " << exe << endl;
s_authorization = ErrorNotFound;
return;
}
// Reading code shamelessly stolen from khostname.cpp ;)
QString line;
int length;
do
{
length = proc.readln(line, true);
if(length > 0)
{
if(line[length - 1] != '/')
line += '/';
s_shareList->append(line);
kdDebug(7000) << "Shared dir:" << line << endl;
}
} while(length > -1);
}
示例15: countryToISO
QString Address::countryToISO(const QString &cname)
{
// we search a map file for translations from country names to
// iso codes, storing caching things in a QMap for faster future
// access.
if(!mISOMap)
isoMapDeleter.setObject(mISOMap, new QMap< QString, QString >());
QMap< QString, QString >::ConstIterator it;
it = mISOMap->find(cname);
if(it != mISOMap->end())
return it.data();
QString mapfile = KGlobal::dirs()->findResource("data", QString::fromLatin1("kabc/countrytransl.map"));
QFile file(mapfile);
if(file.open(IO_ReadOnly))
{
QTextStream s(&file);
QString strbuf = s.readLine();
while(!strbuf.isEmpty())
{
QStringList countryInfo = QStringList::split('\t', strbuf, true);
if(countryInfo[0] == cname)
{
file.close();
mISOMap->insert(cname, countryInfo[1]);
return countryInfo[1];
}
strbuf = s.readLine();
}
file.close();
}
// fall back to system country
mISOMap->insert(cname, KGlobal::locale()->country());
return KGlobal::locale()->country();
}