aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Elvio Basello2010-12-29 02:08:00 +0000
committerGravatar Elvio Basello2010-12-29 02:08:00 +0000
commit7d415037b4609b7f88966025edd757cac32a49dd (patch)
tree894e19472d87327c12d0110cd395e7400b04b6c1 /src
parentyet more splitting (diff)
downloadKVIrc-7d415037b4609b7f88966025edd757cac32a49dd.tar.gz
KVIrc-7d415037b4609b7f88966025edd757cac32a49dd.tar.bz2
KVIrc-7d415037b4609b7f88966025edd757cac32a49dd.zip
yet more splitting
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5252 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src')
-rw-r--r--src/kvilib/CMakeLists.txt3
-rw-r--r--src/kvilib/ext/KviRegisteredMask.cpp32
-rw-r--r--src/kvilib/ext/KviRegisteredMask.h51
-rw-r--r--src/kvilib/ext/KviRegisteredUser.cpp172
-rw-r--r--src/kvilib/ext/KviRegisteredUser.h85
-rw-r--r--src/kvilib/ext/KviRegisteredUserDataBase.cpp174
-rw-r--r--src/kvilib/ext/KviRegisteredUserDataBase.h114
-rw-r--r--src/kvilib/ext/KviRegisteredUserGroup.cpp34
-rw-r--r--src/kvilib/ext/KviRegisteredUserGroup.h48
9 files changed, 432 insertions, 281 deletions
diff --git a/src/kvilib/CMakeLists.txt b/src/kvilib/CMakeLists.txt
index 908dd7a8c..42e5045ce 100644
--- a/src/kvilib/CMakeLists.txt
+++ b/src/kvilib/CMakeLists.txt
@@ -79,7 +79,10 @@ SET(kvilib_SRCS
ext/KviProxy.cpp
ext/KviProxyDataBase.cpp
ext/KviRegisteredChannel.cpp
+ ext/KviRegisteredMask.cpp
+ ext/KviRegisteredUser.cpp
ext/KviRegisteredUserDataBase.cpp
+ ext/KviRegisteredUserGroup.cpp
ext/KviSharedFilesManager.cpp
ext/KviStringConversion.cpp
file/KviFile.cpp
diff --git a/src/kvilib/ext/KviRegisteredMask.cpp b/src/kvilib/ext/KviRegisteredMask.cpp
new file mode 100644
index 000000000..88db817ef
--- /dev/null
+++ b/src/kvilib/ext/KviRegisteredMask.cpp
@@ -0,0 +1,32 @@
+//=============================================================================
+//
+// File : KviRegisteredMask.cpp
+// Creation date : Wed Dec 29 2010 02:39:05 CEST by Elvio Basello
+//
+// This file is part of the KVirc irc client distribution
+// Copyright (C) 2010 Elvio Basello (hellvis69 at gmail dot com)
+//
+// This program is FREE software. You can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your opinion) any later version.
+//
+// This program is distributed in the HOPE that it will be USEFUL,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+// See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, write to the Free Software Foundation,
+// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=============================================================================
+
+#include "KviRegisteredMask.h"
+
+KviRegisteredMask::KviRegisteredMask(KviRegisteredUser * pUser, KviIrcMask * pMask)
+{
+ m_pUser = pUser;
+ m_pMask = pMask;
+ m_iMaskNonWildChars = m_pMask->nonWildChars();
+}
diff --git a/src/kvilib/ext/KviRegisteredMask.h b/src/kvilib/ext/KviRegisteredMask.h
new file mode 100644
index 000000000..af1811b50
--- /dev/null
+++ b/src/kvilib/ext/KviRegisteredMask.h
@@ -0,0 +1,51 @@
+#ifndef _KVIREGMASK_H_
+#define _KVIREGMASK_H_
+
+//=============================================================================
+//
+// File : KviRegisteredMask.h
+// Creation date : Wed Dec 29 2010 02:39:05 CEST by Elvio Basello
+//
+// This file is part of the KVirc irc client distribution
+// Copyright (C) 2010 Elvio Basello (hellvis69 at gmail dot com)
+//
+// This program is FREE software. You can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your opinion) any later version.
+//
+// This program is distributed in the HOPE that it will be USEFUL,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+// See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, write to the Free Software Foundation,
+// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=============================================================================
+
+// this file was originally part of KviRegisteredUserDataBase.h
+
+#include "kvi_settings.h"
+#include "KviIrcMask.h"
+#include "KviRegisteredUser.h"
+
+class KVILIB_API KviRegisteredMask
+{
+private:
+ KviRegisteredUser * m_pUser; // pointer, not owned!
+ KviIrcMask * m_pMask; // pointer, not owned!
+ int m_iMaskNonWildChars;
+public:
+ KviRegisteredMask(KviRegisteredUser * pUser, KviIrcMask * pMask);
+ ~KviRegisteredMask(){};
+public:
+ int nonWildChars(){ return m_iMaskNonWildChars; };
+ KviRegisteredUser * user(){ return m_pUser; };
+ KviIrcMask * mask(){ return m_pMask; };
+};
+
+typedef KviPointerList<KviRegisteredMask> KviRegisteredMaskList;
+
+#endif // _KVIREGMASK_H_ \ No newline at end of file
diff --git a/src/kvilib/ext/KviRegisteredUser.cpp b/src/kvilib/ext/KviRegisteredUser.cpp
new file mode 100644
index 000000000..167989cf5
--- /dev/null
+++ b/src/kvilib/ext/KviRegisteredUser.cpp
@@ -0,0 +1,172 @@
+#ifndef _KVIREGUSER_H_
+#define _KVIREGUSER_H_
+
+//=============================================================================
+//
+// File : KviRegisteredUser.cpp
+// Creation date : Wed Dec 29 2010 02:44:05 CEST by Elvio Basello
+//
+// This file is part of the KVirc irc client distribution
+// Copyright (C) 2010 Elvio Basello (hellvis69 at gmail dot com)
+//
+// This program is FREE software. You can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your opinion) any later version.
+//
+// This program is distributed in the HOPE that it will be USEFUL,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+// See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, write to the Free Software Foundation,
+// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=============================================================================
+
+#include "KviRegisteredUser.h"
+
+KviRegisteredUser::KviRegisteredUser(const QString & name)
+{
+ m_iIgnoreFlags =0;
+ m_bIgnoreEnabled=false;
+ m_szName = name;
+ m_pPropertyDict = 0;
+ m_pMaskList = new KviPointerList<KviIrcMask>;
+ m_pMaskList->setAutoDelete(true);
+}
+
+KviRegisteredUser::~KviRegisteredUser()
+{
+ if(m_pPropertyDict)
+ delete m_pPropertyDict;
+ delete m_pMaskList;
+}
+
+bool KviRegisteredUser::isIgnoreEnabledFor(IgnoreFlags flag)
+{
+ if(!m_bIgnoreEnabled) return false;
+ return m_iIgnoreFlags & flag;
+}
+
+KviIrcMask * KviRegisteredUser::findMask(const KviIrcMask &mask)
+{
+ for(KviIrcMask * m = m_pMaskList->first();m;m = m_pMaskList->next())
+ {
+ if(*m == mask)return m;
+ }
+ return 0;
+}
+
+bool KviRegisteredUser::addMask(KviIrcMask * mask)
+{
+ if(findMask(*mask))
+ {
+ delete mask;
+ mask = 0;
+ return false;
+ }
+ m_pMaskList->append(mask);
+ return true;
+}
+
+bool KviRegisteredUser::removeMask(KviIrcMask * mask)
+{
+ if(!mask)return false;
+ return m_pMaskList->removeRef(mask);
+}
+
+bool KviRegisteredUser::matches(const KviIrcMask &mask)
+{
+ for(KviIrcMask * m = m_pMaskList->first();m;m = m_pMaskList->next())
+ {
+ if(m->matches(mask))return true;
+ }
+ return false;
+}
+
+bool KviRegisteredUser::matchesFixed(const KviIrcMask &mask)
+{
+ for(KviIrcMask * m = m_pMaskList->first();m;m = m_pMaskList->next())
+ {
+ if(m->matchesFixed(mask))return true;
+ }
+ return false;
+}
+
+bool KviRegisteredUser::matchesFixed(const QString & nick,const QString & user,const QString & host)
+{
+ for(KviIrcMask * m = m_pMaskList->first();m;m = m_pMaskList->next())
+ {
+ if(m->matchesFixed(nick,user,host))return true;
+ }
+ return false;
+}
+
+void KviRegisteredUser::setProperty(const QString &name,bool value)
+{
+ setProperty(name,value ? QString("true") : QString("false"));
+}
+
+void KviRegisteredUser::setProperty(const QString & name,const QString & value)
+{
+ if(!value.isEmpty())
+ {
+ if(!m_pPropertyDict)
+ {
+ m_pPropertyDict = new KviPointerHashTable<QString,QString>(7,false);
+ m_pPropertyDict->setAutoDelete(true);
+ }
+
+ QString * val = new QString(value.trimmed());
+ if(!val->isEmpty())
+ {
+ m_pPropertyDict->replace(name,val);
+ } else {
+ delete val;
+ val = 0;
+ }
+ } else {
+ if(m_pPropertyDict)m_pPropertyDict->remove(name);
+ }
+}
+
+bool KviRegisteredUser::getProperty(const QString & name,QString &value)
+{
+ if(!m_pPropertyDict)return false;
+ if(name.isEmpty()) return false;
+ QString * pValue = m_pPropertyDict->find(name);
+ if(pValue)value = *pValue;
+ else return false;
+ return true;
+}
+
+const QString & KviRegisteredUser::getProperty(const QString & name)
+{
+ if(!m_pPropertyDict)return KviQString::Empty;
+ if(name.isEmpty())return KviQString::Empty;
+ QString * pValue = m_pPropertyDict->find(name);
+ if(pValue)return *pValue;
+ return KviQString::Empty;
+}
+
+bool KviRegisteredUser::getBoolProperty(const QString & name,bool def)
+{
+ if(!m_pPropertyDict)return def;
+ if(name.isEmpty()) return def;
+ QString * pValue = m_pPropertyDict->find(name);
+ if(pValue)
+ {
+ // be flexible, allow more "true" values (pragma)
+ if(KviQString::equalCS(*pValue,"1"))return true;
+ if(KviQString::equalCI(*pValue,"true"))return true;
+ if(KviQString::equalCI(*pValue,"yes"))return true;
+ //if(KviQString::equalCI(*pValue,"yeah"))return true;
+ //if(KviQString::equalCI(*pValue,"sure"))return true;
+ //if(KviQString::equalCI(*pValue,"sureashell"))return true;
+ }
+ return def;
+}
+
+#endif // _KVIREGUSER_H_
diff --git a/src/kvilib/ext/KviRegisteredUser.h b/src/kvilib/ext/KviRegisteredUser.h
new file mode 100644
index 000000000..30d481ba9
--- /dev/null
+++ b/src/kvilib/ext/KviRegisteredUser.h
@@ -0,0 +1,85 @@
+//=============================================================================
+//
+// File : KviRegisteredUser.h
+// Creation date : Wed Dec 29 2010 02:44:05 CEST by Elvio Basello
+//
+// This file is part of the KVirc irc client distribution
+// Copyright (C) 2010 Elvio Basello (hellvis69 at gmail dot com)
+//
+// This program is FREE software. You can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your opinion) any later version.
+//
+// This program is distributed in the HOPE that it will be USEFUL,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+// See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, write to the Free Software Foundation,
+// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=============================================================================
+
+// this file was originally part of KviRegisteredUserDataBase.h
+
+#include "kvi_settings.h"
+#include "KviHeapObject.h"
+#include "KviIrcMask.h"
+#include "KviPointerList.h"
+#include "KviPointerHashTable.h"
+
+class KVILIB_API KviRegisteredUser : public KviHeapObject
+{
+ friend class KviRegisteredUserDataBase;
+public:
+ enum IgnoreFlags {
+ Channel=1,
+ Query=2,
+ Notice=4,
+ Ctcp=8,
+ Invite=16,
+ Dcc=32
+ };
+
+ KviRegisteredUser(const QString & szName);
+ ~KviRegisteredUser();
+private:
+ int m_iIgnoreFlags;
+ bool m_bIgnoreEnabled;
+ QString m_szName;
+ QString m_szGroup;
+ KviPointerHashTable<QString,QString> * m_pPropertyDict; // owned properties
+ KviPointerList<KviIrcMask> * m_pMaskList; // owned masks
+protected:
+ // mask ownership is transferred! (always!) returns false if the mask was already there
+ bool addMask(KviIrcMask * pMask);
+ bool removeMask(KviIrcMask * pMask);
+ KviIrcMask * findMask(const KviIrcMask & mask);
+public:
+ int ignoreFlags(){ return m_iIgnoreFlags; };
+ void setIgnoreFlags(int iFlags){ m_iIgnoreFlags = iFlags; };
+ bool ignoreEnagled(){ return m_bIgnoreEnabled; };
+ void setIgnoreEnabled(bool bEnabled){ m_bIgnoreEnabled = bEnabled; };
+ bool isIgnoreEnabledFor(IgnoreFlags flag);
+
+ const QString & name(){ return m_szName; };
+ bool matches(const KviIrcMask & mask);
+ bool matchesFixed(const KviIrcMask & mask);
+ bool matchesFixed(const QString & szNick, const QString & szUser, const QString & szHost);
+
+ void setProperty(const QString & szName, const QString & szValue);
+ void setProperty(const QString & szName, bool szValue);
+
+ void setGroup(const QString & szName) { m_szGroup = szName; };
+ const QString & group(){ return m_szGroup; };
+
+ const QString & getProperty(const QString & szName); // returns 0 if the property is not there
+ bool getProperty(const QString & szName, QString & szValue); // returns false if the property is not there
+ bool getBoolProperty(const QString & szName, bool bDef = false); // returns true if the property is there and is true
+ // the propertyDict may be 0!
+ KviPointerHashTable<QString,QString> * propertyDict(){ return m_pPropertyDict; };
+ // this is never zero (but may contain no masks)
+ KviPointerList<KviIrcMask> * maskList(){ return m_pMaskList; };
+};
diff --git a/src/kvilib/ext/KviRegisteredUserDataBase.cpp b/src/kvilib/ext/KviRegisteredUserDataBase.cpp
index 99d63658a..25d07f2cf 100644
--- a/src/kvilib/ext/KviRegisteredUserDataBase.cpp
+++ b/src/kvilib/ext/KviRegisteredUserDataBase.cpp
@@ -117,182 +117,8 @@
It provides a set of commands for adding and removing masks and manipulating properties.[br]
*/
-//============================================================================================================
-//
-// KviRegisteredMask
-//
-
KVILIB_API KviRegisteredUserDataBase* g_pRegisteredUserDataBase = 0;
-KviRegisteredMask::KviRegisteredMask(KviRegisteredUser * u,KviIrcMask * m)
-{
- m_pUser = u;
- m_pMask = m;
- m_iMaskNonWildChars = m_pMask->nonWildChars();
-}
-
-//============================================================================================================
-//
-// KviRegisteredUser
-//
-
-
-KviRegisteredUser::KviRegisteredUser(const QString & name)
-{
- m_iIgnoreFlags =0;
- m_bIgnoreEnabled=false;
- m_szName = name;
- m_pPropertyDict = 0;
- m_pMaskList = new KviPointerList<KviIrcMask>;
- m_pMaskList->setAutoDelete(true);
-}
-
-KviRegisteredUser::~KviRegisteredUser()
-{
- if(m_pPropertyDict)
- delete m_pPropertyDict;
- delete m_pMaskList;
-}
-
-bool KviRegisteredUser::isIgnoreEnabledFor(IgnoreFlags flag)
-{
- if(!m_bIgnoreEnabled) return false;
- return m_iIgnoreFlags & flag;
-}
-
-KviIrcMask * KviRegisteredUser::findMask(const KviIrcMask &mask)
-{
- for(KviIrcMask * m = m_pMaskList->first();m;m = m_pMaskList->next())
- {
- if(*m == mask)return m;
- }
- return 0;
-}
-
-bool KviRegisteredUser::addMask(KviIrcMask * mask)
-{
- if(findMask(*mask))
- {
- delete mask;
- mask = 0;
- return false;
- }
- m_pMaskList->append(mask);
- return true;
-}
-
-bool KviRegisteredUser::removeMask(KviIrcMask * mask)
-{
- if(!mask)return false;
- return m_pMaskList->removeRef(mask);
-}
-
-bool KviRegisteredUser::matches(const KviIrcMask &mask)
-{
- for(KviIrcMask * m = m_pMaskList->first();m;m = m_pMaskList->next())
- {
- if(m->matches(mask))return true;
- }
- return false;
-}
-
-bool KviRegisteredUser::matchesFixed(const KviIrcMask &mask)
-{
- for(KviIrcMask * m = m_pMaskList->first();m;m = m_pMaskList->next())
- {
- if(m->matchesFixed(mask))return true;
- }
- return false;
-}
-
-bool KviRegisteredUser::matchesFixed(const QString & nick,const QString & user,const QString & host)
-{
- for(KviIrcMask * m = m_pMaskList->first();m;m = m_pMaskList->next())
- {
- if(m->matchesFixed(nick,user,host))return true;
- }
- return false;
-}
-
-void KviRegisteredUser::setProperty(const QString &name,bool value)
-{
- setProperty(name,value ? QString("true") : QString("false"));
-}
-
-void KviRegisteredUser::setProperty(const QString & name,const QString & value)
-{
- if(!value.isEmpty())
- {
- if(!m_pPropertyDict)
- {
- m_pPropertyDict = new KviPointerHashTable<QString,QString>(7,false);
- m_pPropertyDict->setAutoDelete(true);
- }
-
- QString * val = new QString(value.trimmed());
- if(!val->isEmpty())
- {
- m_pPropertyDict->replace(name,val);
- } else {
- delete val;
- val = 0;
- }
- } else {
- if(m_pPropertyDict)m_pPropertyDict->remove(name);
- }
-}
-
-bool KviRegisteredUser::getProperty(const QString & name,QString &value)
-{
- if(!m_pPropertyDict)return false;
- if(name.isEmpty()) return false;
- QString * pValue = m_pPropertyDict->find(name);
- if(pValue)value = *pValue;
- else return false;
- return true;
-}
-
-const QString & KviRegisteredUser::getProperty(const QString & name)
-{
- if(!m_pPropertyDict)return KviQString::Empty;
- if(name.isEmpty())return KviQString::Empty;
- QString * pValue = m_pPropertyDict->find(name);
- if(pValue)return *pValue;
- return KviQString::Empty;
-}
-
-bool KviRegisteredUser::getBoolProperty(const QString & name,bool def)
-{
- if(!m_pPropertyDict)return def;
- if(name.isEmpty()) return def;
- QString * pValue = m_pPropertyDict->find(name);
- if(pValue)
- {
- // be flexible, allow more "true" values (pragma)
- if(KviQString::equalCS(*pValue,"1"))return true;
- if(KviQString::equalCI(*pValue,"true"))return true;
- if(KviQString::equalCI(*pValue,"yes"))return true;
- //if(KviQString::equalCI(*pValue,"yeah"))return true;
- //if(KviQString::equalCI(*pValue,"sure"))return true;
- //if(KviQString::equalCI(*pValue,"sureashell"))return true;
- }
- return def;
-}
-
-//============================================================================================================
-//
-// KviRegisteredUserGroup
-//
-
-KviRegisteredUserGroup::KviRegisteredUserGroup(const QString &name)
-{
- setName(name);
-}
-
-KviRegisteredUserGroup::~KviRegisteredUserGroup()
-{
-}
-
//============================================================================================================
//
diff --git a/src/kvilib/ext/KviRegisteredUserDataBase.h b/src/kvilib/ext/KviRegisteredUserDataBase.h
index 967b8eace..9c11e0890 100644
--- a/src/kvilib/ext/KviRegisteredUserDataBase.h
+++ b/src/kvilib/ext/KviRegisteredUserDataBase.h
@@ -31,118 +31,15 @@
//
#include "kvi_settings.h"
-#include "KviHeapObject.h"
-#include "KviQString.h"
-#include "KviIrcMask.h"
#include "kvi_debug.h"
-#include "KviPointerList.h"
+#include "KviHeapObject.h"
#include "KviPointerHashTable.h"
-#include <QObject>
-
-class KviRegisteredUserDataBase;
-
-#ifndef _KVI_REGUSERDB_CPP_
- extern KVILIB_API KviRegisteredUserDataBase * g_pRegisteredUserDataBase;
-#endif //!_KVI_REGUSERDB_CPP_
-
-//=================================================================================================
-//
-// KviRegisteredUser
-//
+#include "KviRegisteredUserGroup.h"
+#include "KviRegisteredMask.h"
-class KVILIB_API KviRegisteredUser : public KviHeapObject
-{
- friend class KviRegisteredUserDataBase;
-public:
- enum IgnoreFlags {
- Channel=1,
- Query=2,
- Notice=4,
- Ctcp=8,
- Invite=16,
- Dcc=32
- };
-
- KviRegisteredUser(const QString &name);
- ~KviRegisteredUser();
-private:
- int m_iIgnoreFlags;
- bool m_bIgnoreEnabled;
- QString m_szName;
- QString m_szGroup;
- KviPointerHashTable<QString,QString> * m_pPropertyDict; // owned properties
- KviPointerList<KviIrcMask> * m_pMaskList; // owned masks
-protected:
- // mask ownership is transferred! (always!) returns false if the mask was already there
- bool addMask(KviIrcMask * mask);
- bool removeMask(KviIrcMask * mask);
- KviIrcMask * findMask(const KviIrcMask &mask);
-public:
- int ignoreFlags() { return m_iIgnoreFlags; };
- void setIgnoreFlags(int flags) {m_iIgnoreFlags=flags; };
- bool ignoreEnagled() { return m_bIgnoreEnabled; };
- void setIgnoreEnabled(bool enabled) {m_bIgnoreEnabled=enabled;};
- bool isIgnoreEnabledFor(IgnoreFlags flag);
-
- const QString &name(){ return m_szName; };
- bool matches(const KviIrcMask &mask);
- bool matchesFixed(const KviIrcMask &mask);
- bool matchesFixed(const QString &nick,const QString &user,const QString &host);
-
- void setProperty(const QString &name,const QString &value);
- void setProperty(const QString &name,bool value);
-
- void setGroup(const QString &name) { m_szGroup=name; };
- const QString &group(){ return m_szGroup; };
-
- const QString & getProperty(const QString &name); // returns 0 if the property is not there
- bool getProperty(const QString &name,QString &value); // returns false if the property is not there
- bool getBoolProperty(const QString &name,bool def=FALSE); // returns true if the property is there and is true
- // the propertyDict may be 0!
- KviPointerHashTable<QString,QString> * propertyDict(){ return m_pPropertyDict; };
- // this is never zero (but may contain no masks)
- KviPointerList<KviIrcMask> * maskList(){ return m_pMaskList; };
-};
-
-//============================================================================================================
-//
-// KviRegisteredUserGroup
-//
-
-class KVILIB_API KviRegisteredUserGroup : public KviHeapObject
-{
- friend class KviRegisteredUserDataBase;
-public:
- KviRegisteredUserGroup(const QString &name);
- ~KviRegisteredUserGroup();
-
- void setName(const QString &name) { m_szName=name; };
- const QString &name(){ return m_szName; };
-private:
- QString m_szName;
-};
-//============================================================================================================
-//
-// KviRegisteredMask
-//
-
-class KVILIB_API KviRegisteredMask
-{
-private:
- KviRegisteredUser * m_pUser; // pointer, not owned!
- KviIrcMask * m_pMask; // pointer, not owned!
- int m_iMaskNonWildChars;
-public:
- KviRegisteredMask(KviRegisteredUser * u,KviIrcMask * m);
- ~KviRegisteredMask(){};
-public:
- int nonWildChars(){ return m_iMaskNonWildChars; };
- KviRegisteredUser * user(){ return m_pUser; };
- KviIrcMask * mask(){ return m_pMask; };
-};
+#include <QObject>
-typedef KviPointerList<KviRegisteredMask> KviRegisteredMaskList;
//=================================================================================================
//
@@ -197,5 +94,8 @@ signals:
void databaseCleared();
};
+#ifndef _KVI_REGUSERDB_CPP_
+ extern KVILIB_API KviRegisteredUserDataBase * g_pRegisteredUserDataBase;
+#endif // _KVI_REGUSERDB_CPP_
#endif //_KVI_REGUSERSDB_H_
diff --git a/src/kvilib/ext/KviRegisteredUserGroup.cpp b/src/kvilib/ext/KviRegisteredUserGroup.cpp
new file mode 100644
index 000000000..6f49a6166
--- /dev/null
+++ b/src/kvilib/ext/KviRegisteredUserGroup.cpp
@@ -0,0 +1,34 @@
+//=============================================================================
+//
+// File : KviRegisteredUserGroup.cpp
+// Creation date : Wed Dec 29 2010 02:24:21 CEST by Elvio Basello
+//
+// This file is part of the KVirc irc client distribution
+// Copyright (C) 2010 Elvio Basello (hellvis69 at gmail dot com)
+//
+// This program is FREE software. You can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your opinion) any later version.
+//
+// This program is distributed in the HOPE that it will be USEFUL,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+// See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, write to the Free Software Foundation,
+// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=============================================================================
+
+#include "KviRegisteredUserGroup.h"
+
+KviRegisteredUserGroup::KviRegisteredUserGroup(const QString & szName)
+{
+ setName(szName);
+}
+
+KviRegisteredUserGroup::~KviRegisteredUserGroup()
+{
+}
diff --git a/src/kvilib/ext/KviRegisteredUserGroup.h b/src/kvilib/ext/KviRegisteredUserGroup.h
new file mode 100644
index 000000000..5c9349611
--- /dev/null
+++ b/src/kvilib/ext/KviRegisteredUserGroup.h
@@ -0,0 +1,48 @@
+#ifndef _KVIREGUSERGROUP_H_
+#define _KVIREGUSERGROUP_H_
+
+//=============================================================================
+//
+// File : KviRegisteredUserGroup.h
+// Creation date : Wed Dec 29 2010 02:24:21 CEST by Elvio Basello
+//
+// This file is part of the KVirc irc client distribution
+// Copyright (C) 2010 Elvio Basello (hellvis69 at gmail dot com)
+//
+// This program is FREE software. You can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your opinion) any later version.
+//
+// This program is distributed in the HOPE that it will be USEFUL,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+// See the GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, write to the Free Software Foundation,
+// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=============================================================================
+
+// this file was originally part of KviRegisteredUserDataBase.h
+
+#include "kvi_settings.h"
+#include "KviHeapObject.h"
+
+#include <QString>
+
+class KVILIB_API KviRegisteredUserGroup : public KviHeapObject
+{
+ friend class KviRegisteredUserDataBase;
+public:
+ KviRegisteredUserGroup(const QString & szName);
+ ~KviRegisteredUserGroup();
+private:
+ QString m_szName;
+public:
+ void setName(const QString & szName) { m_szName = szName; };
+ const QString & name(){ return m_szName; };
+};
+
+#endif // _KVIREGUSERGROUP_H_ \ No newline at end of file