From bd75eaf87807e8b1be5d5872203caca5e5131352 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Mon, 13 Jun 2016 09:16:08 -0400 Subject: [PATCH] (fix) avoid showing debug info when not needed (fixes #3726) --- Main/SOGo.m | 2 +- SoObjects/SOGo/SOGoProductLoader.h | 10 +++++----- SoObjects/SOGo/SOGoProductLoader.m | 22 +++++++++++++--------- Tools/sogo-tool.m | 2 +- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Main/SOGo.m b/Main/SOGo.m index 8e8d2a4e2..815c9ea5d 100644 --- a/Main/SOGo.m +++ b/Main/SOGo.m @@ -136,7 +136,7 @@ static BOOL debugLeaks; [$(@"SOGoFolder") soClass]; /* load products */ - [[SOGoProductLoader productLoader] loadAllProducts]; + [[SOGoProductLoader productLoader] loadAllProducts: YES]; } - (id) init diff --git a/SoObjects/SOGo/SOGoProductLoader.h b/SoObjects/SOGo/SOGoProductLoader.h index bc76af4e0..e8edbd4a9 100644 --- a/SoObjects/SOGo/SOGoProductLoader.h +++ b/SoObjects/SOGo/SOGoProductLoader.h @@ -1,14 +1,15 @@ /* Copyright (C) 2004 SKYRIX Software AG + Copyright (C) 2005-2016 Inverse inc. - This file is part of OpenGroupware.org. + This file is part of SOGo - OGo is free software; you can redistribute it and/or modify it under + SOGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - OGo is distributed in the hope that it will be useful, but WITHOUT ANY + SOGo 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 Lesser General Public License for more details. @@ -18,7 +19,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id: SOGoProductLoader.h 540 2005-02-10 16:22:38Z helge $ #ifndef __Main_SOGoProductLoader_H__ #define __Main_SOGoProductLoader_H__ @@ -35,7 +35,7 @@ /* operations */ -- (void) loadAllProducts; +- (void) loadAllProducts: (BOOL) verbose; - (void) loadProducts: (NSArray *) products; @end diff --git a/SoObjects/SOGo/SOGoProductLoader.m b/SoObjects/SOGo/SOGoProductLoader.m index aaeb7e0b0..5f531134d 100644 --- a/SoObjects/SOGo/SOGoProductLoader.m +++ b/SoObjects/SOGo/SOGoProductLoader.m @@ -1,14 +1,15 @@ /* - Copyright (C) 2004-2005 SKYRIX Software AG + Copyright (C) 2004 SKYRIX Software AG + Copyright (C) 2005-2016 Inverse inc. - This file is part of OpenGroupware.org. + This file is part of SOGo - OGo is free software; you can redistribute it and/or modify it under + SOGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - OGo is distributed in the hope that it will be useful, but WITHOUT ANY + SOGo 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 Lesser General Public License for more details. @@ -101,7 +102,7 @@ static NSString *productDirectoryName = @"SOGo"; return searchPathes; } -- (void) loadAllProducts +- (void) loadAllProducts: (BOOL) verbose { SoProductRegistry *registry = nil; NSFileManager *fm; @@ -134,14 +135,17 @@ static NSString *productDirectoryName = @"SOGo"; } if ([loadedProducts count]) { - [self logWithFormat: @"SOGo products loaded from '%@':", lpath]; - [self logWithFormat: @" %@", - [loadedProducts componentsJoinedByString: @", "]]; + if (verbose) + { + [self logWithFormat: @"SOGo products loaded from '%@':", lpath]; + [self logWithFormat: @" %@", + [loadedProducts componentsJoinedByString: @", "]]; + } [loadedProducts removeAllObjects]; } } - if (![registry loadAllProducts]) + if (![registry loadAllProducts] && verbose) [self warnWithFormat: @"could not load all products !"]; [pool release]; } diff --git a/Tools/sogo-tool.m b/Tools/sogo-tool.m index 2e6db71bc..59d157ac4 100644 --- a/Tools/sogo-tool.m +++ b/Tools/sogo-tool.m @@ -244,7 +244,7 @@ main (int argc, char **argv, char **env) pool = [NSAutoreleasePool new]; /* load products */ - [[SOGoProductLoader productLoader] loadAllProducts]; + [[SOGoProductLoader productLoader] loadAllProducts: NO]; [SOGoSystemDefaults sharedSystemDefaults]; setupUserDefaults ();