File indexing completed on 2024-05-19 04:49:20
0001 /* 0002 * Copyright 2018 Malte Veerman <malte.veerman@gmail.com> 0003 * 0004 * This program is free software; you can redistribute it and/or 0005 * modify it under the terms of the GNU General Public License as 0006 * published by the Free Software Foundation; either version 2 of 0007 * the License or (at your option) version 3 or any later version 0008 * accepted by the membership of KDE e.V. (or its successor approved 0009 * by the membership of KDE e.V.), which shall act as a proxy 0010 * defined in Section 14 of version 3 of the license. 0011 * 0012 * This program is distributed in the hope that it will be useful, 0013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0015 * GNU General Public License for more details. 0016 * 0017 * You should have received a copy of the GNU General Public License 0018 * along with this program. If not, see <http://www.gnu.org/licenses/>. 0019 */ 0020 0021 #include "DebugLogger.h" 0022 0023 #include "core/support/Debug.h" 0024 0025 0026 DebugLogger::DebugLogger( QObject *parent ) 0027 : QObject( parent ) 0028 { 0029 DEBUG_BLOCK 0030 } 0031 0032 void DebugLogger::shortMessageImpl( const QString& text ) 0033 { 0034 DEBUG_BLOCK 0035 0036 debug() << "Short message:" << text; 0037 } 0038 0039 void DebugLogger::longMessageImpl( const QString& text, Amarok::Logger::MessageType type ) 0040 { 0041 DEBUG_BLOCK 0042 0043 debug() << "Long message:" << text << type; 0044 } 0045 0046 void DebugLogger::newProgressOperationImpl( QObject* sender, const QMetaMethod& increment, const QMetaMethod& end, const QString& text, int maximum, QObject* context, const std::function<void ()>& function, Qt::ConnectionType type ) 0047 { 0048 Q_UNUSED( increment ) 0049 Q_UNUSED( end ) 0050 0051 DEBUG_BLOCK 0052 0053 debug() << "New progress operation with generic QObject:" << sender; 0054 debug() << "Text:" << text; 0055 debug() << "Maximum:" << maximum; 0056 debug() << "Object to call when canceled:" << context; 0057 debug() << "Member function to call when canceled:" << function.target_type().name(); 0058 debug() << "Connection type:" << type; 0059 } 0060 0061 void DebugLogger::newProgressOperationImpl( QNetworkReply* reply, const QString& text, QObject* context, const std::function<void ()>& function, Qt::ConnectionType type ) 0062 { 0063 DEBUG_BLOCK 0064 0065 debug() << "New progress operation with QNetworkReply:" << reply; 0066 debug() << "Text:" << text; 0067 debug() << "Object to call when canceled:" << context; 0068 debug() << "Member function to call when canceled:" << function.target_type().name(); 0069 debug() << "Connection type:" << type; 0070 } 0071 0072 void DebugLogger::newProgressOperationImpl( KJob* job, const QString& text, QObject* context, const std::function<void ()>& function, Qt::ConnectionType type ) 0073 { 0074 DEBUG_BLOCK 0075 0076 debug() << "New progress operation with KJob:" << job; 0077 debug() << "Text:" << text; 0078 debug() << "Object to call when canceled:" << context; 0079 debug() << "Member function to call when canceled:" << function.target_type().name(); 0080 debug() << "Connection type:" << type; 0081 }