diff options
| -rw-r--r-- | TODO-doxygen | 3 | ||||
| -rw-r--r-- | src/kvilib/config/kvi_confignames.h | 39 | ||||
| -rw-r--r-- | src/kvilib/config/kvi_defaults.h | 34 | ||||
| -rw-r--r-- | src/kvilib/config/kvi_fileextensions.h | 30 | ||||
| -rw-r--r-- | src/kvilib/config/kvi_settings.h | 13 | ||||
| -rw-r--r-- | src/kvilib/config/kvi_sourcesdate.h | 23 | ||||
| -rw-r--r-- | src/kvilib/config/kvi_version.h | 10 | ||||
| -rw-r--r-- | src/kvilib/config/kvi_wincfg.h | 132 | ||||
| -rw-r--r-- | src/kvilib/core/kvi_pointerlist.h | 3 | ||||
| -rw-r--r-- | src/kvilib/core/kvi_qcstring.h | 2 | ||||
| -rw-r--r-- | src/kvilib/file/kvi_packagefile.h | 17 | ||||
| -rw-r--r-- | src/kvilib/system/kvi_locale.cpp | 36 | ||||
| -rw-r--r-- | src/kvilib/system/kvi_time.cpp | 2 | ||||
| -rw-r--r-- | src/kvilib/system/kvi_time.h | 94 | ||||
| -rw-r--r-- | src/kvirc/ui/kvi_topicw.cpp | 2 |
15 files changed, 288 insertions, 152 deletions
diff --git a/TODO-doxygen b/TODO-doxygen index 798987167..b1ba4e69a 100644 --- a/TODO-doxygen +++ b/TODO-doxygen @@ -86,6 +86,7 @@ core/kvi_heapobject.h - incomplete from line 75 to 80 core/kvi_strasm.h core/kvi_string.h core/kvi_qstring.h - incomplete lines 56-61, 70-75 +core/kvi_error.h - incomplete from line 36 to 185 file/kvi_file.h system/kvi_env.h system/kvi_locale.h @@ -94,6 +95,8 @@ system/kvi_stdarg.h system/kvi_byteorder.h system/kvi_thread.h system/kvi_process.h +config/kvi_settings.h +config/kvi_debug.h kvirc: ui/kvi_historywin.h diff --git a/src/kvilib/config/kvi_confignames.h b/src/kvilib/config/kvi_confignames.h index 05f6e79fb..38455bab0 100644 --- a/src/kvilib/config/kvi_confignames.h +++ b/src/kvilib/config/kvi_confignames.h @@ -25,14 +25,39 @@ // //============================================================================= -#include "kvi_fileextensions.h" +/** +* \file kvi_confignames.h +* \author Szymon Stefanek +* \brief This file contains the config file names used in KVIrc +* You can play a bit with these, but be aware that some (bad) scripts may find +* themselves in trouble +* +* \def KVI_CONFIGFILE_MAIN Defines main.kvc +* \def KVI_CONFIGFILE_WINPROPERTIES Defines winproperties.kvc +* \def KVI_CONFIGFILE_SERVERDB Defines serverdb.kvc +* \def KVI_CONFIGFILE_PROXYDB Defines proxydb.kvc +* \def KVI_CONFIGFILE_EVENTS Defines events.kvc +* \def KVI_CONFIGFILE_RAWEVENTS Defines rawevents.kvc +* \def KVI_CONFIGFILE_POPUPS Defines popups.kvc +* \def KVI_CONFIGFILE_SCRIPTTOOLBARS Defines toolbars.kvc +* \def KVI_CONFIGFILE_CUSTOMTOOLBARS Defines customtoolbars.kvc +* \def KVI_CONFIGFILE_MEDIATYPES Defines mediatypes.kvc +* \def KVI_CONFIGFILE_REGUSERDB Defines reguserdb.kvc +* \def KVI_CONFIGFILE_SHAREDFILES Defines sharedfiles.kvc +* \def KVI_CONFIGFILE_RECENT Defines recent.kvc +* \def KVI_CONFIGFILE_TOOLBARS Defines toolbarpos.kvc +* \def KVI_CONFIGFILE_ALIASES Defines aliases.kvc +* \def KVI_CONFIGFILE_NICKSERVDATABASE Defines nickserv.kvc +* \def KVI_CONFIGFILE_TEXTICONS Defines texticons.kvc +* \def KVI_CONFIGFILE_REGCHANDB Defines regchan.kvc +* \def KVI_CONFIGFILE_INPUTHISTORY Defines inputhistory.kvc +* \def KVI_CONFIGFILE_AVATARCACHE Defines avatarcache.kvc +* \def KVI_CONFIGFILE_USERACTIONS Defines useractions.kvc +* \def KVI_CONFIGFILE_SCRIPTADDONS Defines scriptaddons.kvc +* \def KVI_CONFIGFILE_IDENTITIES Defines identities.kvc +*/ -//============================================================================= -// This file contains the config file names used in KVIrc -// -// You can play a bit with these, but be aware that some (bad) scripts -// may find themselves in trouble -//============================================================================= +#include "kvi_fileextensions.h" #define KVI_CONFIGFILE_MAIN "main." KVI_FILEEXTENSION_CONFIG #define KVI_CONFIGFILE_WINPROPERTIES "winproperties." KVI_FILEEXTENSION_CONFIG diff --git a/src/kvilib/config/kvi_defaults.h b/src/kvilib/config/kvi_defaults.h index 47cad36db..f4b0b263f 100644 --- a/src/kvilib/config/kvi_defaults.h +++ b/src/kvilib/config/kvi_defaults.h @@ -25,11 +25,32 @@ // //============================================================================= -//============================================================================= -// This file contains (more or less) freely customizable compile time defaults -// -// You can safely play with the ones you understand the meaning of -//============================================================================= +/** +* \file kvi_defaults.h +* \author Szymon Stefanek +* \brief This file contains (more or less) freely customizable compile time defaults +* You can safely play with the ones you understand the meaning of +* +* \def KVI_HOME_CONFIG_FILE_NAME Configuration file in home directory +* \def KVI_DEFAULT_INCOMING_SUBDIRECTORY_NAME Directory for incoming DCC files +* \def KVI_DEFAULT_NICKNAME1 Nickname +* \def KVI_DEFAULT_NICKNAME2 Alternative nickname 2 +* \def KVI_DEFAULT_NICKNAME3 Alternative nickname 3 +* \def KVI_DEFAULT_NICKNAME4 Alternative nickname 4 +* \def KVI_DEFAULT_USERNAME Username +* \def KVI_DEFAULT_REALNAME Realname +* \def KVI_DEFAULT_PART_MESSAGE Part message +* \def KVI_DEFAULT_QUIT_MESSAGE Quit message +* \def KVI_DEFAULT_CTCP_USERINFO_REPLY Reply to CTCP USERINFO +* \def KVI_DEFAULT_CTCP_PAGE_REPLY Reply to CTCP PAGE +* \def KVI_DEFAULT_AWAY_MESSAGE Away message +* \def KVI_DEFAULT_AWAY_NICK Nickname when in away mode +* \def KVI_MAX_PENDING_AVATARS Maximum number of avatars to download simultanously +* \def KVI_MAX_RECENT_SERVERS Maximum number of servers to hold in "recent" menu +* \def KVI_MAX_RECENT_CHANNELS Maximum number of channels to hold in "recent" menu +* \def KVI_MAX_RECENT_NICKNAMES Maximum number of nicknames to hold in "recent" menu +* \def KVI_MAX_RECENT_TOPICS Maximum number of topics to hold in "recent" menu +*/ #include "kvi_settings.h" @@ -39,7 +60,6 @@ #define KVI_HOME_CONFIG_FILE_NAME ".kvirc4.rc" #endif - #define KVI_DEFAULT_INCOMING_SUBDIRECTORY_NAME "download" #define KVI_DEFAULT_NICKNAME1 "newbie" @@ -60,6 +80,6 @@ #define KVI_MAX_RECENT_SERVERS 10 #define KVI_MAX_RECENT_CHANNELS 30 #define KVI_MAX_RECENT_NICKNAMES 10 -#define KVI_RECENT_TOPIC_ENTRIES 20 +#define KVI_MAX_RECENT_TOPICS 20 #endif //_KVI_DEFAULTS_H_ diff --git a/src/kvilib/config/kvi_fileextensions.h b/src/kvilib/config/kvi_fileextensions.h index 7d4578e9c..55ec7eee1 100644 --- a/src/kvilib/config/kvi_fileextensions.h +++ b/src/kvilib/config/kvi_fileextensions.h @@ -1,6 +1,5 @@ #ifndef _KVI_FILEEXTENSIONS_H_ #define _KVI_FILEEXTENSIONS_H_ - //============================================================================= // // File : kvi_fileextensions.h @@ -25,24 +24,41 @@ // //============================================================================= -//============================================================================= -// This file contains the file extensions and filters used by KVIrc -//============================================================================= +/** +* \file kvi_fileextensions.h +* \author Szymon Stefanek +* \brief This file contains the file extensions and filters used by KVIrc +*/ +/** +* \brief File extensions +* \def KVI_FILEEXTENSION_CONFIG Configuration file .kvc +* \def KVI_FILEEXTENSION_SCRIPT Script file .kvs +* \def KVI_FILEEXTENSION_THEMEPACKAGE Theme package .kvt +* \def KVI_FILEEXTENSION_ADDONPACKAGE Addon package .kva +*/ #define KVI_FILEEXTENSION_CONFIG "kvc" #define KVI_FILEEXTENSION_SCRIPT "kvs" #define KVI_FILEEXTENSION_THEMEPACKAGE "kvt" #define KVI_FILEEXTENSION_ADDONPACKAGE "kva" +/** +* \brief Filters +* \def KVI_FILTER_CONFIG Configuration file *.kvs +* \def KVI_FILTER_SCRIPT Script file *.kvs +* \def KVI_FILTER_THEME Theme package *.kvt +* \def KVI_FILTER_ADDON Addon package *.kva +* \def KVI_FILTER_SCRIPTS Script files *.kvs *.kva +* \def KVI_FILTER_INI Ini file *.ini +* \def KVI_FILTER_IMAGE Image file *.png *.jpg *.jpeg *.bmp *.gif *.xpm +*/ #define KVI_FILTER_CONFIG "KVIrc Config (*.kvc)" #define KVI_FILTER_SCRIPT "KVIrc Script (*.kvs)" #define KVI_FILTER_THEME "KVIrc Theme (*.kvt)" #define KVI_FILTER_ADDON "KVIrc Addon (*.kva)" // Provided for convenience #define KVI_FILTER_SCRIPTS "KVIrc Script and Addon (*.kvs *.kva)" - -#define KVI_FILRER_INI "INI File (*.ini)" +#define KVI_FILTER_INI "INI File (*.ini)" #define KVI_FILTER_IMAGE "Image File (*.png *.jpg *.jpeg *.bmp *.gif *.xpm)" - #endif //_KVI_FILEEXTENSIONS_H_ diff --git a/src/kvilib/config/kvi_settings.h b/src/kvilib/config/kvi_settings.h index b448a042f..31f2a06da 100644 --- a/src/kvilib/config/kvi_settings.h +++ b/src/kvilib/config/kvi_settings.h @@ -25,12 +25,13 @@ // //============================================================================= -//============================================================================= -// This file contains compile time settings, either set by configure or -// non-customizable defaults -// -// Better do not touch this -//============================================================================= +/** +* \file kvi_settings.h +* \author Szymon Stefanek +* \brief This file contains compile time settings +* They are either set by configure or non-customizable defaults +* Better to not touch this +*/ #include <QtGlobal> diff --git a/src/kvilib/config/kvi_sourcesdate.h b/src/kvilib/config/kvi_sourcesdate.h index 862100847..266e3fa9e 100644 --- a/src/kvilib/config/kvi_sourcesdate.h +++ b/src/kvilib/config/kvi_sourcesdate.h @@ -1,7 +1,5 @@ - #ifndef _KVI_SOURCESDATE_H_ #define _KVI_SOURCESDATE_H_ - //============================================================================= // // File : kvi_sourcesdate.h @@ -26,15 +24,28 @@ // //============================================================================= +/** +* \file kvi_sourcesdate.h +* \author Szymon Stefanek +* \brief Sources date +*/ + #include "kvi_settings.h" +/** +* \def KVI_SOURCES_DATE Defines the sources date +* \def KVI_SOURCES_DATE_NUMERIC Defines the sources date +*/ #define KVI_SOURCES_DATE "20080829" #define KVI_SOURCES_DATE_NUMERIC 0x20080829 -// this is the date of the sources before that we should force a setup -// this is usually changed only when a setup is really needed because -// of an incompatible change in the configuration files -// .. so do NOT change it just when you change KVI_SOURCES_DATE_NUMERIC :) +/** +* \brief This is the date of the sources before that we should force a setup +* This is usually changed only when a setup is really needed because of an +* incompatible change in the configuration files +* .. so do NOT change it just when you change KVI_SOURCES_DATE_NUMERIC :) +* \def KVI_SOURCES_DATE_NUMERIC_FORCE_SETUP Defines a forced setup +*/ #define KVI_SOURCES_DATE_NUMERIC_FORCE_SETUP 0x20080324 #endif //!_KVI_SOURCESDATE_H_ diff --git a/src/kvilib/config/kvi_version.h b/src/kvilib/config/kvi_version.h index b4c4aafc8..caa79b195 100644 --- a/src/kvilib/config/kvi_version.h +++ b/src/kvilib/config/kvi_version.h @@ -1,6 +1,5 @@ #ifndef _KVI_VERSION_H_ #define _KVI_VERSION_H_ - //============================================================================= // // File : kvi_version.h @@ -25,9 +24,12 @@ // //============================================================================= -#include "kvi_settings.h" - +/** +* \file kvi_version.h +* \author Szymon Stefanek +* \brief Shortcut for some headers +*/ +#include "kvi_settings.h" #endif //!_KVI_VERSION_H_ - diff --git a/src/kvilib/config/kvi_wincfg.h b/src/kvilib/config/kvi_wincfg.h index 59c42c415..1ef3ddd9f 100644 --- a/src/kvilib/config/kvi_wincfg.h +++ b/src/kvilib/config/kvi_wincfg.h @@ -1,6 +1,5 @@ #ifndef _KVI_WINCFG_H_ #define _KVI_WINCFG_H_ - //============================================================================= // // File : kvi_wincfg.h @@ -25,191 +24,198 @@ // //============================================================================= -//============================================================================= -// Windows configuration: do not touch -//============================================================================= +/** +* \file kvi_wincfg.h +* \author Szymon Stefanek +* \brief Windows configuration: do not touch +*/ -/* define if you want to compile with new parser */ +/** \def COMPILE_NEW_KVS Define if you want to compile with new parser */ #define COMPILE_NEW_KVS 1 -/* define if you want to use the Qt 4.x support */ -/* #undef COMPILE_USE_QT4 */ - +/** \def COMPILE_USE_QT4 Define if you want to use the Qt 4.x support */ #define COMPILE_USE_QT4 -/* define if you want to use only the new KVS parser */ +/** \def COMPILE_ONLY_NEW_KVS Define if you want to use only the new KVS parser */ #define COMPILE_ONLY_NEW_KVS 1 -/* define if you want to disable DCC VOICE sound support */ +/** \def COMPILE_WITH_NO_SOUND Define if you want to disable DCC VOICE sound support */ /* #undef COMPILE_WITH_NO_SOUND */ -/* define if you have libgsm and want the GSM code to be compiled */ +/** \def COMPILE_USE_GSM Define if you have libgsm and want the GSM code to be compiled */ /* #undef COMPILE_USE_GSM */ -/* define if you want the info tips to be compiled in */ +/** \def COMPILE_INFO_TIPS Define if you want the info tips to be compiled in */ /* #define COMPILE_INFO_TIPS 1 */ -/* define if you want to compile the KDE 2.x support */ +/** \def COMPILE_KDE_SUPPORT Define if you want to compile the KDE 2.x support */ /* #undef COMPILE_KDE_SUPPORT */ -/* define if you want the gcc memory profile */ +/** \def COMPILE_MEMORY_PROFILE Define if you want the gcc memory profile */ /* #undef COMPILE_MEMORY_PROFILE */ -/* define if you want the memory checks */ +/** \def COMPILE_MEMORY_CHECKS Define if you want the memory checks */ /* #undef COMPILE_MEMORY_CHECKS */ -/* define if you trust your memmove() function */ +/** \def COMPILE_WITH_SYSTEM_MEMMOVE Define if you trust your memmove() function */ #define COMPILE_WITH_SYSTEM_MEMMOVE 1 -/* define if you want to compile the crypt support */ +/** \def COMPILE_CRYPT_SUPPORT Define if you want to compile the crypt support */ #define COMPILE_CRYPT_SUPPORT 1 -/* define if you want the i386 asm code */ +/** \def COMPILE_ix86_ASM Define if you want the i386 asm code */ /* #undef COMPILE_ix86_ASM */ -/* define if your compiler supports gotos do dynamic labels */ +/** \def COMPILE_USE_DYNAMIC_LABELS Define if your compiler supports gotos do dynamic labels */ /* #undef COMPILE_USE_DYNAMIC_LABELS */ -/* define if you want to compile the localization support */ +/** \def COMPILE_LOCALE_STUFF Define if you want to compile the localization support */ #define COMPILE_LOCALE_STUFF 1 -/* define if you want the IPv6 support */ +/** \def COMPILE_IPV6_SUPPORT Define if you want the IPv6 support */ #define COMPILE_IPV6_SUPPORT 1 -/* define if you want zlib support */ +/** \def COMPILE_ZLIB_SUPPORT Define if you want zlib support */ #define COMPILE_ZLIB_SUPPORT 1 -/* define if you want to use the pthreads library */ +/** \def COMPILE_THREADS_USE_POSIX Define if you want to use the pthreads library */ /* #undef COMPILE_THREADS_USE_POSIX */ -/* define if you want to use the solaris libthread */ +/** \def COMPILE_THREADS_USE_SOLARIS_LIBTHREAD Define if you want to use the solaris libthread */ /* #undef COMPILE_THREADS_USE_SOLARIS_LIBTHREAD */ +/** \def COMPILE_PSEUDO_TRANSPARENCY Define if you want the pseudo transparency */ #define COMPILE_PSEUDO_TRANSPARENCY -/* define if you have the SIOCGIFADDR ioctl and the related headers */ +/** \def COMPILE_GET_INTERFACE_ADDRESS Define if you have the SIOCGIFADDR ioctl and the related headers */ /* #undef COMPILE_GET_INTERFACE_ADDRESS */ -/* this is the build date (configure date rather) */ +/** \def KVIRC_BUILD_DATE This is the build date (configure date rather) */ #define KVIRC_BUILD_DATE __DATE__" "__TIME__ -/* these are the build flags */ +/** \def KVIRC_BUILD_FLAGS This is a build flag */ #define KVIRC_BUILD_FLAGS "win32" +/** \def KVIRC_BUILD_COMMAND This is a build flag */ #define KVIRC_BUILD_COMMAND "win32" +/** \def KVIRC_BUILD_SYSTEM This is a build flag */ #define KVIRC_BUILD_SYSTEM "win32" +/** \def KVIRC_BUILD_CPU This is a build flag */ #define KVIRC_BUILD_CPU "win32" +/** \def KVIRC_BUILD_COMPILER This is a build flag */ #define KVIRC_BUILD_COMPILER "win32" +/** \def KVIRC_BUILD_COMPILER_FLAGS This is a build flag */ #define KVIRC_BUILD_COMPILER_FLAGS "win32" -/* define if you have strings.h */ +/** \def HAVE_STRINGS_H Define if you have strings.h */ /* #undef HAVE_STRINGS_H */ -/* define if you have the getenv function */ +/** \def HAVE_GETENV Define if you have the getenv function */ /* #undef HAVE_GETENV */ -/* define if you have the strerror function */ +/** \def HAVE_STRERROR Define if you have the strerror function */ #define HAVE_STRERROR 1 -/* define if you have the inet_aton function */ +/** \def HAVE_INET_ATON Define if you have the inet_aton function */ /* #define HAVE_INET_ATON 1 */ -/* define if you have the inet_ntoa function */ +/** \def HAVE_INET_NTOA Define if you have the inet_ntoa function */ /* #define HAVE_INET_NTOA 1 */ -/* define if you have the inet_pton function */ +/** \def HAVE_INET_PTON Define if you have the inet_pton function */ /* #undef HAVE_INET_PTON */ -/* define if you have the inet_ntop function */ +/** \def HAVE_INET_NTOP Define if you have the inet_ntop function */ /* #undef HAVE_INET_NTOP */ -/* define if you have the getnameinfo function */ +/** \def HAVE_GETNAMEINFO Define if you have the getnameinfo function */ #define HAVE_GETNAMEINFO -/* define if you have the getaddrinfo function */ +/** \def HAVE_GETADDRINFO Define if you have the getaddrinfo function */ #define HAVE_GETADDRINFO -/* define this to the number of average channel users */ +/** \def AVERAGE_CHANNEL_USERS Define this to the number of average channel users */ #define AVERAGE_CHANNEL_USERS 101 -/* define this if you want to ignore the SIGALARM signal */ +/** \def COMPILE_IGNORE_SIGALARM Define this if you want to ignore the SIGALARM signal */ /* #undef COMPILE_IGNORE_SIGALARM */ -/* define this if you are on a big endian machine */ +/** \def BIG_ENDIAN_MACHINE_BYTE_ORDER Define this if you are on a big endian machine */ /* #undef BIG_ENDIAN_MACHINE_BYTE_ORDER */ -/* define this if you want to use the unicode-local 8bit charset translation */ +/** \def COMPILE_USE_LOCAL_8BIT Define this if you want to use the unicode-local 8bit charset translation */ /* #undef COMPILE_USE_LOCAL_8BIT */ -/* define this if you want to disable the inter-process communication support */ +/** \def COMPILE_NO_IPC Define this if you want to disable the inter-process communication support */ /* #undef COMPILE_NO_IPC */ -/* Define if you have the `getenv' function. */ +/** \def HAVE_GETENV Define if you have the `getenv' function. */ /* #undef HAVE_GETENV */ -/* Define if you have the <linux/soundcard.h> header file. */ +/** \def HAVE_LINUX_SOUNDCARD_H Define if you have the <linux/soundcard.h> header file. */ /* #undef HAVE_LINUX_SOUNDCARD_H */ -/* Define if you have the <soundcard.h> header file. */ +/** \def HAVE_SOUNDCARD_H Define if you have the <soundcard.h> header file. */ /* #undef HAVE_SOUNDCARD_H */ -/* Define if you have the <sys/soundcard.h> header file. */ +/** \def HAVE_SYS_SOUNDCARD_H Define if you have the <sys/soundcard.h> header file. */ /* #undef HAVE_SYS_SOUNDCARD_H */ -/* Name of package */ +/** \def PACKAGE Name of package */ #define PACKAGE "kvirc" -/* Version number of package */ +/** \def VERSION Version number of package */ #define VERSION "4.0.0" +/** \def VERSION_BRANCH Version branch number of package */ #define VERSION_BRANCH "4.0" - -/* Define if the system does not provide POSIX.1 features except with this - defined. */ +/** \def _POSIX_1_SOURCE Define if the system does not provide POSIX.1 features except with this defined. */ /* #undef _POSIX_1_SOURCE */ -/* Define if you need to in order for `stat' and other things to work. */ +/** \def _POSIX_SOURCE Define if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ +/** \def COMPILE_WITH_NO_SOUND Define if you want DCC Voice support */ // for now we need this....dcc voice is not ported yet #define COMPILE_WITH_NO_SOUND +/** \def COMPILE_DISABLE_DCC_VOICE Define if you don't want DCC Voice support */ #define COMPILE_DISABLE_DCC_VOICE -/* No X support */ +/** \def COMPILE_NO_X No X support */ #define COMPILE_NO_X -/* No X bell! */ +/** \def COMPILE_NO_X_BELL No X bell! */ #define COMPILE_NO_X_BELL -/* define if you have openssl and want the ssl support in kvirc */ +/** \def COMPILE_SSL_SUPPORT Define if you have openssl and want the ssl support in kvirc */ #define COMPILE_SSL_SUPPORT -/* define if you want perl scripting support */ +/** \def COMPILE_PERL_SUPPORT Define if you want perl scripting support */ #define COMPILE_PERL_SUPPORT -/* The size of a `int', as computed by sizeof. */ +/** \def SIZEOF_INT The size of a `int', as computed by sizeof. */ #define SIZEOF_INT 4 -/* The size of a `long int', as computed by sizeof. */ +/** \def SIZEOF_LONG_INT The size of a `long int', as computed by sizeof. */ #define SIZEOF_LONG_INT 4 -/* The size of a `long long int', as computed by sizeof. */ +/** \def SIZEOF_LONG_LONG_INT The size of a `long long int', as computed by sizeof. */ #define SIZEOF_LONG_LONG_INT 8 -/* The size of a `short int', as computed by sizeof. */ +/** \def SIZEOF_SHORT_INT The size of a `short int', as computed by sizeof. */ #define SIZEOF_SHORT_INT 2 -/* The size of a `unsigned int', as computed by sizeof. */ +/** \def SIZEOF_UNSIGNED_INT The size of a `unsigned int', as computed by sizeof. */ #define SIZEOF_UNSIGNED_INT 4 -/* The size of a `unsigned long int', as computed by sizeof. */ +/** \def SIZEOF_UNSIGNED_LONG_INT The size of a `unsigned long int', as computed by sizeof. */ #define SIZEOF_UNSIGNED_LONG_INT 4 -/* The size of a `unsigned long long int', as computed by sizeof. */ +/** \def SIZEOF_UNSIGNED_LONG_LONG_INT The size of a `unsigned long long int', as computed by sizeof. */ #define SIZEOF_UNSIGNED_LONG_LONG_INT 8 -/* The size of a `unsigned short int', as computed by sizeof. */ +/** \def SIZEOF_UNSIGNED_SHORT_INT The size of a `unsigned short int', as computed by sizeof. */ #define SIZEOF_UNSIGNED_SHORT_INT 2 #endif //_KVI_WINCFG_H_ diff --git a/src/kvilib/core/kvi_pointerlist.h b/src/kvilib/core/kvi_pointerlist.h index 9302d7532..4014f29bd 100644 --- a/src/kvilib/core/kvi_pointerlist.h +++ b/src/kvilib/core/kvi_pointerlist.h @@ -44,6 +44,9 @@ * feature was great and I don't completly understand why they have * 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 */ #include "kvi_settings.h" diff --git a/src/kvilib/core/kvi_qcstring.h b/src/kvilib/core/kvi_qcstring.h index b91583b39..88f8ff5db 100644 --- a/src/kvilib/core/kvi_qcstring.h +++ b/src/kvilib/core/kvi_qcstring.h @@ -28,6 +28,8 @@ * \file kvi_qcstring.h * \author Szymon Stefanek * \brief KviQCString +* +* \def KviQCString Defines KviQCString as QByteArray */ #include "kvi_settings.h" diff --git a/src/kvilib/file/kvi_packagefile.h b/src/kvilib/file/kvi_packagefile.h index aaf3830be..ff094cbc4 100644 --- a/src/kvilib/file/kvi_packagefile.h +++ b/src/kvilib/file/kvi_packagefile.h @@ -28,6 +28,11 @@ * \file kvi_packagefile.h * \author Szymon Stefanek * \brief File packaging utilities +* +* \def KVI_PACKAGE_INFOFIELD_TYPE_STRING Defines the string type of the info field +* \def KVI_PACKAGE_INFOFIELD_TYPE_BINARYBUFFER Defines the binary type of the info field +* \def KVI_PACKAGE_DATAFIELD_TYPE_FILE Defines the file type of the data field +* \def KVI_PACKAGE_DATAFIELD_FLAG_FILE_DEFLATE Defines the type of file compression of the data field */ #include "kvi_settings.h" @@ -43,6 +48,11 @@ class QLabel; class QFileInfo; class KviFile; +#define KVI_PACKAGE_INFOFIELD_TYPE_STRING 1 +#define KVI_PACKAGE_INFOFIELD_TYPE_BINARYBUFFER 2 +#define KVI_PACKAGE_DATAFIELD_TYPE_FILE 1 +#define KVI_PACKAGE_DATAFIELD_FLAG_FILE_DEFLATE 1 + /** * \class KviPackageIOEngine * \brief This class is the base class engine to work with KVIrc package files. @@ -126,13 +136,6 @@ protected: bool readError(); }; -#define KVI_PACKAGE_INFOFIELD_TYPE_STRING 1 -#define KVI_PACKAGE_INFOFIELD_TYPE_BINARYBUFFER 2 - -#define KVI_PACKAGE_DATAFIELD_TYPE_FILE 1 - -#define KVI_PACKAGE_DATAFIELD_FLAG_FILE_DEFLATE 1 - /** * \class KviPackageWriter * \brief This class is used to create KVIrc package files. diff --git a/src/kvilib/system/kvi_locale.cpp b/src/kvilib/system/kvi_locale.cpp index 7f4cd82c9..d27dab529 100644 --- a/src/kvilib/system/kvi_locale.cpp +++ b/src/kvilib/system/kvi_locale.cpp @@ -52,7 +52,7 @@ static KviPointerHashTable<const char *,KviMessageCatalogue> * g_pCatalogueDict static QTextCodec * g_pUtf8TextCodec = 0; -///////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////// // // The following code was extracted and adapted from gutf8.c // from the GNU GLIB2 package. @@ -77,26 +77,24 @@ static QTextCodec * g_pUtf8TextCodec = 0; // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. // -///////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////// typedef char gchar; typedef unsigned char guchar; typedef signed int gssize; typedef unsigned int gunichar; - - #define UNICODE_VALID(Char) \ - ((Char) < 0x110000 && \ - (((Char) & 0xFFFFF800) != 0xD800) && \ - ((Char) < 0xFDD0 || (Char) > 0xFDEF) && \ - ((Char) & 0xFFFE) != 0xFFFE) + ((Char) < 0x110000 && \ + (((Char) & 0xFFFFF800) != 0xD800) && \ + ((Char) < 0xFDD0 || (Char) > 0xFDEF) && \ + ((Char) & 0xFFFE) != 0xFFFE) #define CONTINUATION_CHAR \ - if ((*(guchar *)p & 0xc0) != 0x80) /* 10xxxxxx */ \ - goto error; \ - val <<= 6; \ - val |= (*(guchar *)p) & 0x3f; + if ((*(guchar *)p & 0xc0) != 0x80) /* 10xxxxxx */ \ + goto error; \ + val <<= 6; \ + val |= (*(guchar *)p) & 0x3f; static const char * @@ -252,9 +250,9 @@ static bool g_utf8_validate (const char *str, return true; } -/////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////// // End of gutf8.c -/////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////// class KviSmartTextCodec : public QTextCodec @@ -310,7 +308,7 @@ static KviPointerHashTable<const char *,KviSmartTextCodec> * g_pSmartCodecDict -///////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////// // // The following code was extracted and adapted from gettext.h and gettextP.h // from the GNU gettext package. @@ -333,7 +331,7 @@ static KviPointerHashTable<const char *,KviSmartTextCodec> * g_pSmartCodecDict // write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. // -///////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////// #include <stdio.h> @@ -378,10 +376,8 @@ struct GnuMoStringDescriptor #define KVI_SWAP_IF_NEEDED(flag,value) (flag ? kvi_swap32(value) : (value)) -/////////////////////////////////////////////////////////////////////////////////////////////// -// End of gettext.h & gettextP.h -/////////////////////////////////////////////////////////////////////////////////////////////// - +//////////////////////////////////////////////////////////////////////////////////////// End of gettext.h & gettextP.h +////////////////////////////////////////////////////////////////////////////////////// // HELPERS diff --git a/src/kvilib/system/kvi_time.cpp b/src/kvilib/system/kvi_time.cpp index d3deb3f77..5ed9e8fc6 100644 --- a/src/kvilib/system/kvi_time.cpp +++ b/src/kvilib/system/kvi_time.cpp @@ -81,7 +81,7 @@ unsigned long KviMSecTimeInterval::mark() namespace KviTimeUtils { - long long getCurrentTimeMills() + long long getCurrentTimeMills() { struct timeval tmv; kvi_gettimeofday(&tmv,0); diff --git a/src/kvilib/system/kvi_time.h b/src/kvilib/system/kvi_time.h index b0dd475dd..5778465fb 100644 --- a/src/kvilib/system/kvi_time.h +++ b/src/kvilib/system/kvi_time.h @@ -1,6 +1,5 @@ #ifndef _KVI_TIME_H_ #define _KVI_TIME_H_ - //============================================================================= // // File : kvi_time.h @@ -25,6 +24,12 @@ // //============================================================================= +/** +* \file kvi_time.h +* \author Szymon Stefanek +* \brief Time management +*/ + #include "kvi_settings.h" #include <QString> @@ -38,23 +43,35 @@ #define kvi_time_t time_t #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - #include <winsock2.h> // struct timeval - extern KVILIB_API void kvi_gettimeofday(struct timeval * tmv,struct timezone * tmz); - + /** + * \brief Gets the time of the day + * \param tmv The time value + * \param tmz The timezone + * \return void + */ + extern KVILIB_API void kvi_gettimeofday(struct timeval * tmv, struct timezone * tmz); #else - #include <sys/time.h> // gettimeofday() , struct timeval - inline void kvi_gettimeofday(struct timeval * tmv,struct timezone * tmz) + /** + * \brief Gets the time of the day + * \param tmv The time value + * \param tmz The timezone + * \return void + */ + inline void kvi_gettimeofday(struct timeval * tmv, struct timezone * tmz) { gettimeofday(tmv,tmz); }; - #endif -// this works for time intervals a bit longer than 24 days +/** +* \class KviMSecTimeInterval +* \brief A class to retrieve the time interval +* This works for time intervals a bit longer than 24 days +*/ class KVILIB_API KviMSecTimeInterval { public: @@ -63,30 +80,61 @@ protected: unsigned long m_uReferenceSecs; unsigned long m_uReferenceUSecs; public: - // returns the number of milliseconds since - // mark() was last called (and thus marks - // the beginning of a new interval). + /** + * \brief Returns the number of milliseconds. + * The amount is caluclated since mark() was last called (and thus marks + * the beginning of a new interval). + * \return unsigned long + */ unsigned long mark(); - // this wors ONLY in the same second that mark was called in - // and returns the tv_sec field of the gettimeofday() - // (remember that gettimeofday() is broken on windows) + + /** + * \brief Returns the number of seconds + * This wors ONLY in the same second that mark was called in and returns the + * tv_sec field of the gettimeofday() (remember that gettimeofday() is broken + * on windows) + * \return unsigned long + */ unsigned long secondsCounter(){ return m_uReferenceSecs; }; }; +/** +* \namespace KviTimeUtils +* \brief Time utilities +*/ namespace KviTimeUtils { + /** \enum FormatTimeSpanFlags */ + enum FormatTimeSpanFlags { + NoLeadingEmptyIntervals = 1, /**< Causes the leading empty intervals to be omitted */ + NoLeadingZeroes = 2, /**< No leading zeroes are printed in hours and seconds */ + FillWithHypens = 4 /**< Uses only -- %d -- %h -- etc.. discards all other flags */ + }; + /** + * \brief Returns the current time mills + * \return long long + */ + long long getCurrentTimeMills(); - long long getCurrentTimeMills(); - // splits the time span uSecs in days, hours, minutes and seconds + /** + * \brief Splits the time span uSecs in days, hours, minutes and seconds + * \param uSecs The amount of seconds to span + * \param uD Where to store days data + * \param uH Where to store hours data + * \param uM Where to store minutes data + * \param uS Where to store seconds data + * \return void + */ KVILIB_API void secondsToDaysHoursMinsSecs(unsigned int uSecs, - unsigned int * uD,unsigned int * uH,unsigned int * uM,unsigned int * uS); - // returns a string formatted like x d x h xx m xx s - enum FormatTimeSpanFlags { - NoLeadingEmptyIntervals = 1, // causes the leading empty intervals to be omitted - NoLeadingZeroes = 2, // no leading zeroes are printed in hours and seconds - FillWithHypens = 4 // uses only -- %d -- %h -- etc.. discards all other flags - }; + unsigned int * uD, unsigned int * uH, unsigned int * uM, unsigned int * uS); + + /** + * \brief Returns a string formatted like x d x h xx m xx s + * \param uSeconds The number of seconds to format + * \param iFlags The flags to format the time string + * \return QString + */ KVILIB_API QString formatTimeInterval(unsigned int uSeconds,int iFlags = 0); }; diff --git a/src/kvirc/ui/kvi_topicw.cpp b/src/kvirc/ui/kvi_topicw.cpp index fa1fa725f..5c0ba707c 100644 --- a/src/kvirc/ui/kvi_topicw.cpp +++ b/src/kvirc/ui/kvi_topicw.cpp @@ -603,7 +603,7 @@ void KviTopicWidget::setTopic(const QString & topic) } if(!bFound && (!m_szTopic.isEmpty())) { - if(g_pRecentTopicList->count() >= KVI_RECENT_TOPIC_ENTRIES) + if(g_pRecentTopicList->count() >= KVI_MAX_RECENT_TOPICS) { g_pRecentTopicList->erase(g_pRecentTopicList->begin()); } |
