bool kvi_matchWildExprCS(const char *m1,const char *m2)
{
if(!(m1 && m2 && (*m1)))return false;
- const char * savePos1 = 0;
+ const char * savePos1 = nullptr;
const char * savePos2 = m2;
while(*m1){ //loop managed by m1 (initially first mask)
if(*m1=='*'){
// Assignment
KviCString & operator=(const KviCString & str); // deep copy
- KviCString & operator=(const char * str); // str can be NULL here
+ KviCString & operator=(const char * str); // str can be nullptr here
KviCString & operator=(char c); // 2 bytes allocated,m_len = 1
KviCString & operator=(const QString & str);
KviCString & operator=(const QByteArray & str);
// if sep is not 0, it is inserted between the strings
// if bLastSep is true and sep is non 0, then sep is also appended at the end
// of the buffer (after the last string)
- void joinFromArray(KviCString ** strings, const char * sep = 0, bool bLastSep = false);
+ void joinFromArray(KviCString ** strings, const char * sep = nullptr, bool bLastSep = false);
// Utils
// encodes chars that have nonzero in the jumptable
// Numbers
// everything in base 10.... no overflow checks here
- long toLong(bool * bOk = 0) const;
- unsigned long toULong(bool * bOk = 0) const;
- long long toLongLong(bool * bOk = 0) const;
- unsigned long long toULongLong(bool * bOk = 0) const;
- char toChar(bool * bOk = 0) const { return (char)toLong(bOk); };
- unsigned char toUChar(bool * bOk = 0) const { return (unsigned char)toULong(bOk); };
- int toInt(bool * bOk = 0) const { return (int)toLong(bOk); };
- unsigned int toUInt(bool * bOk = 0) const { return (unsigned int)toULong(bOk); };
- short toShort(bool * bOk = 0) const { return (short)toLong(bOk); };
- unsigned short toUShort(bool * bOk = 0) const { return (unsigned short)toLong(bOk); };
+ long toLong(bool * bOk = nullptr) const;
+ unsigned long toULong(bool * bOk = nullptr) const;
+ long long toLongLong(bool * bOk = nullptr) const;
+ unsigned long long toULongLong(bool * bOk = nullptr) const;
+ char toChar(bool * bOk = nullptr) const { return (char)toLong(bOk); };
+ unsigned char toUChar(bool * bOk = nullptr) const { return (unsigned char)toULong(bOk); };
+ int toInt(bool * bOk = nullptr) const { return (int)toLong(bOk); };
+ unsigned int toUInt(bool * bOk = nullptr) const { return (unsigned int)toULong(bOk); };
+ short toShort(bool * bOk = nullptr) const { return (short)toLong(bOk); };
+ unsigned short toUShort(bool * bOk = nullptr) const { return (unsigned short)toLong(bOk); };
KviCString & setNum(long num);
KviCString & setNum(unsigned long num);
bool isUnsignedNum() const;
// special functions for multiple bases
- long toLongExt(bool * bOk = 0, int base = 0);
- // unsigned long toULongExt(bool *bOk = 0,int base = 0); //never used
+ long toLongExt(bool * bOk = nullptr, int base = 0);
+ // unsigned long toULongExt(bool *bOk = nullptr,int base = 0); //never used
// returns an empty string...
// this if often useful!
// Transform a pointer to a string with all 0 and 1
// void pointerToBitString(const void * ptr);
- // Get a pointer from a string all of 0 and 1 : return 0 if invalid
+ // Get a pointer from a string all of 0 and 1 : return nullptr if invalid
// void * bitStringToPointer();
// "External string" helper functions
};
int g_iMaxRequestSize = 0;
- void * g_pMaxRequestReturnAddress1 = 0;
- void * g_pMaxRequestReturnAddress2 = 0;
+ void * g_pMaxRequestReturnAddress1 = nullptr;
+ void * g_pMaxRequestReturnAddress2 = nullptr;
unsigned int g_iMallocCalls = 0;
unsigned int g_iReallocCalls = 0;
unsigned int g_iFreeCalls = 0;
unsigned int g_iTotalMemAllocated = 0;
unsigned int g_uAllocationPeak = 0;
- KviMallocEntry * g_pEntries = 0;
+ KviMallocEntry * g_pEntries = nullptr;
void * allocate(int size)
{
e->return_addr1 = __builtin_return_address(1);
e->return_addr2 = __builtin_return_address(2);
e->next = g_pEntries;
- e->prev = 0;
+ e->prev = nullptr;
if(g_pEntries)
g_pEntries->prev = e;
g_pEntries = e;
if(e != g_pEntries)
fprintf(stderr, "Mem profiling internal error!\n");
if(e->next)
- e->next->prev = 0;
+ e->next->prev = nullptr;
g_pEntries = e->next;
}
free(e);
*/
inline const char *& kvi_hash_key_default(const char **)
{
- static const char * static_null = NULL;
+ static const char * static_null = nullptr;
return static_null;
}
*/
inline void *& kvi_hash_key_default(void *)
{
- static void * static_default = NULL;
+ static void * static_default = nullptr;
return static_default;
}
/**
* \brief Returns the item associated to the key
*
- * Returns NULL if no such item exists in the hash table.
+ * Returns nullptr if no such item exists in the hash table.
* Places the hash table iterator at the position of the item found.
* \param hKey The key to find
* \return T *
{
m_uIteratorIdx = kvi_hash_hash(hKey, m_bCaseSensitive) % m_uSize;
if(!m_pDataArray[m_uIteratorIdx])
- return 0;
+ return nullptr;
for(KviPointerHashTableEntry<Key, T> * e = m_pDataArray[m_uIteratorIdx]->first(); e; e = m_pDataArray[m_uIteratorIdx]->next())
{
if(kvi_hash_key_equal(e->hKey, hKey, m_bCaseSensitive))
return (T *)e->pData;
}
- return 0;
+ return nullptr;
}
/**
* \brief Returns the item associated to the key hKey
*
- * Returns NULL if no such item exists in the hash table.
+ * Returns nullptr if no such item exists in the hash table.
* Places the hash table iterator at the position of the item found.
* This is an alias to find().
* \param hKey The key to find
if(m_pDataArray[uEntry]->isEmpty())
{
delete m_pDataArray[uEntry];
- m_pDataArray[uEntry] = 0;
+ m_pDataArray[uEntry] = nullptr;
}
m_uCount--;
return true;
if(m_pDataArray[i]->isEmpty())
{
delete m_pDataArray[i];
- m_pDataArray[i] = 0;
+ m_pDataArray[i] = nullptr;
}
m_uCount--;
return true;
if(m_pDataArray[i])
{
delete m_pDataArray[i];
- m_pDataArray[i] = 0;
+ m_pDataArray[i] = nullptr;
}
}
m_uCount = 0;
/**
* \brief Searches for the item pointer pRef
*
- * Returns its hash table entry, if found, and NULL otherwise.
+ * Returns its hash table entry, if found, and nullptr otherwise.
* The hash table iterator is placed at the item found.
* \param pRef The pointer to search
* \return KviPointerHashTableEntry<Key,T> *
}
}
}
- return 0;
+ return nullptr;
}
/**
KviPointerHashTableEntry<Key, T> * currentEntry()
{
if(m_uIteratorIdx >= m_uSize)
- return 0;
+ return nullptr;
if(m_pDataArray[m_uIteratorIdx])
return m_pDataArray[m_uIteratorIdx]->current();
- return 0;
+ return nullptr;
}
/**
m_uIteratorIdx++;
}
if(m_uIteratorIdx == m_uSize)
- return 0;
+ return nullptr;
return m_pDataArray[m_uIteratorIdx]->first();
}
KviPointerHashTableEntry<Key, T> * nextEntry()
{
if(m_uIteratorIdx >= m_uSize)
- return 0;
+ return nullptr;
if(m_uIteratorIdx < m_uSize)
{
}
if(m_uIteratorIdx == m_uSize)
- return 0;
+ return nullptr;
return m_pDataArray[m_uIteratorIdx]->first();
}
T * current()
{
if(m_uIteratorIdx >= m_uSize)
- return 0;
+ return nullptr;
if(m_pDataArray[m_uIteratorIdx])
{
KviPointerHashTableEntry<Key, T> * e = m_pDataArray[m_uIteratorIdx]->current();
if(!e)
- return 0;
+ return nullptr;
return e->data();
}
- return 0;
+ return nullptr;
}
/**
const Key & currentKey()
{
if(m_uIteratorIdx >= m_uSize)
- return kvi_hash_key_default(((Key *)NULL));
+ return kvi_hash_key_default(((Key *)nullptr));
if(m_pDataArray[m_uIteratorIdx])
{
KviPointerHashTableEntry<Key, T> * e = m_pDataArray[m_uIteratorIdx]->current();
if(!e)
- return kvi_hash_key_default(((Key *)NULL));
+ return kvi_hash_key_default(((Key *)nullptr));
return e->key();
}
- return kvi_hash_key_default(((Key *)NULL));
+ return kvi_hash_key_default(((Key *)nullptr));
}
/** \brief Places the hash table iterator at the first entry
m_uIteratorIdx++;
}
if(m_uIteratorIdx == m_uSize)
- return 0;
+ return nullptr;
KviPointerHashTableEntry<Key, T> * e = m_pDataArray[m_uIteratorIdx]->first();
if(!e)
- return 0;
+ return nullptr;
return e->data();
}
T * next()
{
if(m_uIteratorIdx >= m_uSize)
- return 0;
+ return nullptr;
if(m_uIteratorIdx < m_uSize)
{
}
if(m_uIteratorIdx == m_uSize)
- return 0;
+ return nullptr;
KviPointerHashTableEntry<Key, T> * e = m_pDataArray[m_uIteratorIdx]->first();
if(!e)
- return 0;
+ return nullptr;
return e->data();
}
m_uSize = uSize > 0 ? uSize : 32;
m_pDataArray = new KviPointerList<KviPointerHashTableEntry<Key, T>> *[m_uSize];
for(unsigned int i = 0; i < m_uSize; i++)
- m_pDataArray[i] = NULL;
+ m_pDataArray[i] = nullptr;
}
/**
m_uSize = t.m_uSize;
m_pDataArray = new KviPointerList<KviPointerHashTableEntry<Key, T>> *[m_uSize];
for(unsigned int i = 0; i < m_uSize; i++)
- m_pDataArray[i] = NULL;
+ m_pDataArray[i] = nullptr;
copyFrom(t);
}
if(src.m_pIterator)
m_pIterator = new KviPointerListIterator<KviPointerHashTableEntry<Key, T>>(*(src.m_pIterator));
else
- m_pIterator = NULL;
+ m_pIterator = nullptr;
}
/**
if(m_pIterator)
{
delete m_pIterator;
- m_pIterator = NULL;
+ m_pIterator = nullptr;
}
m_uEntryIndex = 0;
if(!bRet)
{
delete m_pIterator;
- m_pIterator = NULL;
+ m_pIterator = nullptr;
}
return bRet;
}
if(m_pIterator)
{
delete m_pIterator;
- m_pIterator = NULL;
+ m_pIterator = nullptr;
}
m_uEntryIndex = m_pHashTable->m_uSize;
if(!bRet)
{
delete m_pIterator;
- m_pIterator = NULL;
+ m_pIterator = nullptr;
}
return bRet;
}
if(m_pIterator)
{
delete m_pIterator;
- m_pIterator = NULL;
+ m_pIterator = nullptr;
}
m_uEntryIndex++;
while((m_uEntryIndex < m_pHashTable->m_uSize) && (!(m_pHashTable->m_pDataArray[m_uEntryIndex])))
if(!bRet)
{
delete m_pIterator;
- m_pIterator = NULL;
+ m_pIterator = nullptr;
}
return bRet;
}
if(m_pIterator)
{
delete m_pIterator;
- m_pIterator = NULL;
+ m_pIterator = nullptr;
}
if(m_uEntryIndex >= m_pHashTable->m_uSize)
return false;
if(!bRet)
{
delete m_pIterator;
- m_pIterator = NULL;
+ m_pIterator = nullptr;
}
return bRet;
}
*/
T * current() const
{
- return m_pIterator ? m_pIterator->current()->data() : NULL;
+ return m_pIterator ? m_pIterator->current()->data() : nullptr;
}
/**
*/
T * operator*() const
{
- return m_pIterator ? m_pIterator->current()->data() : NULL;
+ return m_pIterator ? m_pIterator->current()->data() : nullptr;
}
/**
{
if(m_pIterator)
return m_pIterator->current()->key();
- return kvi_hash_key_default(((Key *)NULL));
+ return kvi_hash_key_default(((Key *)nullptr));
}
/**
* \brief Moves the iterator to the first element of the hash table.
*
- * Returns the first item found or NULL if the hash table is empty.
+ * Returns the first item found or nullptr if the hash table is empty.
* \return T *
*/
T * toFirst()
{
if(!moveFirst())
- return NULL;
+ return nullptr;
return current();
}
{
m_pHashTable = &hTable;
m_uEntryIndex = 0;
- m_pIterator = NULL;
+ m_pIterator = nullptr;
moveFirst();
}
* been removed from Qt4 in favor of the value based non-autodeleting
* lists... anyway: here we go :)
*
-* \def NULL Define NULL type to 0
* \def KviPointerListBase Defines KviPointerListBase as KviPointerList
*/
template <typename T>
class KviPointerListIterator;
-#ifndef NULL
-#define NULL 0
-#endif
-
/**
* \class KviPointerListNode
* \brief A KviPointerList node pointers.
bool moveFirst()
{
m_pNode = m_pList->m_pHead;
- return m_pNode != NULL;
+ return m_pNode != nullptr;
}
/**
bool moveLast()
{
m_pNode = m_pList->m_pTail;
- return m_pNode != NULL;
+ return m_pNode != nullptr;
}
/**
if(!m_pNode)
return false;
m_pNode = m_pNode->m_pNext;
- return m_pNode != NULL;
+ return m_pNode != nullptr;
}
/**
if(!m_pNode)
return false;
m_pNode = m_pNode->m_pNext;
- return m_pNode != NULL;
+ return m_pNode != nullptr;
}
/**
if(!m_pNode)
return false;
m_pNode = m_pNode->m_pPrev;
- return m_pNode != NULL;
+ return m_pNode != nullptr;
}
/**
if(!m_pNode)
return false;
m_pNode = m_pNode->m_pPrev;
- return m_pNode != NULL;
+ return m_pNode != nullptr;
}
/**
* \brief Returns the value pointed by the iterator.
*
- * If the iterator is not valid, returns NULL.
+ * If the iterator is not valid, returns nullptr.
* \return T *
*/
T * current()
{
- return m_pNode ? (T *)(m_pNode->m_pData) : NULL;
+ return m_pNode ? (T *)(m_pNode->m_pData) : nullptr;
}
/**
* \brief Returns the value pointed by the iterator.
*
- * If the iterator is not valid, returns NULL.
+ * If the iterator is not valid, returns nullptr.
* This is just an alias to current().
* \return T *
*/
T * operator*()
{
- return m_pNode ? (T *)(m_pNode->m_pData) : NULL;
+ return m_pNode ? (T *)(m_pNode->m_pData) : nullptr;
}
/**
*/
bool isValid()
{
- return m_pNode != NULL;
+ return m_pNode != nullptr;
}
};
protected:
bool m_bAutoDelete; //< do we automatically delete items when they are removed ?
- KviPointerListNode * m_pHead; //< our list head pointer (NULL if there are no items in the list)
+ KviPointerListNode * m_pHead; //< our list head pointer (nullptr if there are no items in the list)
KviPointerListNode * m_pTail; //< our list tail
KviPointerListNode * m_pAux; //< our iteration pointer
if(pNewHead->m_pNext)
{
src->m_pHead = pNewHead->m_pNext;
- src->m_pHead->m_pPrev = NULL;
+ src->m_pHead->m_pPrev = nullptr;
}
else
{
- src->m_pHead = NULL;
- src->m_pTail = NULL;
+ src->m_pHead = nullptr;
+ src->m_pTail = nullptr;
}
if(m_pHead)
{
m_pHead = pNewHead;
m_pTail = pNewHead;
- m_pHead->m_pNext = NULL;
+ m_pHead->m_pNext = nullptr;
}
m_uCount++;
src->m_uCount--;
m_pTail = m_pAux->m_pPrev;
const T * pAuxData = (const T *)(m_pAux->m_pData);
delete m_pAux;
- m_pAux = NULL;
+ m_pAux = nullptr;
m_uCount--;
if(m_bAutoDelete)
delete pAuxData; // this can cause recursion, so do it at the end
{
m_pHead = n;
m_pTail = n;
- n->m_pPrev = NULL;
+ n->m_pPrev = nullptr;
}
m_pTail = src->m_pTail;
}
- src->m_pHead = NULL;
- src->m_pTail = NULL;
+ src->m_pHead = nullptr;
+ src->m_pTail = nullptr;
src->m_uCount = 0;
}
*/
bool isEmpty() const
{
- return (m_pHead == NULL);
+ return (m_pHead == nullptr);
}
/**
{
if(!m_pHead)
{
- m_pAux = NULL;
- return NULL;
+ m_pAux = nullptr;
+ return nullptr;
}
m_pAux = m_pHead;
return (T *)(m_pAux->m_pData);
T * takeFirst()
{
if(!m_pHead)
- return NULL;
+ return nullptr;
T * pData = (T *)m_pHead->m_pData;
if(m_pHead->m_pNext)
{
m_pHead = m_pHead->m_pNext;
delete m_pHead->m_pPrev;
- m_pHead->m_pPrev = NULL;
+ m_pHead->m_pPrev = nullptr;
}
else
{
delete m_pHead;
- m_pHead = NULL;
- m_pTail = NULL;
+ m_pHead = nullptr;
+ m_pTail = nullptr;
}
- m_pAux = NULL;
+ m_pAux = nullptr;
m_uCount--;
return pData;
}
T * takeLast()
{
if(!m_pTail)
- return NULL;
+ return nullptr;
T * pData = (T *)m_pTail->m_pData;
if(m_pTail->m_pPrev)
{
m_pTail = m_pTail->m_pPrev;
delete m_pTail->m_pNext;
- m_pTail->m_pNext = NULL;
+ m_pTail->m_pNext = nullptr;
}
else
{
delete m_pTail;
- m_pHead = NULL;
- m_pTail = NULL;
+ m_pHead = nullptr;
+ m_pTail = nullptr;
}
- m_pAux = NULL;
+ m_pAux = nullptr;
m_uCount--;
return pData;
}
{
if(!m_pTail)
{
- m_pAux = NULL;
- return NULL;
+ m_pAux = nullptr;
+ return nullptr;
}
m_pAux = m_pTail;
return (T *)(m_pAux->m_pData);
*
* A call to this function should be preceded by a call to
* first(),last(),at() or findRef().
- * This function will return a NULL pointer if the current item has
+ * This function will return a nullptr if the current item has
* been invalidated due to a remove operation.
* \return T *
*/
T * safeCurrent()
{
- return m_pAux ? (T *)(m_pAux->m_pData) : NULL;
+ return m_pAux ? (T *)(m_pAux->m_pData) : nullptr;
}
/**
* \brief Returns the next item in the list
*
* Sets the iteration pointer to the next item in the list and
- * returns that item (or 0 if the end of the list has been reached)
+ * returns that item (or nullptr if the end of the list has been reached)
* A call to this function MUST be preceded by a _successfull_ call
* to first(),last(),at() or findRef().
* \return T *
T * next()
{
if(!m_pAux)
- return NULL;
+ return nullptr;
m_pAux = m_pAux->m_pNext;
if(m_pAux)
return (T *)(m_pAux->m_pData);
- return NULL;
+ return nullptr;
}
/**
T * prev()
{
if(!m_pAux)
- return NULL;
+ return nullptr;
m_pAux = m_pAux->m_pPrev;
if(m_pAux)
return (T *)(m_pAux->m_pData);
- return NULL;
+ return nullptr;
}
/**
t = next();
cnt++;
}
- return 0;
+ return nullptr;
}
/**
n = n->m_pNext;
cnt++;
}
- return KviPointerListIterator<T>(*this, NULL);
+ return KviPointerListIterator<T>(*this, nullptr);
}
/**
return KviPointerListIterator<T>(*this, n);
n = n->m_pNext;
}
- return KviPointerListIterator<T>(*this, NULL);
+ return KviPointerListIterator<T>(*this, nullptr);
}
/**
if(!m_pHead)
{
m_pHead = new KviPointerListNode;
- m_pHead->m_pPrev = NULL;
- m_pHead->m_pNext = NULL;
+ m_pHead->m_pPrev = nullptr;
+ m_pHead->m_pNext = nullptr;
m_pHead->m_pData = (void *)d;
m_pTail = m_pHead;
}
{
m_pTail->m_pNext = new KviPointerListNode;
m_pTail->m_pNext->m_pPrev = m_pTail;
- m_pTail->m_pNext->m_pNext = NULL;
+ m_pTail->m_pNext->m_pNext = nullptr;
m_pTail->m_pNext->m_pData = (void *)d;
m_pTail = m_pTail->m_pNext;
}
if(!m_pHead)
{
m_pHead = new KviPointerListNode;
- m_pHead->m_pPrev = NULL;
- m_pHead->m_pNext = NULL;
+ m_pHead->m_pPrev = nullptr;
+ m_pHead->m_pNext = nullptr;
m_pHead->m_pData = (void *)d;
m_pTail = m_pHead;
}
{
m_pHead->m_pPrev = new KviPointerListNode;
m_pHead->m_pPrev->m_pNext = m_pHead;
- m_pHead->m_pPrev->m_pPrev = NULL;
+ m_pHead->m_pPrev->m_pPrev = nullptr;
m_pHead->m_pPrev->m_pData = (void *)d;
m_pHead = m_pHead->m_pPrev;
m_uCount++;
m_pHead = m_pHead->m_pNext;
pAuxData = (const T *)(m_pHead->m_pPrev->m_pData);
delete m_pHead->m_pPrev;
- m_pHead->m_pPrev = NULL;
+ m_pHead->m_pPrev = nullptr;
}
else
{
pAuxData = (const T *)(m_pHead->m_pData);
delete m_pHead;
- m_pHead = NULL;
- m_pTail = NULL;
+ m_pHead = nullptr;
+ m_pTail = nullptr;
}
- m_pAux = NULL;
+ m_pAux = nullptr;
m_uCount--;
if(m_bAutoDelete)
delete pAuxData;
m_pTail = m_pTail->m_pPrev;
pAuxData = (const T *)(m_pTail->m_pNext->m_pData);
delete m_pTail->m_pNext;
- m_pTail->m_pNext = NULL;
+ m_pTail->m_pNext = nullptr;
}
else
{
pAuxData = (const T *)(m_pTail->m_pData);
delete m_pTail;
- m_pHead = NULL;
- m_pTail = NULL;
+ m_pHead = nullptr;
+ m_pTail = nullptr;
}
- m_pAux = NULL;
+ m_pAux = nullptr;
m_uCount--;
if(m_bAutoDelete)
delete pAuxData;
KviPointerList<T>(bool bAutoDelete = true)
{
m_bAutoDelete = bAutoDelete;
- m_pHead = NULL;
- m_pTail = NULL;
+ m_pHead = nullptr;
+ m_pTail = nullptr;
m_uCount = 0;
- m_pAux = NULL;
+ m_pAux = nullptr;
};
/**
~KviShortcut();
public:
- static QShortcut * create(const char * key, QWidget * parent, const char * member = 0, const char * ambiguousMember = 0, Qt::ShortcutContext context = Qt::WindowShortcut);
- static QShortcut * create(const QKeySequence & key, QWidget * parent, const char * member = 0, const char * ambiguousMember = 0, Qt::ShortcutContext context = Qt::WindowShortcut);
- static void create(QKeySequence::StandardKey key, QWidget * parent, const char * member = 0, const char * ambiguousMember = 0, Qt::ShortcutContext context = Qt::WindowShortcut, KviPointerList<QShortcut> * pBufferList = nullptr);
+ static QShortcut * create(const char * key, QWidget * parent, const char * member = nullptr, const char * ambiguousMember = nullptr, Qt::ShortcutContext context = Qt::WindowShortcut);
+ static QShortcut * create(const QKeySequence & key, QWidget * parent, const char * member = nullptr, const char * ambiguousMember = nullptr, Qt::ShortcutContext context = Qt::WindowShortcut);
+ static void create(QKeySequence::StandardKey key, QWidget * parent, const char * member = nullptr, const char * ambiguousMember = nullptr, Qt::ShortcutContext context = Qt::WindowShortcut, KviPointerList<QShortcut> * pBufferList = nullptr);
};
#endif //_KVI_SHORTCUT_CLASSFILE_H_
// uSize MUST be greater than 0
// if data is non-zero, it MUST point to a buffer at least uSize bytes long
// and the data is COPIED from that buffer!
- KviDataBuffer(int uSize, const unsigned char * data = 0);
+ KviDataBuffer(int uSize, const unsigned char * data = nullptr);
KviDataBuffer();
~KviDataBuffer();
m_pTextSignal = textSignal;
theora_p = 0;
stateflag = 0;
- ts = NULL;
+ ts = nullptr;
thda = false;
thtic = false;
{
if(ogg_stream_packetout(&zo, &op) > 0)
{
- char * textPkt = 0;
+ char * textPkt = nullptr;
int textSize = 0;
if(irct_decode_packetin(&textPkt, &textSize, &op) == 0)
{
y4m_dst_buf_sz = geometry.pic_w * geometry.pic_h * 3;
// Set up Ogg output stream
- srand(time(NULL));
+ srand(time(nullptr));
ogg_stream_init(&to, rand());
ogg_stream_init(&zo, rand());
pGNSI = (PGNSI)GetProcAddress(
GetModuleHandle(TEXT("kernel32.dll")),
"GetNativeSystemInfo");
- if(NULL != pGNSI)
+ if(nullptr != pGNSI)
pGNSI(&si);
else
GetSystemInfo(&si);
if(bOsVersionInfoEx)
{
DWORD dwPlatformInfo;
- if(NULL != pGetProductInfo)
+ if(nullptr != pGetProductInfo)
if(pGetProductInfo(osvi.dwMajorVersion, osvi.dwMinorVersion,
osvi.wServicePackMajor, osvi.wServicePackMinor, &dwPlatformInfo))
{
// gethostbyaddr and gethostbyname are thread-safe on Windoze
struct in_addr inAddr;
- struct hostent * pHostEntry = 0;
+ struct hostent * pHostEntry = nullptr;
// DIE DIE!....I hope that this stuff will disappear sooner or later :)
{
m_szIp = d->firstIpAddress();
delete m_pDns;
- m_pDns = 0;
+ m_pDns = nullptr;
QString tmp;
tmp = QString(__tr2qs("Host %1 resolved to %2")).arg(m_connectionUrl.host(),m_szIp);
emit status(tmp);
public:
static QNetworkAccessManager * getInstance()
{
- static QNetworkAccessManager * pInstance = NULL;
+ static QNetworkAccessManager * pInstance = nullptr;
if(!pInstance)
pInstance = new QNetworkAccessManager();
return pInstance;
inline void unsetVariable(const QString & szName)
{
- SetEnvironmentVariable(szName.toStdWString().c_str(), NULL);
+ SetEnvironmentVariable(szName.toStdWString().c_str(), nullptr);
}
#else
/**
Q_OBJECT
public:
- KviSignalHandler(QObject *parent = 0);
+ KviSignalHandler(QObject *parent = nullptr);
static void unixSignalHandler(int unused);
KviThread * m_pSender;
public:
- KviThreadEvent(int evId, KviThread * sender = 0)
+ KviThreadEvent(int evId, KviThread * sender = nullptr)
: QEvent((QEvent::Type)KVI_THREAD_EVENT), m_eventId(evId), m_pSender(sender){};
~KviThreadEvent(){};
TData * m_pData;
public:
- KviThreadDataEvent(int evId, TData * pData = 0, KviThread * sender = 0)
+ KviThreadDataEvent(int evId, TData * pData = nullptr, KviThread * sender = nullptr)
: KviThreadEvent(evId, sender) { m_pData = pData; };
~KviThreadDataEvent()
{
TData * getData()
{
TData * aux = m_pData;
- m_pData = 0;
+ m_pData = nullptr;
return aux;
};
TData * data() { return m_pData; };
* \param bModal Whether the dialog is modal
* \return KviTalFileDialog
*/
- KviTalFileDialog(const QString & szDirName, const QString & szFilter = QString(), QWidget * pParent = 0, const char * pcName = 0, bool bModal = false);
+ KviTalFileDialog(const QString & szDirName, const QString & szFilter = QString(), QWidget * pParent = nullptr, const char * pcName = nullptr, bool bModal = false);
/**
* \brief Destroys the filedialog object
* \param pcName the name of the groupbox
* \return KviTalGroupBox
*/
- KviTalGroupBox(QWidget * pParent, char * pcName = 0);
+ KviTalGroupBox(QWidget * pParent, char * pcName = nullptr);
/**
* \brief Constructs the groupbox object
* \param pParent The parent object
* \return KviTalGroupBox
*/
- KviTalGroupBox(QWidget * pParent = 0);
+ KviTalGroupBox(QWidget * pParent = nullptr);
/**
* \brief Constructs the groupbox object
* \param pParent The parent object
* \return KviTalGroupBox
*/
- KviTalGroupBox(const QString & szTitle, QWidget * pParent = 0);
+ KviTalGroupBox(const QString & szTitle, QWidget * pParent = nullptr);
/**
* \brief Constructs the groupbox object
* \param pParent The parent object
* \return KviTalGroupBox
*/
- KviTalGroupBox(Qt::Orientation orientation, QWidget * pParent = 0);
+ KviTalGroupBox(Qt::Orientation orientation, QWidget * pParent = nullptr);
/**
* \brief Constructs the groupbox object
* \param pParent The parent object
* \return KviTalGroupBox
*/
- KviTalGroupBox(Qt::Orientation orientation, const QString & szTitle, QWidget * pParent = 0);
+ KviTalGroupBox(Qt::Orientation orientation, const QString & szTitle, QWidget * pParent = nullptr);
/**
* \brief Destroys the groupbox object
* \param pcName The name of the box
* \return KviTalHBox
*/
- KviTalHBox(QWidget * pParent, char * pcName = 0);
+ KviTalHBox(QWidget * pParent, char * pcName = nullptr);
/**
* \brief Destroys an horizontal box object
* \param pWidget The item which we have to delegate for the paint
* \return KviTalIconAndRichTextItemDelegate
*/
- KviTalIconAndRichTextItemDelegate(QAbstractItemView * pWidget = 0);
+ KviTalIconAndRichTextItemDelegate(QAbstractItemView * pWidget = nullptr);
/**
* \brief Destroys the icon and rich text item delegate object
{
Q_OBJECT
public:
- KviTalTabDialog(QWidget * pParent = 0, const char * name = 0, bool bModal = false);
+ KviTalTabDialog(QWidget * pParent = nullptr, const char * name = nullptr, bool bModal = false);
~KviTalTabDialog();
protected:
* \param pcName The name of the box
* \return KviTalVBox
*/
- KviTalVBox(QWidget * pParent, char * pcName = 0);
+ KviTalVBox(QWidget * pParent, char * pcName = nullptr);
/**
* \brief Destroys a vertical box object
tmp = QString("Software\\Classes\\" + szProto).toStdWString();
SHDeleteKey(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str());
- RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL);
+ RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, nullptr, 0, KEY_WRITE, nullptr, &hKey, nullptr);
RegSetValueEx(hKey, 0, 0, REG_SZ, (LPBYTE)TEXT("URL:IRC Protocol"), 16 * 2 + 1);
RegSetValueEx(hKey, TEXT("URL Protocol"), 0, REG_SZ, (LPBYTE)"", 0);
tmp = QString("Software\\Classes\\" + szProto + "\\DefaultIcon").toStdWString();
- RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL);
+ RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, nullptr, 0, KEY_WRITE, nullptr, &hKey, nullptr);
tmp = QString(szAppPath + ",0").toStdWString();
RegSetValueEx(hKey, 0, 0, REG_SZ, (LPBYTE)tmp.c_str(), tmp.length() * 2 + 1);
tmp = QString("Software\\Classes\\" + szProto + "\\Shell\\open").toStdWString();
- RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL);
+ RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, nullptr, 0, KEY_WRITE, nullptr, &hKey, nullptr);
tmp = __tr2qs("Open with KVIrc").toStdWString();
RegSetValueEx(hKey, 0, 0, REG_SZ, (LPBYTE)tmp.c_str(), tmp.length() * 2 + 1);
tmp = QString("Software\\Classes\\" + szProto + "\\Shell\\open\\command").toStdWString();
- RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL);
+ RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, nullptr, 0, KEY_WRITE, nullptr, &hKey, nullptr);
tmp = QString(szAppPath + " --external \"%1\"").toStdWString();
RegSetValueEx(hKey, 0, 0, REG_SZ, (LPBYTE)tmp.c_str(), tmp.length() * 2 + 1);
tmp = QString("Software\\Classes\\." + szExtension).toStdWString();
SHDeleteKey(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str());
- RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL);
+ RegCreateKeyEx(HKEY_CURRENT_USER, (LPCWSTR)tmp.c_str(), 0, nullptr, 0, KEY_WRITE, nullptr, &hKey, nullptr);
tmp = szClassName.toStdWString();
RegSetValueEx(hKey, 0, 0, REG_SZ, (LPBYTE)tmp.c_str(), tmp.length() * 2 + 1);
*
* This is actually used only by KviConsoleWindow.
*
- * pContext must not be NULL and is kept as shallow pointer (that is, it's
+ * pContext must not be nullptr and is kept as shallow pointer (that is, it's
* not owned and must persists for the entire life of KviIrcConnection:
* caller is responsable for that).
*
- * pTarget must not be NULL and must be allocated with new as this class
+ * pTarget must not be nullptr and must be allocated with new as this class
* takes the ownership.
*
- * pIdentity must not be NULL and must be allocated with new as this class
+ * pIdentity must not be nullptr and must be allocated with new as this class
* takes the ownership.
* \param pContext The KviIrcContext we're attacched to
* \param pTarget The server data
/**
* \brief Returns a pointer to the owning console
*
- * The pointer is never NULL
+ * The pointer is never nullptr
* \return KviConsoleWindow *
*/
KviConsoleWindow * console() const { return m_pConsole; }
/**
* \brief Returns a pointer to the owning KviIrcContext.
*
- * The returned value is never NULL
+ * The returned value is never nullptr
* \return KviIrcContext *
*/
KviIrcContext * context() const { return m_pContext; }
*
* Please note that the target doesn't necessairly contain up-to-date data.
* You might want to look at serverInfo() instead.
- * The returned pointer is never NULL.
+ * The returned pointer is never nullptr.
* \return KviIrcConnectionTarget *
*/
KviIrcConnectionTarget * target() const { return m_pTarget; }
/**
* \brief Returns the underlying KviIrcLink object
*
- * The returned pointer is never NULL.
+ * The returned pointer is never nullptr.
* \return KviIrcLink *
*/
KviIrcLink * link() const { return m_pLink; }
* \brief Returns a pointer to the big connection user database.
*
* The database contains ALL the users KVIrc can "see" in this connection.
- * The returned pointer is never NULL.
+ * The returned pointer is never nullptr.
* \return KviIrcUserDataBase *
*/
KviIrcUserDataBase * userDataBase() const { return m_pUserDataBase; }
* It contains runtime information about the user. This includes the
* current nickname, username, flags and other stuff that KviUserIdentity
* actually doesn't contain (or has only "default" values for).
- * The returned pointer is never NULL.
+ * The returned pointer is never nullptr.
* Include "KviIrcConnectionUserInfo.h" as the class is only
* forwarded here.
* \return KviIrcConnectionUserInfo *
* the current servername, the server capabilities and other stuff that
* KviConnectionTarget actually doesn't contain (or has only "default"
* values for).
- * The returned pointer is never NULL.
+ * The returned pointer is never nullptr.
* Include "KviIrcConnectionServerInfo.h" as the class is only
* forwarded here.
* \return KviIrcConnectionServerInfo *
* nickname index at login time, flags that signal "micro-states" etc...
* This data *could* be part of KviIrcConnection itself but we prefer to
* keep it in a separate class in order to cleanup the implementation.
- * The returned pointer is never NULL.
+ * The returned pointer is never nullptr.
* Include "KviIrcConnectionStateData.h" as the class is only
* forwarded here.
* \return KviIrcConnectionStateData *
*
* It contains data private to the Anti CTCP Flood engine. Very similar
* to KviIrcConnectionStateData but dedicated to Ctcp flood.
- * The returned pointer is never NULL.
+ * The returned pointer is never nullptr.
* Include "KviIrcConnectionAntiCtcpFloodData.h" as the class is
* only forwarded here.
* \return KviIrcConnectionAntiCtcpFloodData *
*
* It contains data private to the netsplit detector engine. Very similar
* to KviIrcConnectionStateData but dedicated to netsplit detection.
- * The returned pointer is never NULL.
+ * The returned pointer is never nullptr.
* Include "KviIrcConnectionNetsplitDetectorData.h" as the class is
* only forwarded here.
* \return KviIrcConnectionNetsplitDetectorData *
*
* It contains data private to the async whois engine. Very similar to
* KviIrcConnectionStateData but dedicated to async whois.
- * The returned pointer is never NULL.
+ * The returned pointer is never nullptr.
* Include "KviIrcConnectionAsyncWhoisData.h" as the class is only
* forwarded here.
* \return KviIrcConnectionAsyncWhoisData *
*
* It contains runtime statistics about the connection. Very similar to
* KviIrcConnectionStateData but dedicated to statistics.
- * The returned pointer is never NULL.
+ * The returned pointer is never nullptr.
* Include "KviIrcConnectionStatistics.h" as the class is only
* forwarded here.
* \return KviIrcConnectionStatistics *
/**
* \brief Returns a pointer to the current KviNotifyListManager.
*
- * The returned pointer is NULL if notify list management is disabled for
+ * The returned pointer is nullptr if notify list management is disabled for
* the current connection.
* \return KviNotifyListManager *
*/
/**
* \brief Returns a pointer to the current KviLagMeter.
*
- * The returned pointer is NULL if lag measurement is disabled for the
+ * The returned pointer is nullptr if lag measurement is disabled for the
* current connection.
* \return KviLagMeter *
*/
/**
* \brief Finds the channel with the specified unicode name.
*
- * Returns the pointer to the channel found or NULL if there is no such
+ * Returns the pointer to the channel found or nullptr if there is no such
* channel.
* \param szName The name of the channel
* \return KviChannelWindow *
* This should be called in response to a JOIN message.
* This function _assumes_ that such a channel doesn't exist yet (or if it
* exists then it's actually in DEAD state). You can assume that channel
- * creation never fails: if the returned pointer is NULL then we're screwed
+ * creation never fails: if the returned pointer is nullptr then we're screwed
* anyway as virtual memory is exausted.
* \param szName The name of the channel
* \return KviChannelWindow *
/**
* \brief Finds the query with the specified nick.
*
- * Returns the pointer to the query found or NULL if there is no such
+ * Returns the pointer to the query found or nullptr if there is no such
* query.
* \param szNick The nickname of the user
* \return KviQueryWindow *
/**
* \brief Returns the list of the currently open queries.
*
- * The returned pointer is never NULL (the list may be empty though).
+ * The returned pointer is never nullptr (the list may be empty though).
* \return std::vector<KviQueryWindow *> &
*/
std::vector<KviQueryWindow *> & queryList() { return m_pQueryList; }
KviMemory::move((void *)(pcBufToSend + 4), (void *)&host, 4);
KviMemory::move((void *)(pcBufToSend + 8), (void *)(szUserAndPass.ptr()), szUserAndPass.len());
- pcBufToSend[iLen - 1] = 0; //NULL
+ pcBufToSend[iLen - 1] = '\0';
// send it into hyperspace...
setState(ProxyFinalV4);
extern KVIRC_API void printSSLConnectionInfo(KviWindow * wnd, KviSSL * s);
- extern KVIRC_API KviSSL * allocSSL(KviWindow * wnd, kvi_socket_t sock, KviSSL::Method m, const char * contextString = 0);
+ extern KVIRC_API KviSSL * allocSSL(KviWindow * wnd, kvi_socket_t sock, KviSSL::Method m, const char * contextString = nullptr);
extern KVIRC_API void freeSSL(KviSSL * s);
extern KVIRC_API bool getSSLCertInfo(KviSSLCertificate * pCert, QString szQuery, QString szOptionalParam, KviKvsVariant * pRetBuffer);
const QString & szScriptCode,
const QString & szVisibleName,
const QString & szDescription,
- KviActionCategory * pCategory = NULL,
+ KviActionCategory * pCategory = nullptr,
const QString & szBigIconId = QString(),
const QString & szSmallIconId = QString(),
unsigned int uFlags = 0,
const QString & szScriptCode,
const QString & szVisibleName,
const QString & szDescription,
- KviActionCategory * pCategory = NULL,
+ KviActionCategory * pCategory = nullptr,
const QString & szBigIconId = QString(),
KviIconManager::SmallIcon eSmallIcon = KviIconManager::None,
unsigned int uFlags = 0,
{
Q_OBJECT
public:
- KviKvsAsyncDnsOperation(KviWindow * pWnd, QString & szQuery, KviDnsResolver::QueryType eType, KviKvsScript * pCallback = 0, KviKvsVariant * pMagic = 0);
+ KviKvsAsyncDnsOperation(KviWindow * pWnd, QString & szQuery, KviDnsResolver::QueryType eType, KviKvsScript * pCallback = nullptr, KviKvsVariant * pMagic = nullptr);
virtual ~KviKvsAsyncDnsOperation();
protected:
protected:
// the parameter list is always shallow!
- CallbackStatus execute(KviKvsVariantList * pParams = 0, KviKvsVariant * pRetVal = 0);
+ CallbackStatus execute(KviKvsVariantList * pParams = nullptr, KviKvsVariant * pRetVal = nullptr);
};
#endif //!_KVI_KVS_CALLBACKOBJECT_H_
#if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)
if(KVI_OPTION_BOOL(KviOption_boolUseSystemUrlHandlers))
{
- intptr_t iRet = (intptr_t)::ShellExecute(NULL, TEXT("open"), szUrl.toStdWString().c_str(), NULL, NULL, SW_SHOWNORMAL);
+ intptr_t iRet = (intptr_t)::ShellExecute(nullptr, TEXT("open"), szUrl.toStdWString().c_str(), nullptr, nullptr, SW_SHOWNORMAL);
if(iRet <= 32)
{
/*
KviWindow * pWnd,
const QString & szQuery,
bool bRebindOnWindowClose = true,
- KviKvsScript * pCallback = 0,
- KviKvsVariantList * pParameterList = 0);
+ KviKvsScript * pCallback = nullptr,
+ KviKvsVariantList * pParameterList = nullptr);
~KviKvsDnsObject();
protected:
~KviKvsModuleCallbackCommandCall(){};
public:
- // Never NULL, but may have empty code
+ // Never nullptr, but may have empty code
const KviKvsScript * callback() { return m_pCallback; };
virtual bool getParameterCode(unsigned int uParamIdx, QString & szParamBuffer);
};
// KVS_PT_IGNORE
ParameterFormat(const char * name)
- : szName(name), uType(KVS_PT_IGNORE), uFlags(0), pContainer(NULL) {}
+ : szName(name), uType(KVS_PT_IGNORE), uFlags(0), pContainer(nullptr) {}
// terminator
ParameterFormat()
- : szName(NULL), uType(KVS_PT_IGNORE), uFlags(0), pContainer(NULL){};
+ : szName(nullptr), uType(KVS_PT_IGNORE), uFlags(0), pContainer(nullptr){};
//ParameterFormat(const char * n,unsigned char t,unsigned char f,void * p)
//: szName(n), uType(t), uFlags(f), pContainer(p) {};
#define KVS_PARAMETERS_BEGIN(__name) \
KviKvsParameterProcessor::ParameterFormat __name[] = {
-#define KVS_PARAMETERS_END \
- KviKvsParameterProcessor::ParameterFormat(0) \
- } \
+#define KVS_PARAMETERS_END \
+ KviKvsParameterProcessor::ParameterFormat(nullptr) \
+ } \
;
//#define KVS_PARAMETER(__name,__type,__flags,__void)
{
if(!m_pInstance)return;
delete m_pInstance;
- m_pInstance = 0;
+ m_pInstance = nullptr;
}
bool KviKvsProcessManager::execute(KviKvsProcessAsyncOperationData * d)
KviWindow * pWnd,
KviKvsVariantList * pParams,
KviKvsVariant * pRetVal,
- KviKvsExtendedRunTimeData * pExtData = 0);
+ KviKvsExtendedRunTimeData * pExtData = nullptr);
public:
~KviKvsRunTimeContext();
* \param pExtData Extended data (usually 0)
* \return int
*/
- int run(KviWindow * pWnd, KviKvsVariantList * pParams = 0, KviKvsVariant * pRetVal = 0, int iRunFlags = 0, KviKvsExtendedRunTimeData * pExtData = 0);
+ int run(KviWindow * pWnd, KviKvsVariantList * pParams = nullptr, KviKvsVariant * pRetVal = nullptr, int iRunFlags = 0, KviKvsExtendedRunTimeData * pExtData = nullptr);
/**
* \brief Runs the script
* \param pExtData Extended data (usually 0)
* \return int
*/
- int run(KviWindow * pWnd, KviKvsVariantList * pParams, QString & szRetVal, int iRunFlags = 0, KviKvsExtendedRunTimeData * pExtData = 0);
+ int run(KviWindow * pWnd, KviKvsVariantList * pParams, QString & szRetVal, int iRunFlags = 0, KviKvsExtendedRunTimeData * pExtData = nullptr);
/**
* \brief Runs the script
* \param pRetVal Return value buffer (0 if you ignore it)
* \return int
*/
- static int run(const QString & szCode, KviWindow * pWindow, KviKvsVariantList * pParams = 0, KviKvsVariant * pRetVal = 0);
+ static int run(const QString & szCode, KviWindow * pWindow, KviKvsVariantList * pParams = nullptr, KviKvsVariant * pRetVal = nullptr);
/**
* \brief Static helper for quick evaluating parameters
* \param iRunFlags A combination of run flags (usually default)
* \return bool
*/
- bool parse(KviWindow * pOutput = 0, int iRunFlags = 0);
+ bool parse(KviWindow * pOutput = nullptr, int iRunFlags = 0);
/**
* \brief Runs the script
* \param pExtData Extended data (usually 0)
* \return int
*/
- int execute(KviWindow * pWnd, KviKvsVariantList * pParams = 0, KviKvsVariant * pRetVal = 0, int iRunFlags = 0, KviKvsExtendedRunTimeData * pExtData = 0);
+ int execute(KviWindow * pWnd, KviKvsVariantList * pParams = nullptr, KviKvsVariant * pRetVal = nullptr, int iRunFlags = 0, KviKvsExtendedRunTimeData * pExtData = nullptr);
/**
* \brief Runs the script
// this is intended to be called from other function calls (the parameters are copied from pOuterCall)
// since we should NEVER emit totally spontaneous signals: all of them
// should be generated inside object functions (either from scripting or by core calls)
- int emitSignal(const QString & sigName, KviKvsObjectFunctionCall * pOuterCall, KviKvsVariantList * pParams = 0);
+ int emitSignal(const QString & sigName, KviKvsObjectFunctionCall * pOuterCall, KviKvsVariantList * pParams = nullptr);
void setSignalSender(kvs_hobject_t hObject) { m_hSignalSender = hObject; }
kvs_hobject_t signalSender() { return m_hSignalSender; }
KviKvsVariant * pRetVal, // the return value
KviKvsVariantList * pParams); // the parameters for the call
// a nice and simple wrapper: it accepts a parameter list only (eventually 0)
- bool callFunction(KviKvsObject * pCaller, const QString & fncName, KviKvsVariantList * pParams = 0);
+ bool callFunction(KviKvsObject * pCaller, const QString & fncName, KviKvsVariantList * pParams = nullptr);
// this one gets a non null ret val too
- bool callFunction(KviKvsObject * pCaller, const QString & fncName, KviKvsVariant * pRetVal, KviKvsVariantList * pParams = 0);
+ bool callFunction(KviKvsObject * pCaller, const QString & fncName, KviKvsVariant * pRetVal, KviKvsVariantList * pParams = nullptr);
KviKvsObject * findChild(const QString & szClass, const QString & szName);
void killAllChildrenWithClass(KviKvsObjectClass * cl);
} \
} \
KVSP_ASSERT(false); \
- return 0; \
+ return nullptr; \
}
LITERAL_PARAM_PARSING_FUNCTION_BEGIN(parseCommandLiteralParameter)
delete l;
warning(pBegin,__tr2qs_ctx("Unterminated array index","kvs"));
error(KVSP_curCharPointer,__tr2qs_ctx("Unexpected end of script in array index (missing ']' character?)","kvs"));
- return 0;
+ return nullptr;
break;
case '\n':
delete l;
warning(pBegin,__tr2qs_ctx("Unterminated array index","kvs"));
error(KVSP_curCharPointer,__tr2qs_ctx("Unexpected end of line in array index (missing ']' character or unescaped newline)","kvs"));
- return 0;
+ return nullptr;
break;
case ' ':
case '\t':
error(KVSP_curCharPointer,__tr2qs_ctx("Unexpected character '%q' (Unicode %x) in array index: it should be already terminated","kvs"),KVSP_curCharPointer,KVSP_curCharUnicode);
break;
}
- return 0;
+ return nullptr;
}
goto end_of_the_array_index;
break;
{
// this is an error
delete l;
- return 0;
+ return nullptr;
}
l->append(p);
}
{
// error
delete l;
- return 0;
+ return nullptr;
}
l->append(p);
}
static void init();
private:
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// starts on the first char of a buffer
// stops at the first null char encountered
KviKvsTreeNodeInstruction * parseInstructionList();
- // may return 0 (empty instruction), check error() for error conditions
+ // may return nullptr (empty instruction), check error() for error conditions
// starts on the first character of an instruction
- // if the first char is ';' '\n' or null it just returns 0 without error
+ // if the first char is ';' '\n' or null it just returns nullptr without error
// stops after the ending char of the instruction
KviKvsTreeNodeInstruction * parseInstruction();
- // may return 0 (empty block), check error() for error conditions
+ // may return nullptr (empty block), check error() for error conditions
// starts at the leading '{' of the block
// stops after the trailing '}' of the block
KviKvsTreeNodeInstruction * parseInstructionBlock();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// starts on the first character of the parameters
// ends after the end of the command
KviKvsTreeNodeDataList * parseCommandParameterList();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// starts on the leading '(' or a ',' in the middle of the list
// ends after the trailing ')'
// if started in the middle of the list returns only the remaining
// parameters.
KviKvsTreeNodeDataList * parseCommaSeparatedParameterList();
KviPointerList<QString> * parseCommaSeparatedParameterListNoTree();
- // returns 0 in case of error or if it starts on a terminating character (null parameter)
+ // returns nullptr in case of error or if it starts on a terminating character (null parameter)
// check error() to see if there was an error condition (unless you already know that
// there was a valid first character)
// start on the first character of the parameter
// is extracted an attempt to convert it to a numeric format is made.
// This optimizes assignments, self-sums etc...
KviKvsTreeNodeData * parseCommandParameter(bool bPreferNumeric = false);
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// start on the first character of the parameter
// ends after the first character not included in the param (')','\n','\0',',')
KviKvsTreeNodeData * parseCommaSeparatedParameter();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// start on the first character of the parameter
// ends after the first character not included in the param (')','\n','\0')
KviKvsTreeNodeData * parseSingleParameterInParenthesis();
- // never returns 0
+ // never returns nullptr
KviKvsTreeNodeConstantData * parseCommandLiteralParameter();
- // never returns 0
+ // never returns nullptr
KviKvsTreeNodeConstantData * parseCommaSeparatedLiteralParameter();
- // never returns 0
+ // never returns nullptr
KviKvsTreeNodeConstantData * parseSingleLiteralParameterInParenthesis();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// starts at the leading '"'
// ends after the trailing '"'
KviKvsTreeNodeData * parseStringParameter();
- // never returns 0
+ // never returns nullptr
KviKvsTreeNodeConstantData * parseStringLiteralParameter();
- // returns 0 in case of error or of an empty switch list (check the error code!)
+ // returns nullptr in case of error or of an empty switch list (check the error code!)
// starts at the leading '-' of the first switch
// ends after the last switch
KviKvsTreeNodeSwitchList * parseCommandSwitchList();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// starts at '%' or '$'
// and ends after the end of the data reference
// or just after the '%' or '$' if this was only a ConstandData (not a var or func)
KviKvsTreeNodeData * parseParameterPercentOrDollar();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// starts at '%' or '$'
// ends after the end of the complete data reference (including scope operators!)
KviKvsTreeNodeData * parsePercentOrDollar(bool bInObjScope = false);
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// starts at '%'
// ends after the end of the structured data
KviKvsTreeNodeVariable * parsePercent(bool bInObjectScope = false);
- // returns 0 only in case of error
+ // returns nullptr only in case of error
KviKvsTreeNodeData * parseHashKey();
- // never returns 0
+ // never returns nullptr
KviKvsTreeNodeConstantData * parseHashKeyLiteralParameter();
//
// KviKvsParser_specialCommands.cpp
//
- // return 0 only in case of error
+ // return nullptr only in case of error
// starts at the leading '(' of the if command (after the switches)
// and stops after the end of the else block
// if the first character is not '(' then this function fails with an error
KviKvsTreeNodeCommand * parseSpecialCommandIf();
- // always returns 0
+ // always returns nullptr
// check error() for error conditions
// starts after the switches of the "global" keyword
// and stops at the end of the command
// if the first character is not '%' of a variable then this function fails with an error
KviKvsTreeNodeCommand * parseSpecialCommandGlobal();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// starts at the leading '(' of the while command (after the switches)
// and stops after the end of the command block
// if the first character is not '(' then this function fails with an error
KviKvsTreeNodeCommand * parseSpecialCommandWhile();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// starts at the leading '(' of the while command (after the switches)
// and stops after the end of the command block
// if the first character is not '(' then this function fails with an error
KviKvsTreeNodeCommand * parseSpecialCommandDo();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// and stops after the end of the break command
KviKvsTreeNodeCommand * parseSpecialCommandBreak();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// and jumps to the next iteration after the end of the continue command
KviKvsTreeNodeCommand * parseSpecialCommandContinue();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// and stops after the end of the for command block
KviKvsTreeNodeCommand * parseSpecialCommandFor();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// and stops after the end of the foreach command block
KviKvsTreeNodeCommand * parseSpecialCommandForeach();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// and stops after the end of the switch command block
KviKvsTreeNodeCommand * parseSpecialCommandSwitch();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// and stops after the end of the defpopup command block
KviKvsTreeNodeCommand * parseSpecialCommandUnset();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// and stops after the end of the defpopup command block
KviKvsTreeNodeCommand * parseSpecialCommandDefpopup();
KviKvsTreeNodeSpecialCommandDefpopupLabelPopup * parseSpecialCommandDefpopupLabelPopup();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// stops after the class command block
KviKvsTreeNodeCommand * parseSpecialCommandClass();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// stops after the perl.end statement
KviKvsTreeNodeCommand * parseSpecialCommandPerlBegin();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// stops after the perl.end statement
KviKvsTreeNodeCommand * parseSpecialCommandPythonBegin();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// and stops after the end of the help command
KviKvsTreeNodeCommand * parseSpecialCommandHelp();
// KviKvsParser_command.cpp
//
- // may return 0 (empty command), check error() for error conditions
+ // may return nullptr (empty command), check error() for error conditions
// starts at the beginning of a command (can be non valid)
// ends after the ending char of the command
KviKvsTreeNodeCommand * parseCommand();
// KviKvsParser_comment.cpp
//
- // always returns 0, and it CAN be an error!
+ // always returns nullptr, and it CAN be an error!
// starts at the beginning of a comment (must be '#' or '/')
// ends after the ending char of the comment
KviKvsTreeNode * parseComment();
// KviKvsParser_dollar.cpp
//
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// starts at '$'
// ends after the end of the function call
KviKvsTreeNodeData * parseDollar(bool bInObjScope = false);
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// starts at '@'
// ends after the end of the function call
KviKvsTreeNodeData * parseAt(bool bInObjScope = false);
// KviKvsParser_lside.cpp
//
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// returns after the command terminator
KviKvsTreeNodeInstruction * parseVoidFunctionCallOrOperation();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// returns after the command terminator
KviKvsTreeNodeOperation * parseOperation();
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// returns after the command terminator
// If bPreferNumeric is propagated to parseCommandParameter() function
KviKvsTreeNodeData * parseOperationRightSide(bool bPreferNumeric = false);
- // return 0 only in case of error
+ // return nullptr only in case of error
// returns after the command terminator
KviKvsTreeNodeOperation * parseBindingOperation();
KviKvsTreeNodeConstantData * parseBindingOperationLiteralParameter();
// KviKvsParser_expression.cpp
//
- // returns 0 only in case of error
+ // returns nullptr only in case of error
// starts AFTER the leading char of the expression
// ends after the first terminator found
KviKvsTreeNodeExpression * parseExpression(char terminator);
// might be an error, but might be not...
// it is an error only if error() returns true
// but since the caller will take care of it
- // we just return 0
+ // we just return nullptr
if(sw)
delete sw;
if(pRebindData)
// might be an error, but might be not...
// it is an error only if error() returns true
// but since the caller will take care of it
- // we just return 0
+ // we just return nullptr
if(sw)
delete sw;
if(pRebindData)
if(KVSP_curCharIsEndOfCommand) \
{ \
error(KVSP_curCharPointer, __tr2qs_ctx("Missing right operand for operator '" __opstr "='", "kvs")); \
- return 0; \
+ return nullptr; \
} \
KviKvsTreeNodeData * d = parseOperationRightSide(true); \
if(!d) \
- return 0; \
+ return nullptr; \
return new __class(pBegin, d); \
break; \
} \
{ \
dl = parseCommaSeparatedParameterList(); \
if(!dl) \
- return 0; \
+ return nullptr; \
} \
else \
{ \
if(!skipSpacesAndNewlines()) \
{ \
delete dl; \
- return 0; \
+ return nullptr; \
} \
\
/* allow a ';' after [interpreter].begin */ \
if(!skipSpacesAndNewlines()) \
{ \
delete dl; \
- return 0; \
+ return nullptr; \
} \
} \
\
szErr += " statement"; \
\
error(KVSP_curCharPointer, __tr2qs_ctx(szErr.toUtf8().data(), "kvs")); \
- return 0; \
+ return nullptr; \
} \
pInterpreterEnd = KVSP_curCharPointer; \
\
KviModule * m_pModule; // module pointer
public:
// pParams ownership is NOT taken
- KviModuleExtension * allocate(KviWindow * pWnd = 0, KviPointerHashTable<QString, QVariant> * pParams = 0, void * pSpecial = 0);
+ KviModuleExtension * allocate(KviWindow * pWnd = nullptr, KviPointerHashTable<QString, QVariant> * pParams = nullptr, void * pSpecial = nullptr);
int id() { return m_iId; };
KviModule * module() { return m_pModule; };
KviModuleExtensionDescriptor * findExtensionDescriptor(const KviCString & szType, const KviCString & szName);
static KviModuleExtensionManager * instance() { return g_pModuleExtensionManager; };
KviModuleExtensionDescriptorList * getExtensionList(const KviCString & szType);
- KviModuleExtension * allocateExtension(const KviCString & szType, const KviCString & szName, KviWindow * pWnd = 0, KviPointerHashTable<QString, QVariant> * pParams = 0, void * pSpecial = 0, const QString & preloadModule = QString());
- KviModuleExtension * allocateExtension(const KviCString & szType, int id, KviWindow * pWnd = 0, KviPointerHashTable<QString, QVariant> * pParams = 0, void * pSpecial = 0, const QString & preloadModule = QString());
+ KviModuleExtension * allocateExtension(const KviCString & szType, const KviCString & szName, KviWindow * pWnd = nullptr, KviPointerHashTable<QString, QVariant> * pParams = nullptr, void * pSpecial = nullptr, const QString & preloadModule = QString());
+ KviModuleExtension * allocateExtension(const KviCString & szType, int id, KviWindow * pWnd = nullptr, KviPointerHashTable<QString, QVariant> * pParams = nullptr, void * pSpecial = nullptr, const QString & preloadModule = QString());
private:
KviModuleExtensionDescriptorList * allocateExtensionGetDescriptorList(const KviCString & szType, const QString & preloadModule);
if(g_pMainWindow)
{
KviConsoleWindow * pWnd = g_pMainWindow->firstConsole();
- if(pWnd) // this may be NULL when the app is starting up
+ if(pWnd) // this may be nullptr when the app is starting up
pWnd->output(
KVI_OUT_VERBOSE,
__tr2qs("Loaded module '%s' (%s)"),
#define RPL_SPAMFILTERLIST 941 // <nick> <channel> <spamfilter>
///* 303 */ RPL_ISON, ":",
-///* 304 */ RPL_TEXT, (char *)NULL,
+///* 304 */ RPL_TEXT, (char *)nullptr,
///* 305 */ RPL_UNAWAY, ":You are no longer marked as being away",
///* 306 */ RPL_NOWAWAY, ":You have been marked as being away",
///* 323 */ RPL_LISTEND, ":End of /LIST",
///* 324 */ RPL_CHANNELMODEIS, "%???"
-///* 334 */ 0, (char *)NULL,
+///* 334 */ 0, (char *)nullptr,
///* 341 */ RPL_INVITING, "%s %s",
///* 342 */ RPL_SUMMONING, "%s :User summoned to irc",
///* 352 */ RPL_WHOREPLY, ,
-///* 361 */ RPL_KILLDONE, (char *)NULL,
+///* 361 */ RPL_KILLDONE, (char *)nullptr,
///* 362 */ RPL_CLOSING, "%s :Closed. Status = %d",
///* 363 */ RPL_CLOSEEND, "%d: Connections Closed",
///* 364 */ RPL_LINKS, "%s %s :%d %s",
///* 369 */ RPL_ENDOFWHOWAS, "%s :End of WHOWAS",
///* 381 */ RPL_YOUREOPER, ":You have entered... the Twilight Zone!.",
///* 382 */ RPL_REHASHING, "%s :Rehashing",
-///* 383 */ 0, (char *)NULL,
+///* 383 */ 0, (char *)nullptr,
///* 384 */ RPL_MYPORTIS, "%d :Port to local server is\r\n",
-///* 385 */ RPL_NOTOPERANYMORE, (char *)NULL,
+///* 385 */ RPL_NOTOPERANYMORE, (char *)nullptr,
///* 391 */ RPL_TIME, "%s :%s",
///* 392 */ RPL_USERSSTART, ":UserID Terminal Host",
///* 393 */ RPL_USERS, ":%-8s %-9s %-8s",
///* 223 */ RPL_STATSELINE, "%c %s * %s %d %d",
///* 224 */ RPL_STATSFLINE, "%c %s * %s %d %d",
///* 225 */ RPL_STATSDLINE, "%c %s %s",
-///* 231 */ 0, (char *)NULL,
-///* 232 */ 0, (char *)NULL,
-///* 233 */ 0, (char *)NULL,
-///* 234 */ RPL_SERVLIST, (char *)NULL,
-///* 235 */ RPL_SERVLISTEND, (char *)NULL,
+///* 231 */ 0, (char *)nullptr,
+///* 232 */ 0, (char *)nullptr,
+///* 233 */ 0, (char *)nullptr,
+///* 234 */ RPL_SERVLIST, (char *)nullptr,
+///* 235 */ RPL_SERVLISTEND, (char *)nullptr,
///* 241 */ RPL_STATSLLINE, "%c %s * %s %d %d",
///* 242 */ RPL_STATSUPTIME, ":Server Up %d days, %d:%02d:%02d",
///* 243 */ RPL_STATSOLINE, "%c %s * %s %d %d",
// when no longer needed.
KviAvatar * defaultAvatarFromOptions();
- void terminateConnectionRequest(bool bForce = false, const char * quitMsg = 0);
+ void terminateConnectionRequest(bool bForce = false, const char * quitMsg = nullptr);
// Status string (usermode + nick) (connection related too)
const QString & statusString() const { return m_szStatusString; }
friend class KviDynamicToolTipHelper;
Q_OBJECT
public:
- KviDynamicToolTip(QWidget * parent, const char * name = 0);
+ KviDynamicToolTip(QWidget * parent, const char * name = nullptr);
virtual ~KviDynamicToolTip();
protected:
* \param bModal Whether to have a modal behaviour
* \return KviFileDialog
*/
- KviFileDialog(const QString & szDirName, const QString & szFilter = QString(), QWidget * pParent = 0, const char * name = 0, bool bModal = false);
+ KviFileDialog(const QString & szDirName, const QString & szFilter = QString(), QWidget * pParent = nullptr, const char * name = nullptr, bool bModal = false);
/**
* \brief Destroys the file dialog object
* \param pParent The parent widget
* \return bool
*/
- static bool askForOpenFileName(QString & szBuffer, const QString & szCaption, const QString & szInitial = QString(), const QString & szFilter = QString(), bool bShowHidden = false, bool bShowNative = true, QWidget * pParent = 0);
+ static bool askForOpenFileName(QString & szBuffer, const QString & szCaption, const QString & szInitial = QString(), const QString & szFilter = QString(), bool bShowHidden = false, bool bShowNative = true, QWidget * pParent = nullptr);
/**
* \param szBuffer The buffer where to store the data
* \param pParent The parent widget
* \return bool
*/
- static bool askForSaveFileName(QString & szBuffer, const QString & szCaption, const QString & szInitial = QString(), const QString & szFilter = QString(), bool bShowHidden = false, bool bConfirmOverwrite = false, bool bShowNative = true, QWidget * pParent = 0);
+ static bool askForSaveFileName(QString & szBuffer, const QString & szCaption, const QString & szInitial = QString(), const QString & szFilter = QString(), bool bShowHidden = false, bool bConfirmOverwrite = false, bool bShowNative = true, QWidget * pParent = nullptr);
/**
* \param szBuffer The buffer where to store the data
* \param pParent The parent widget
* \return bool
*/
- static bool askForDirectoryName(QString & szBuffer, const QString & szCaption, const QString & szInitial, const QString & szFilter = QString(), bool bShowHidden = false, bool bShowNative = true, QWidget * pParent = 0);
+ static bool askForDirectoryName(QString & szBuffer, const QString & szCaption, const QString & szInitial, const QString & szFilter = QString(), bool bShowHidden = false, bool bShowNative = true, QWidget * pParent = nullptr);
/**
* \param szBuffer The buffer where to store the data
* \param pParent The parent widget
* \return bool
*/
- static bool askForOpenFileNames(QStringList & szBuffer, const QString & szCaption, const QString & szInitial, const QString & szFilter = QString(), bool bShowHidden = false, bool bShowNative = true, QWidget * pParent = 0);
+ static bool askForOpenFileNames(QStringList & szBuffer, const QString & szCaption, const QString & szInitial, const QString & szFilter = QString(), bool bShowHidden = false, bool bShowNative = true, QWidget * pParent = nullptr);
};
#endif //_KVI_FILEDIALOG_H_
* \param pView The userlist
* \return KviInput
*/
- KviInput(KviWindow * pPar, KviUserListView * pView = 0);
+ KviInput(KviWindow * pPar, KviUserListView * pView = nullptr);
/**
* \brief Destroys the input object
{
Q_OBJECT
public:
- KviToolBarGraphicalApplet(QWidget * par, const char * name = 0);
+ KviToolBarGraphicalApplet(QWidget * par, const char * name = nullptr);
~KviToolBarGraphicalApplet();
private:
{
Q_OBJECT
public:
- KviIrcContextDisplay(QWidget * par, const char * name = 0);
+ KviIrcContextDisplay(QWidget * par, const char * name = nullptr);
~KviIrcContextDisplay();
protected:
// A null pixmap passed here unsets the private backgrdound.
void setPrivateBackgroundPixmap(const QPixmap & pixmap, bool bRepaint = true);
QPixmap * getPrivateBackgroundPixmap() const { return m_pPrivateBackgroundPixmap; };
- bool hasPrivateBackgroundPixmap() { return (m_pPrivateBackgroundPixmap != 0); };
+ bool hasPrivateBackgroundPixmap() { return (m_pPrivateBackgroundPixmap != nullptr); };
// Logging
// Stops previous logging session too...
bool startLogging(const QString & fname = QString(), bool bPrependCurBuffer = false);
void stopLogging();
- bool isLogging() { return (m_pLogFile != 0); };
+ bool isLogging() { return (m_pLogFile != nullptr); };
void getLogFileName(QString & buffer);
void add2Log(const QString & szBuffer, const QDateTime & date, int iMsgType, bool bPrependDate);
void calculateLineWraps(KviIrcViewLine * ptr, int maxWidth);
void recalcFontVariables(const QFont & font, const QFontInfo & fi);
bool checkSelectionBlock(KviIrcViewLine * line, int bufIndex);
- KviIrcViewWrappedBlock * getLinkUnderMouse(int xPos, int yPos, QRect * pRect = 0, QString * linkCmd = 0, QString * linkText = 0);
+ KviIrcViewWrappedBlock * getLinkUnderMouse(int xPos, int yPos, QRect * pRect = nullptr, QString * linkCmd = nullptr, QString * linkText = nullptr);
void doLinkToolTip(const QRect & rct, QString & linkCmd, QString & linkText);
void doMarkerToolTip();
bool checkMarkerArea(const QPoint & mousePos);
// well.. the menu bar :D
KviMenuBar * mainMenuBar() { return m_pMenuBar; };
KviStatusBar * mainStatusBar() { return m_pStatusBar; };
- // this function may return 0 if the active window has no irc context
+ // this function may return nullptr if the active window has no irc context
KviIrcContext * activeContext() { return m_pActiveContext; };
// shortcut to a = activeContext(); return a ? a->connection() : 0
KviIrcConnection * activeConnection();
// Exceptions are the startup and the shutdown (see activeWindow())
KviConsoleWindow * firstConsole();
// Returns the first console that has no connection in progress
- // This function CAN return 0 if all the consoles are connected
+ // This function CAN return nullptr if all the consoles are connected
KviConsoleWindow * firstNotConnectedConsole();
// this is explicitly dedicated to the TrayIcon module
void setTrayIcon(KviTrayIcon * e) { m_pTrayIcon = e; };
return m_Mask.uSetAt < ((KviMaskItem *)&other)->mask()->uSetAt;
break;
}
- return 0; //make compiler happy
+ return false; //make compiler happy
}
};
{
Q_OBJECT
public:
- KviOptionsWidget(QWidget * parent, const char * name = 0, bool bSunken = true);
+ KviOptionsWidget(QWidget * parent, const char * name = nullptr, bool bSunken = true);
~KviOptionsWidget();
private:
public:
virtual void commit(){};
virtual QString textForSearch() { return QString(); };
- virtual QWidget * widgetToHighlight() { return 0; };
+ virtual QWidget * widgetToHighlight() { return nullptr; };
};
class KVIRC_API KviBoolSelector : public QCheckBox, public KviSelectorInterface
{
Q_OBJECT
public:
- KviTopicListBoxItemDelegate(QAbstractItemView * pWidget = 0);
+ KviTopicListBoxItemDelegate(QAbstractItemView * pWidget = nullptr);
~KviTopicListBoxItemDelegate();
public:
class KVIRC_API KviTopicListBoxItem : public KviTalListWidgetText
{
public:
- KviTopicListBoxItem(KviTalListWidget * pListBox = 0, const QString & text = QString());
+ KviTopicListBoxItem(KviTalListWidget * pListBox = nullptr, const QString & text = QString());
~KviTopicListBoxItem();
public:
{
Q_OBJECT
public:
- KviTreeWindowListItemDelegate(QAbstractItemView * pWidget = 0)
+ KviTreeWindowListItemDelegate(QAbstractItemView * pWidget = nullptr)
: QStyledItemDelegate(pWidget){};
~KviTreeWindowListItemDelegate(){};
QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const;
* \param pRect The rectangle where to search
* \return KviUserListEntry *
*/
- KviUserListEntry * itemAt(const QPoint & pnt, QRect * pRect = 0);
+ KviUserListEntry * itemAt(const QPoint & pnt, QRect * pRect = nullptr);
/**
* \brief Returns true if the item in the entry is visible
///
/// Creates an instance of KviWebPackageManagementDialog
///
- KviWebPackageManagementDialog(QWidget * pParent = NULL);
+ KviWebPackageManagementDialog(QWidget * pParent = nullptr);
///
/// Destroys the instance of KviWebPackageManagementDialog
/**
* \brief Returns the KviIrcView of this window
*
- * May be NULL if the window has no KviIrcView (and thus supports no direct output)
+ * May be nullptr if the window has no KviIrcView (and thus supports no direct output)
* \return KviIrcView *
*/
KviIrcView * view() const { return m_pIrcView; }
virtual void getWindowListTipText(QString & szBuffer) { szBuffer = m_szPlainTextCaption; }
- // This is meaningful only if view() is non NULL
+ // This is meaningful only if view() is non nullptr
const QString & lastLineOfText();
const QString & lastMessageText();
// This is almost always non null
// The exception is the startup (when there are no windows at all)
// and the last phase of the destructor.
-// You usually shouldn't care of checking this pointer for NULL unless
+// You usually shouldn't care of checking this pointer for nullptr unless
// you're running very early at startup or very late at shutdown
extern KVIRC_API KviWindow * g_pActiveWindow;
#endif
Qt::DockWidgetArea currentArea;
public:
- virtual KviWindowListItem * addItem(KviWindow *) { return 0; };
+ virtual KviWindowListItem * addItem(KviWindow *) { return nullptr; }
virtual bool removeItem(KviWindowListItem *) { return false; };
virtual void setActiveItem(KviWindowListItem *){};
- virtual KviWindowListItem * firstItem() { return 0; };
- virtual KviWindowListItem * lastItem(void) { return 0; }
- virtual KviWindowListItem * nextItem() { return 0; };
- virtual KviWindowListItem * prevItem(void) { return 0; }
+ virtual KviWindowListItem * firstItem() { return nullptr; }
+ virtual KviWindowListItem * lastItem(void) { return nullptr; }
+ virtual KviWindowListItem * nextItem() { return nullptr; }
+ virtual KviWindowListItem * prevItem(void) { return nullptr; }
virtual KviWindowListItem * item(int number);
virtual bool setIterationPointer(KviWindowListItem *) { return false; };
virtual void switchWindow(bool bNext, bool bInContextOnly, bool bHighlightedOnly = false);
bool checkDirTree(const QString & szDirPath, QString * pszError);
bool pack(AddonInfo & info, QString & szError);
bool notAValidAddonPackage(QString & szError);
- bool installAddonPackage(const QString & szAddonPackageFileName, QString & szError, QWidget * pDialogParent = 0);
+ bool installAddonPackage(const QString & szAddonPackageFileName, QString & szError, QWidget * pDialogParent = nullptr);
QString createRandomDir();
}
KVSM_PARAMETERS_BEGIN(c) \
KVSM_PARAMETER("irc_context_id", KVS_PT_UINT, KVS_PF_OPTIONAL, iContextId) \
KVSM_PARAMETERS_END(c) \
- KviConsoleWindow * pConsole = NULL; \
+ KviConsoleWindow * pConsole = nullptr; \
if(c->parameterCount() > 0) \
pConsole = g_pApp->findConsole(iContextId); \
else \
pConsole = c->window()->console();
#define GET_CONNECTION_FROM_STANDARD_PARAMS \
- GET_CONSOLE_FROM_STANDARD_PARAMS \
- KviIrcConnection * pConnection = NULL; \
- if(pConsole) \
+ GET_CONSOLE_FROM_STANDARD_PARAMS \
+ KviIrcConnection * pConnection = nullptr; \
+ if(pConsole) \
pConnection = pConsole->context()->connection();
#define STANDARD_IRC_CONNECTION_TARGET_PARAMETER(_fncName, _setCall) \
output(KVI_OUT_DCCMSG, __tr2qs_ctx("Contacting host %Q on port %Q", "dcc"), &(dcc->szIp), &(dcc->szPort));
}
- // m_pSlaveThread = 0;
+ // m_pSlaveThread = nullptr;
}
DccCanvasWindow::~DccCanvasWindow()
// {
// m_pSlaveThread->terminate();
// delete m_pSlaveThread;
- // m_pSlaveThread = 0;
+ // m_pSlaveThread = nullptr;
// }
KviThreadManager::killPendingEvents(this);
// delete m_pDescriptor;
// no more data in the buffer
KVI_ASSERT(data->iLen == 0);
KviMemory::free(data->buffer);
- data->buffer = end = aux = 0;
+ data->buffer = end = aux = nullptr;
}
postEvent(parent(), e);
}
e->setData(s);
data->iLen = 0;
KviMemory::free(data->buffer);
- data->buffer = 0;
+ data->buffer = nullptr;
postEvent(parent(), e);
}
}
: DccWindow(KviWindow::DccVideo, name, dcc)
{
m_pDescriptor = dcc;
- m_pSlaveThread = 0;
- m_pszTarget = 0;
+ m_pSlaveThread = nullptr;
+ m_pszTarget = nullptr;
m_pButtonBox = new KviTalHBox(this);
if(m_pInVideoLabel)
{
delete m_pInVideoLabel;
- m_pInVideoLabel = 0;
+ m_pInVideoLabel = nullptr;
}
if(m_pCameraView)
{
delete m_pCameraView;
- m_pCameraView = 0;
+ m_pCameraView = nullptr;
}
if(m_pCameraImage)
{
delete m_pCameraImage;
- m_pCameraImage = 0;
+ m_pCameraImage = nullptr;
}
if(m_pCamera)
{
delete m_pCamera;
- m_pCamera = 0;
+ m_pCamera = nullptr;
}
if(m_pCDevices)
{
delete m_pCDevices;
- m_pCDevices = 0;
+ m_pCDevices = nullptr;
}
if(m_pCInputs)
{
delete m_pCInputs;
- m_pCInputs = 0;
+ m_pCInputs = nullptr;
}
if(m_pCStandards)
{
delete m_pCStandards;
- m_pCStandards = 0;
+ m_pCStandards = nullptr;
}
if(m_pVideoLabel[0])
{
delete m_pVideoLabel[2];
delete m_pVideoLabel[1];
delete m_pVideoLabel[0];
- m_pVideoLabel[2] = 0;
- m_pVideoLabel[1] = 0;
- m_pVideoLabel[0] = 0;
+ m_pVideoLabel[2] = nullptr;
+ m_pVideoLabel[1] = nullptr;
+ m_pVideoLabel[0] = nullptr;
}
if(m_pLayout)
{
delete m_pLayout;
- m_pLayout = 0;
+ m_pLayout = nullptr;
}
g_pDccBroker->unregisterDccWindow(this);
{
m_pSlaveThread->terminate();
delete m_pSlaveThread;
- m_pSlaveThread = 0;
+ m_pSlaveThread = nullptr;
}
KviThreadManager::killPendingEvents(this);
if(m_pszTarget)
{
delete m_pszTarget;
- m_pszTarget = 0;
+ m_pszTarget = nullptr;
}
}
: DccVideoCodec()
{
m_szName = "theora";
- m_pEncoder = 0;
- m_pDecoder = 0;
+ m_pEncoder = nullptr;
+ m_pDecoder = nullptr;
}
DccVideoTheoraCodec::~DccVideoTheoraCodec()
{
if(m_pEncoder)
delete m_pEncoder;
- m_pEncoder = 0;
+ m_pEncoder = nullptr;
if(m_pDecoder)
delete m_pDecoder;
- m_pDecoder = 0;
+ m_pDecoder = nullptr;
}
void DccVideoTheoraCodec::encodeVideo(KviDataBuffer * videoSignal, KviDataBuffer * stream)
#define GSM_UNPACKED_FRAME_SIZE_IN_BYTES 320
#define GSM_UNPACKED_FRAME_SIZE_IN_SHORTS 160
-void * (*gsm_session_create)() = 0;
-void (*gsm_session_destroy)(void *) = 0;
-void (*gsm_session_encode)(void *, short *, unsigned char *) = 0;
-int (*gsm_session_decode)(void *, unsigned char *, short *) = 0;
+void * (*gsm_session_create)() = nullptr;
+void (*gsm_session_destroy)(void *) = nullptr;
+void (*gsm_session_encode)(void *, short *, unsigned char *) = nullptr;
+int (*gsm_session_decode)(void *, unsigned char *, short *) = nullptr;
-void * g_pGSMCodecLibraryHandle = 0;
+void * g_pGSMCodecLibraryHandle = nullptr;
bool kvi_gsm_codec_init()
{
if(!(gsm_session_create && gsm_session_destroy && gsm_session_encode && gsm_session_decode))
{
dlclose(g_pGSMCodecLibraryHandle);
- g_pGSMCodecLibraryHandle = 0;
+ g_pGSMCodecLibraryHandle = nullptr;
return false;
}
return true;
if(g_pGSMCodecLibraryHandle)
{
dlclose(g_pGSMCodecLibraryHandle);
- g_pGSMCodecLibraryHandle = 0;
+ g_pGSMCodecLibraryHandle = nullptr;
}
}
KviVoiceParty::KviVoiceParty(const QString &szNick,const QString &szIp,unsigned short uPort)
: m_szIp(szIp), m_uPort(uPort), m_szNick(szNick)
{
- m_pChildrenTree = 0;
+ m_pChildrenTree = nullptr;
}
KviVoiceParty::~KviVoiceParty()
{
KviQString::sprintf("%Q:%u",&(pRemoteParty->nick()),pRemoteParty->port());
m_pRemoteParty = pRemoteParty;
- m_pAudioEncoder = 0;
- m_pAudioDecoder = 0;
+ m_pAudioEncoder = nullptr;
+ m_pAudioDecoder = nullptr;
}
KviVoiceLink::~KviVoiceLink()
public:
DccDescriptor * descriptor() { return m_pDescriptor; };
const DccMarshal * marshal() { return m_pMarshal; };
- virtual DccThread * getSlaveThread() { return 0; };
+ virtual DccThread * getSlaveThread() { return nullptr; }
virtual KviWindow * dccMarshalOutputWindow();
virtual const char * dccMarshalOutputContextString();
};
m_pCanvasWidget = cw;
m_state = Idle;
m_dragMode = None;
- m_pSelectedItem = 0;
+ m_pSelectedItem = nullptr;
viewport()->setMouseTracking(true);
}
void KviCanvasView::insertObjectAt(const QPoint & pnt, ObjectType o)
{
- QCanvasItem * r = 0;
+ QCanvasItem * r = nullptr;
switch(o)
{
if(!m_pSelectedItem)
return;
m_pSelectedItem->setSelected(false);
- m_pSelectedItem = 0;
+ m_pSelectedItem = nullptr;
m_pCanvasWidget->m_pPropertiesWidget->editItem(0);
}
default:
break;
}
- return 0;
+ return nullptr;
}
void KviVariantTableItem::setContentFromEditor(QWidget * w)
return;
}
- QMap<QString, QVariant> * m = 0;
+ QMap<QString, QVariant> * m = nullptr;
switch(KVI_CANVAS_RTTI_CONTROL_TYPE(it))
{
{
Q_OBJECT
public:
- ScriptEditorReplaceDialog(QWidget * parent = 0, const QString & szName = QString());
+ ScriptEditorReplaceDialog(QWidget * parent = nullptr, const QString & szName = QString());
public:
QLineEdit * m_pFindLineEdit;
// this for win
#if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)
ULARGE_INTEGER free, total;
- if (GetDiskFreeSpaceEx(szPath.toStdWString().c_str(), NULL, &total, &free) == 0) {
+ if (GetDiskFreeSpaceEx(szPath.toStdWString().c_str(), nullptr, &total, &free) == 0) {
c->warning(__tr2qs("An error occurred retrieving the amount of free space in '%Q'"), &szPath);
return true;
}
if(tmp.isEmpty())
return;
tmp.replace("/", "\\");
- ShellExecute(0, TEXT("open"), tmp.toStdWString().c_str(), NULL, NULL, SW_SHOWNORMAL); //You have to link the shell32.lib
+ ShellExecute(0, TEXT("open"), tmp.toStdWString().c_str(), nullptr, nullptr, SW_SHOWNORMAL); //You have to link the shell32.lib
#else
// G&N end
#ifdef COMPILE_KDE4_SUPPORT
{
Q_OBJECT
public:
- FileTransferItemDelegate(QAbstractItemView * pWidget = 0)
+ FileTransferItemDelegate(QAbstractItemView * pWidget = nullptr)
: KviTalIconAndRichTextItemDelegate(pWidget){};
~FileTransferItemDelegate(){};
QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const;
void run() override;
protected:
- void postMessage(const char * message, KviIdentRequest * r, const char * szAux = 0);
+ void postMessage(const char * message, KviIdentRequest * r, const char * szAux = nullptr);
};
#endif //_LIBKVIIDENT_H_
class ChannelTreeWidgetItemDelegate : public QItemDelegate
{
public:
- ChannelTreeWidgetItemDelegate(QTreeWidget * pWidget = 0);
+ ChannelTreeWidgetItemDelegate(QTreeWidget * pWidget = nullptr);
~ChannelTreeWidgetItemDelegate();
void paint(QPainter * pPainter, const QStyleOptionViewItem & option, const QModelIndex & index) const;
QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const;
#define AC_BUFFER_SIZE 2048
-static HINSTANCE amip_dll = NULL;
+static HINSTANCE amip_dll = nullptr;
#define MP_AC_DYNPTR(__rettype, __func, __args) \
typedef __rettype(CALLBACK * lp_##__func)(__args); \
static QTextCodec * mediaplayer_get_codec()
{
- QTextCodec * pCodec = 0;
+ QTextCodec * pCodec = nullptr;
pCodec = QTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding).toUtf8());
if(!pCodec)
bool res = loadAmipDll();
if(!res)
{
- amip_dll = NULL;
+ amip_dll = nullptr;
return;
}
ac_init(AC_START_CLIENT);
return;
ac_uninit();
FreeLibrary(amip_dll);
- amip_dll = NULL;
+ amip_dll = nullptr;
}
int MpAmipInterface::detect(bool bStart)
_interfaceclass##Descriptor::_interfaceclass##Descriptor() \
: MpInterfaceDescriptor() \
{ \
- m_pInstance = 0; \
+ m_pInstance = nullptr; \
m_szName = _name; \
m_szDescription = _description; \
} \
// ** (requires Winamp 2.04+, only usable from plug-ins (not external apps))
// ** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTFILE);
// ** IPC_GETPLAYLISTFILE gets the filename of the playlist entry [index].
-// ** returns a pointer to it. returns NULL on error.
+// ** returns a pointer to it. returns nullptr on error.
#define IPC_GETPLAYLISTTITLE 212
// * (requires Winamp 2.04+, only usable from plug-ins (not external apps))
// ** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTTITLE);
// ** IPC_GETPLAYLISTTITLE gets the title of the playlist entry [index].
-// ** returns a pointer to it. returns NULL on error.
+// ** returns a pointer to it. returns nullptr on error.
#define IPC_GET_SHUFFLE 250
// ** val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_SHUFFLE);
// ** cds.dwData = IPC_PLAYFILE;
// ** cds.lpData = (void *) "file.mp3";
// ** cds.cbData = strlen((char *) cds.lpData)+1; // include space for null char
-// ** SendMessage(hwnd_winamp,WM_COPYDATA,(WPARAM)NULL,(LPARAM)&cds);
+// ** SendMessage(hwnd_winamp,WM_COPYDATA,(WPARAM)nullptr,(LPARAM)&cds);
// **
// ** This will play the file "file.mp3".
static QTextCodec * mediaplayer_get_codec()
{
- QTextCodec * pCodec = 0;
- pCodec = QTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding).toUtf8());
+ QTextCodec * pCodec = QTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding).toUtf8());
if(!pCodec)
pCodec = QTextCodec::codecForLocale();
static HWND find_winamp(KviWinampInterface * i)
{
- HWND hWnd = FindWindow(TEXT("Winamp v1.x"), NULL);
+ HWND hWnd = FindWindow(TEXT("Winamp v1.x"), nullptr);
if(!hWnd)
{
// try to start the process ?
cds.dwData = IPC_PLAYFILE;
cds.lpData = (void *)szMrl.ptr();
cds.cbData = szMrl.len() + 1; // include space for null char
- SendMessage(hWinamp, WM_COPYDATA, (WPARAM)NULL, (LPARAM)&cds);
+ SendMessage(hWinamp, WM_COPYDATA, (WPARAM)nullptr, (LPARAM)&cds);
return true;
}
return false;
bool KviWinampInterface::hide()
{
HWND hWinamp = find_winamp(this);
- HWND hWinampPE = FindWindow(TEXT("Winamp PE"), NULL); /*Playlist*/
- HWND hWinampEQ = FindWindow(TEXT("Winamp EQ"), NULL); /*Equalizer*/
- HWND hWinampMB = FindWindow(TEXT("Winamp MB"), NULL); /*MiniBrowser*/
- HWND hWinampGen = FindWindow(TEXT("Winamp Gen"), NULL); /*Library*/
- HWND hWinampVideo = FindWindow(TEXT("Winamp Video"), NULL); /*Video*/
+ HWND hWinampPE = FindWindow(TEXT("Winamp PE"), nullptr); /*Playlist*/
+ HWND hWinampEQ = FindWindow(TEXT("Winamp EQ"), nullptr); /*Equalizer*/
+ HWND hWinampMB = FindWindow(TEXT("Winamp MB"), nullptr); /*MiniBrowser*/
+ HWND hWinampGen = FindWindow(TEXT("Winamp Gen"), nullptr); /*Library*/
+ HWND hWinampVideo = FindWindow(TEXT("Winamp Video"), nullptr); /*Video*/
if(hWinamp)
{
ShowWindow(hWinamp, SW_HIDE);
#define KVIRC_WM_USER_CHECK 13123
#define KVIRC_WM_USER_CHECK_REPLY 13124
-void * lpWndProcOld = 0;
+void * lpWndProcOld = nullptr;
char szBuffer[4096];
#define GET_KVS_CONSOLE \
kvs_uint_t uiWnd; \
- KviConsoleWindow * wnd = 0; \
+ KviConsoleWindow * wnd = nullptr; \
KVSM_PARAMETERS_BEGIN(c) \
KVSM_PARAMETER("context_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uiWnd) \
KVSM_PARAMETERS_END(c) \
CHECK_INTERNAL_POINTER(m_pPainter)
m_pPainter->drawPath(*m_pPainterPath);
//delete m_pPainterPath;
- //m_pPainterPath=0;
+ //m_pPainterPath=nullptr;
return true;
}
{
*m_pImage = m_pPixmap->toImage();
delete m_pPixmap;
- m_pPixmap = 0;
+ m_pPixmap = nullptr;
}
}
m_currentType = Image;
{
*m_pPixmap = m_pPixmap->fromImage(*m_pImage);
delete m_pImage;
- m_pImage = 0;
+ m_pImage = nullptr;
}
}
m_currentType = Pixmap;
class KviCellItemDelegate : public QItemDelegate
{
public:
- KviCellItemDelegate(QAbstractItemView * pWidget = 0, KvsObject_tableWidget * pParent = 0);
+ KviCellItemDelegate(QAbstractItemView * pWidget = nullptr, KvsObject_tableWidget * pParent = nullptr);
~KviCellItemDelegate();
protected:
g_pKvs##__className##Class->registerStandardFalseReturnFunctionHandler(__szName);
#define KVSO_BEGIN_REGISTERCLASS(__className, __stringName, __baseClass) \
- static KviKvsObjectClass * g_pKvs##__className##Class = 0; \
+ static KviKvsObjectClass * g_pKvs##__className##Class = nullptr; \
static KviKvsObject * kvs_##__className##_createInstance(KviKvsObjectClass * pClass, KviKvsObject * pParent, const QString & szName) \
{ \
return new __className(pClass, pParent, szName); \
void __className::unregisterSelf() \
{ \
delete g_pKvs##__className##Class; \
- g_pKvs##__className##Class = 0; \
+ g_pKvs##__className##Class = nullptr; \
} \
void __className::registerSelf() \
{ \
QWidget * pOldPar = (QWidget *)pEntry->pWidget->parent();
pEntry->pWidget->setParent(pPar);
pOldPar->deleteLater();
- pEntry->pWidget = 0;
+ pEntry->pWidget = nullptr;
}
}
#endif
{
Q_OBJECT
public:
- MessageListWidgetItemDelegate(QAbstractItemView * pWidget = 0)
+ MessageListWidgetItemDelegate(QAbstractItemView * pWidget = nullptr)
: QItemDelegate(pWidget){};
~MessageListWidgetItemDelegate(){};
void paint(QPainter * p, const QStyleOptionViewItem & opt, const QModelIndex & index) const;
{
Q_OBJECT
public:
- MessageColorListWidgetItemDelegate(QAbstractItemView * pWidget = 0)
+ MessageColorListWidgetItemDelegate(QAbstractItemView * pWidget = nullptr)
: QItemDelegate(pWidget){};
~MessageColorListWidgetItemDelegate(){};
void paint(QPainter * p, const QStyleOptionViewItem & opt, const QModelIndex & index) const;
echo "$3 e$1 = new OptionsWidgetInstanceEntry;" >> $TARGET
echo -n "$3 e$1->createProc = &class$2" >> $TARGET
echo "_createInstanceProc;" >> $TARGET
- echo "$3 e$1->pWidget = 0;" >> $TARGET
+ echo "$3 e$1->pWidget = nullptr;" >> $TARGET
echo "$3 e$1->szClassName = g_szClassName_$2;" >> $TARGET
echo "$3 e$1->eIcon = KVI_OPTIONS_WIDGET_ICON_$2;" >> $TARGET
NEXTLEVEL=`expr $1 + 1`
addchildren $NEXTLEVEL $achild "$3 "
else
- echo "$3 e$1->pChildList = 0;" >> $TARGET
+ echo "$3 e$1->pChildList = nullptr;" >> $TARGET
fi
done
fi
{
disconnect(pEntry->pWidget,SIGNAL(destroyed()),this,SLOT(widgetDestroyed()));
delete pEntry->pWidget->parent();
- pEntry->pWidget = 0;
+ pEntry->pWidget = nullptr;
} else {
qDebug("Ops...i have deleted the options dialog ?");
}
void OptionsInstanceManager::cleanup(KviModule *)
{
deleteInstanceTree(m_pInstanceTree);
- m_pInstanceTree = 0;
+ m_pInstanceTree = nullptr;
}
void OptionsInstanceManager::widgetDestroyed()
{
OptionsWidgetInstanceEntry * pEntry = findInstanceEntry(sender(),m_pInstanceTree);
if(pEntry)
- pEntry->pWidget = 0;
+ pEntry->pWidget = nullptr;
if(g_iOptionWidgetInstances > 0)
g_iOptionWidgetInstances--;
KviOptionsWidget * OptionsInstanceManager::getInstance(OptionsWidgetInstanceEntry * pEntry, QWidget * pPar)
{
if(!pEntry)
- return NULL;
+ return nullptr;
#if 0
if(pEntry->pWidget)
QWidget * pOldPar = (QWidget *)pEntry->pWidget->parent();
pEntry->pWidget->setParent(pPar);
pOldPar->deleteLater();
- pEntry->pWidget = 0;
+ pEntry->pWidget = nullptr;
}
}
#endif
protected:
// theItem is the item above the first item that has to be inserted
- void populateMenu(KviKvsPopupMenu * pop, PopupTreeWidgetItem * par, PopupTreeWidgetItem * theItem = 0);
+ void populateMenu(KviKvsPopupMenu * pop, PopupTreeWidgetItem * par, PopupTreeWidgetItem * theItem = nullptr);
void saveLastSelectedItem();
void addItemToMenu(KviKvsPopupMenu * pop, PopupTreeWidgetItem * par);
PopupTreeWidgetItem * newItem(PopupTreeWidgetItem * par, PopupTreeWidgetItem * after, PopupTreeWidgetItem::Type t);
class RegisteredUsersDialogItemDelegate : public QStyledItemDelegate
{
public:
- RegisteredUsersDialogItemDelegate(KviRegisteredUsersListView * pWidget = 0)
+ RegisteredUsersDialogItemDelegate(KviRegisteredUsersListView * pWidget = nullptr)
: QStyledItemDelegate(pWidget){};
~RegisteredUsersDialogItemDelegate(){};
QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const override;
{
Q_OBJECT
public:
- RegisteredUsersDialog(QWidget * par = 0);
+ RegisteredUsersDialog(QWidget * par = nullptr);
~RegisteredUsersDialog();
public:
{
Q_OBJECT
public:
- RegistrationWizard(const QString & startMask, KviRegisteredUserDataBase * db = 0, QWidget * par = 0, bool bModal = false);
+ RegistrationWizard(const QString & startMask, KviRegisteredUserDataBase * db = nullptr, QWidget * par = nullptr, bool bModal = false);
~RegistrationWizard();
KviRegisteredUserDataBase * m_pDb;
public:
// Initializes the crypt session
// Returns RIJNDAEL_SUCCESS or an error code
- int init(Mode mode, Direction dir, const UINT8 * key, KeyLength keyLen, UINT8 * initVector = 0);
+ int init(Mode mode, Direction dir, const UINT8 * key, KeyLength keyLen, UINT8 * initVector = nullptr);
// Input len is in BITS!
// Encrypts inputLen / 128 blocks of input and puts it in outBuffer
// outBuffer must be at least inputLen / 8 bytes long.
// Returns the encrypted buffer length in BITS or an error code < 0 in case of error
- int blockEncrypt(const UINT8 * input, int inputLen, UINT8 * outBuffer, UINT8 * initVector = 0);
+ int blockEncrypt(const UINT8 * input, int inputLen, UINT8 * outBuffer, UINT8 * initVector = nullptr);
// Input len is in BYTES!
// outBuffer must be at least inputLen + 16 bytes long
// Returns the encrypted buffer length in BYTES or an error code < 0 in case of error
- int padEncrypt(const UINT8 * input, int inputOctets, UINT8 * outBuffer, UINT8 * initVector = 0);
+ int padEncrypt(const UINT8 * input, int inputOctets, UINT8 * outBuffer, UINT8 * initVector = nullptr);
// Input len is in BITS!
// outBuffer must be at least inputLen / 8 bytes long
// Returns the decrypted buffer length in BITS and an error code < 0 in case of error
- int blockDecrypt(const UINT8 * input, int inputLen, UINT8 * outBuffer, UINT8 * initVector = 0);
+ int blockDecrypt(const UINT8 * input, int inputLen, UINT8 * outBuffer, UINT8 * initVector = nullptr);
// Input len is in BYTES!
// outBuffer must be at least inputLen bytes long
// Returns the decrypted buffer length in BYTES and an error code < 0 in case of error
- int padDecrypt(const UINT8 * input, int inputOctets, UINT8 * outBuffer, UINT8 * initVector = 0);
+ int padDecrypt(const UINT8 * input, int inputOctets, UINT8 * outBuffer, UINT8 * initVector = nullptr);
protected:
void keySched(UINT8 key[_MAX_KEY_COLUMNS][4]);
void keyEncToDec();
void encrypt(const UINT8 a[16], UINT8 b[16]);
void decrypt(const UINT8 a[16], UINT8 b[16]);
- void updateInitVector(UINT8 * initVector = 0);
+ void updateInitVector(UINT8 * initVector = nullptr);
};
#endif // COMPILE_CRYPT_SUPPORT
0, KEY_QUERY_VALUE, &hCU)
== ERROR_SUCCESS)
{
- RegQueryValueEx(hCU, TEXT("Desktop"), NULL, &lpType,
+ RegQueryValueEx(hCU, TEXT("Desktop"), nullptr, &lpType,
(unsigned char *)&szLink, &ulSize);
RegCloseKey(hCU);
}
szKvircExec.append("\\kvirc.exe");
// Trigger a horrible machinery
- CoInitialize(NULL); // we need COM+OLE
+ CoInitialize(nullptr); // we need COM+OLE
// Fiddle with an obscure shell interface
IShellLink * psl;
// Get a pointer to the IShellLink interface: this is kinda ugly :)
- if(CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
+ if(CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER,
IID_IShellLink, (void **)&psl)
== S_OK)
{
{
Q_OBJECT
public:
- SharedFileEditDialog(QWidget * par, KviSharedFile * f = 0);
+ SharedFileEditDialog(QWidget * par, KviSharedFile * f = nullptr);
virtual ~SharedFileEditDialog();
QDateTimeEdit * m_pExpireDateTimeEdit;
#else
#ifdef COMPILE_ESD_SUPPORT
esd_format_t format = ESD_BITS16 | ESD_STREAM | ESD_PLAY | ESD_MONO;
- int esd_fd = esd_play_stream(format, 8012, NULL, "kvirc");
+ int esd_fd = esd_play_stream(format, 8012, nullptr, "kvirc");
if(esd_fd >= 0)
{
KVI_OPTION_STRING(KviOption_stringSoundSystem) = "esd";
void KviEsdSoundThread::play()
{
// ESD has a really nice API
- if(!esd_play_file(NULL, m_szFileName.toUtf8().data(), 1)) // this is sync.. FIXME: it can't be stopped!
+ if(!esd_play_file(nullptr, m_szFileName.toUtf8().data(), 1)) // this is sync.. FIXME: it can't be stopped!
qDebug("Could not play sound %s! [ESD]", m_szFileName.toUtf8().data());
}
g_pTermWidgetList.insert(this);
m_bIsStandalone = bIsStandalone;
- m_pKonsolePart = 0;
- m_pKonsoleWidget = 0;
+ m_pKonsolePart = nullptr;
+ m_pKonsoleWidget = nullptr;
if(bIsStandalone)
{
}
else
{
- m_pHBox = 0;
- m_pTitleLabel = 0;
- m_pCloseButton = 0;
+ m_pHBox = nullptr;
+ m_pTitleLabel = nullptr;
+ m_pCloseButton = nullptr;
}
setFrameStyle(QFrame::Sunken | QFrame::Panel);
void TermWidget::konsoleDestroyed()
{
- m_pKonsoleWidget = 0;
- m_pKonsolePart = 0;
+ m_pKonsoleWidget = nullptr;
+ m_pKonsolePart = nullptr;
hide();
QTimer::singleShot(0, this, SLOT(autoClose()));
}
: KviWindow(KviWindow::Terminal, name)
{
g_pTermWindowList.insert(this);
- m_pTermWidget = 0;
+ m_pTermWidget = nullptr;
m_pTermWidget = new TermWidget(this);
}
namespace ThemeFunctions
{
- bool installThemePackage(const QString & szThemePackageFileName, QString & szError, QWidget * pDialogParent = 0);
+ bool installThemePackage(const QString & szThemePackageFileName, QString & szError, QWidget * pDialogParent = nullptr);
void getThemeHtmlDescription(
QString & szBuffer,
const QString & szThemeThemeEngineVersion,
const QPixmap & pixScreenshot,
int iUniqueIndexInDocument = 0,
- KviHtmlDialogData * hd = 0);
+ KviHtmlDialogData * hd = nullptr);
bool makeKVIrcScreenshot(const QString & szSavePngFilePath, bool bMaximizeFrame = false);
{
Q_OBJECT
public:
- WebThemeInterfaceDialog(QWidget * par = 0);
+ WebThemeInterfaceDialog(QWidget * par = nullptr);
~WebThemeInterfaceDialog();
private:
_interfaceclass##Descriptor::_interfaceclass##Descriptor() \
: TorrentInterfaceDescriptor() \
{ \
- m_pInstance = 0; \
+ m_pInstance = nullptr; \
m_szName = _name; \
m_szDescription = _description; \
} \
{
Q_OBJECT
public:
- BanFrame(QWidget * parent = 0, const char * name = 0, bool banEnable = false);
+ BanFrame(QWidget * parent = nullptr, const char * name = nullptr, bool banEnable = false);
~BanFrame();
void saveBans(KviConfigurationFile * cfg);
};
public:
- UserWindow(const char * pcName, QString & szIcon, KviConsoleWindow * pConsole = 0, int iCreationFlags = 0);
+ UserWindow(const char * pcName, QString & szIcon, KviConsoleWindow * pConsole = nullptr, int iCreationFlags = 0);
~UserWindow();
protected: