Moved QString debug to shopper.h with other DEBUG code
[shopper.git] / src / shopper.h
blob589adc26d710df44413ee4a9c7461b9993e41090
1 /* Shopper
2 * Copyright (C) 2008 David Greaves
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2
6 * as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 //#include "config.h"
20 // Default location of shopping lists
21 #define HOME_DIR "/home/user/"
22 #define DEFAULT_LIST "ShoppingList.xml"
23 //#undef DEBUG_SHOPPER
25 #include <iostream>
26 #include <libintl.h>
27 #define _(String) gettext (String)
28 #define gettext_noop(String) String
29 #define N_(String) gettext_noop (String)
31 #define CHECK_NULL 1
32 #include <qglobal.h>
34 // Define a << handler for QString
35 std::basic_ostream<char>& operator<<(std::basic_ostream<char>& os, const
36 QString& str);
38 #define _MSG(tag) do { \
39 std::cerr << tag << " " << __PRETTY_FUNCTION__ << "\n"; \
40 } while(0)
42 #define _MESSAGE(tag, ...) do { \
43 std::cerr << tag << " :" << __FILE__ <<":"<< __LINE__ \
44 << " (" << __PRETTY_FUNCTION__ << ") " \
45 << __VA_ARGS__ << "\n"; \
46 } while(0)
48 #ifdef DEBUG_SHOPPER
49 #define DEBUG(...) _MESSAGE("DEBUG", __VA_ARGS__)
50 #define _ENTER _MSG("ENTER")
51 #define _LEAVE _MSG("LEAVE")
52 #else
53 #define DEBUG(...) {}
54 #define _ENTER {}
55 #define _LEAVE {}
56 #endif