| 1 | /* |
| 2 | Copyright (c) 2010 Kevin Funk <krf@electrostorm.net> |
| 3 | Copyright (c) 2011 Casian Andrei <skeletk13@gmail.com> |
| 4 | |
| 5 | This library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU Lesser General Public |
| 7 | License as published by the Free Software Foundation; either |
| 8 | version 2.1 of the License, or (at your option) any later version. |
| 9 | |
| 10 | This library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | Lesser General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU Lesser General Public |
| 16 | License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | #ifndef DEBUGPRIVATE_H |
| 20 | #define DEBUGPRIVATE_H |
| 21 | |
| 22 | #include "debug.h" |
| 23 | |
| 24 | #include <QtCore/QString> |
| 25 | #include <QIODevice> |
| 26 | |
| 27 | class IndentPrivate |
| 28 | : public QObject |
| 29 | { |
| 30 | private: |
| 31 | explicit IndentPrivate(QObject* parent = 0); |
| 32 | |
| 33 | public: |
| 34 | static IndentPrivate* instance(); |
| 35 | |
| 36 | QString m_string; |
| 37 | }; |
| 38 | |
| 39 | /* |
| 40 | * From kdelibs/kdecore/io |
| 41 | */ |
| 42 | class NoDebugStream: public QIODevice |
| 43 | { |
| 44 | // Q_OBJECT |
| 45 | public: |
| 46 | NoDebugStream() { open(mode: WriteOnly); } |
| 47 | bool isSequential() const { return true; } |
| 48 | qint64 readData(char *, qint64) { return 0; /* eof */ } |
| 49 | qint64 readLineData(char *, qint64) { return 0; /* eof */ } |
| 50 | qint64 writeData(const char *, qint64 len) { return len; } |
| 51 | } devnull; |
| 52 | |
| 53 | QDebug nullDebug() |
| 54 | { |
| 55 | return QDebug(&devnull); |
| 56 | } |
| 57 | |
| 58 | #endif // DEBUGPRIVATE_H |
| 59 | |