diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2013-10-24 03:08:14 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2013-10-24 03:08:20 +0200 |
commit | 208d93bf75a4a1486f6f94c34e71638a961e8645 (patch) | |
tree | b36ddf7faadb5818ba9e748e2e67c229112827b6 | |
parent | 2a415f233fac3fb5801a544e670f1ec12429aa2a (diff) | |
download | tdelibs-208d93bf75a4a1486f6f94c34e71638a961e8645.tar.gz tdelibs-208d93bf75a4a1486f6f94c34e71638a961e8645.zip |
Add new build option WITH_TDEICONLOADER_DEBUG
-rw-r--r-- | CMakeLists.txt | 9 | ||||
-rw-r--r-- | config.h.cmake | 3 | ||||
-rw-r--r-- | tdecore/kiconloader.cpp | 10 |
3 files changed, 17 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9bce50de8..53cfe8119 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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_HSPELL "Enable hspell support" ${WITH_ALL_OPTIONS} ) +OPTION( WITH_TDEICONLOADER_DEBUG "Enable debugging in TDEIconLoader class" OFF ) + ##### set PKG_CONFIG_PATH ####################### @@ -953,6 +955,13 @@ if( WITH_HSPELL ) endif( WITH_HSPELL ) +##### enable TDEIconLoader debugging ############ + +if ( WITH_TDEICONLOADER_DEBUG ) + set ( TDEICONLOADER_DEBUG 1 ) +endif ( WITH_TDEICONLOADER_DEBUG ) + + ##### write configure files ##################### configure_file( config.h.cmake config.h ) diff --git a/config.h.cmake b/config.h.cmake index d9703caa4..7dcd1ae1f 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -911,6 +911,9 @@ /* Defined if compiling with old XDG standard support */ #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 significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD diff --git a/tdecore/kiconloader.cpp b/tdecore/kiconloader.cpp index 59f3e0646..df233cec1 100644 --- a/tdecore/kiconloader.cpp +++ b/tdecore/kiconloader.cpp @@ -109,9 +109,9 @@ struct TDEIconGroup // WARNING // 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 -//#define KICONLOADER_CHECKS +//#define TDEICONLOADER_DEBUG -#ifdef KICONLOADER_CHECKS +#ifdef TDEICONLOADER_DEBUG // Keep a list of recently created and destroyed TDEIconLoader instances in order // to detect bugs like #68528. struct TDEIconLoaderDebug @@ -133,7 +133,7 @@ static TQValueList< TDEIconLoaderDebug > *kiconloaders; TDEIconLoader::TDEIconLoader(const TQString& _appname, TDEStandardDirs *_dirs) { -#ifdef KICONLOADER_CHECKS +#ifdef TDEICONLOADER_DEBUG if( kiconloaders == NULL ) kiconloaders = new TQValueList< TDEIconLoaderDebug>(); // 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() { -#ifdef KICONLOADER_CHECKS +#ifdef TDEICONLOADER_DEBUG for( TQValueList< TDEIconLoaderDebug >::Iterator it = kiconloaders->begin(); it != kiconloaders->end(); ++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 ) { -#ifdef KICONLOADER_CHECKS +#ifdef TDEICONLOADER_DEBUG bool found = false; for( TQValueList< TDEIconLoaderDebug >::Iterator it = kiconloaders->begin(); it != kiconloaders->end(); |