Add new build option WITH_TDEICONLOADER_DEBUG

pull/16/head
Slávek Banko 11 years ago
parent 2a415f233f
commit 208d93bf75

@ -102,6 +102,8 @@ OPTION( WITH_KDE4_MENU_SUFFIX "Add [KDE4] tag to KDE4 menu items" OFF )
OPTION( WITH_ASPELL "Enable aspell support" ${WITH_ALL_OPTIONS} ) OPTION( WITH_ASPELL "Enable aspell support" ${WITH_ALL_OPTIONS} )
OPTION( WITH_HSPELL "Enable hspell support" ${WITH_ALL_OPTIONS} ) OPTION( WITH_HSPELL "Enable hspell support" ${WITH_ALL_OPTIONS} )
OPTION( WITH_TDEICONLOADER_DEBUG "Enable debugging in TDEIconLoader class" OFF )
##### set PKG_CONFIG_PATH ####################### ##### set PKG_CONFIG_PATH #######################
@ -953,6 +955,13 @@ if( WITH_HSPELL )
endif( WITH_HSPELL ) endif( WITH_HSPELL )
##### enable TDEIconLoader debugging ############
if ( WITH_TDEICONLOADER_DEBUG )
set ( TDEICONLOADER_DEBUG 1 )
endif ( WITH_TDEICONLOADER_DEBUG )
##### write configure files ##################### ##### write configure files #####################
configure_file( config.h.cmake config.h ) configure_file( config.h.cmake config.h )

@ -911,6 +911,9 @@
/* Defined if compiling with old XDG standard support */ /* Defined if compiling with old XDG standard support */
#cmakedefine WITH_OLD_XDG_STD 1 #cmakedefine WITH_OLD_XDG_STD 1
/* Defined if compiling with TDEIconLoader debugging */
#cmakedefine TDEICONLOADER_DEBUG 1
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */ significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD #if defined AC_APPLE_UNIVERSAL_BUILD

@ -109,9 +109,9 @@ struct TDEIconGroup
// WARNING // WARNING
// Enabling this in production will cause a massive slowdown of (and a related memory leak in) // Enabling this in production will cause a massive slowdown of (and a related memory leak in)
// any application that creates and destroys large numbers of TDEIconLoader instances // any application that creates and destroys large numbers of TDEIconLoader instances
//#define KICONLOADER_CHECKS //#define TDEICONLOADER_DEBUG
#ifdef KICONLOADER_CHECKS #ifdef TDEICONLOADER_DEBUG
// Keep a list of recently created and destroyed TDEIconLoader instances in order // Keep a list of recently created and destroyed TDEIconLoader instances in order
// to detect bugs like #68528. // to detect bugs like #68528.
struct TDEIconLoaderDebug struct TDEIconLoaderDebug
@ -133,7 +133,7 @@ static TQValueList< TDEIconLoaderDebug > *kiconloaders;
TDEIconLoader::TDEIconLoader(const TQString& _appname, TDEStandardDirs *_dirs) TDEIconLoader::TDEIconLoader(const TQString& _appname, TDEStandardDirs *_dirs)
{ {
#ifdef KICONLOADER_CHECKS #ifdef TDEICONLOADER_DEBUG
if( kiconloaders == NULL ) if( kiconloaders == NULL )
kiconloaders = new TQValueList< TDEIconLoaderDebug>(); kiconloaders = new TQValueList< TDEIconLoaderDebug>();
// check for the (very unlikely case) that new TDEIconLoader gets allocated // check for the (very unlikely case) that new TDEIconLoader gets allocated
@ -266,7 +266,7 @@ void TDEIconLoader::init( const TQString& _appname, TDEStandardDirs *_dirs )
TDEIconLoader::~TDEIconLoader() TDEIconLoader::~TDEIconLoader()
{ {
#ifdef KICONLOADER_CHECKS #ifdef TDEICONLOADER_DEBUG
for( TQValueList< TDEIconLoaderDebug >::Iterator it = kiconloaders->begin(); for( TQValueList< TDEIconLoaderDebug >::Iterator it = kiconloaders->begin();
it != kiconloaders->end(); it != kiconloaders->end();
++it ) ++it )
@ -1233,7 +1233,7 @@ TDEIconFactory::TDEIconFactory( const TQString& iconName_P, TDEIcon::Group group
TQPixmap* TDEIconFactory::createPixmap( const TQIconSet&, TQIconSet::Size, TQIconSet::Mode mode_P, TQIconSet::State ) TQPixmap* TDEIconFactory::createPixmap( const TQIconSet&, TQIconSet::Size, TQIconSet::Mode mode_P, TQIconSet::State )
{ {
#ifdef KICONLOADER_CHECKS #ifdef TDEICONLOADER_DEBUG
bool found = false; bool found = false;
for( TQValueList< TDEIconLoaderDebug >::Iterator it = kiconloaders->begin(); for( TQValueList< TDEIconLoaderDebug >::Iterator it = kiconloaders->begin();
it != kiconloaders->end(); it != kiconloaders->end();

Loading…
Cancel
Save