Commit 7c5f81f0 authored by Laurent Montel's avatar Laurent Montel 😁

Use debug categories

parent a0bd88a2
......@@ -21,7 +21,7 @@ set(MLT_MIN_VERSION ${MLT_MIN_MAJOR_VERSION}.${MLT_MIN_MINOR_VERSION}.${MLT_MIN_
set(QT_MIN_VERSION 5.5.0)
find_package(ECM 1.2.0 REQUIRED CONFIG)
find_package(ECM 5.21.0 REQUIRED CONFIG)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules)
include(FeatureSummary)
include(ECMInstallIcons)
......@@ -32,6 +32,7 @@ include(KDECompilerSettings)
include(ECMOptionalAddSubdirectory)
include(ECMMarkNonGuiExecutable)
include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)
add_definitions(-DQT_NO_CAST_TO_ASCII)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
......@@ -119,6 +120,7 @@ add_subdirectory(thumbnailer)
#add_subdirectory(testingArea)
install( FILES kdenlive.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
configure_file(config-kdenlive.h.cmake config-kdenlive.h @ONLY)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
org.kde.multimedia.kdenlive kdenlive (kdenlive)
......@@ -123,6 +123,8 @@ list(APPEND kdenlive_SRCS
core.cpp
)
ecm_qt_declare_logging_category(kdenlive_SRCS HEADER kdenlive_debug.h IDENTIFIER KDENLIVE_LOG CATEGORY_NAME org.kde.multimedia.kdenlive)
ki18n_wrap_ui(kdenlive_UIS
ui/addtrack_ui.ui
ui/archivewidget_ui.ui
......
......@@ -62,7 +62,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QTimeLine>
#include <QSlider>
#include <QMenu>
#include <QDebug>
#include "kdenlive_debug.h"
#include <QtConcurrent>
#include <QUndoCommand>
#include <QCryptographicHash>
......@@ -635,7 +635,7 @@ bool Bin::eventFilter(QObject *obj, QEvent *event)
}
}
else {
qDebug()<<" +++++++ NO VIEW-------!!";
qCDebug(KDENLIVE_LOG)<<" +++++++ NO VIEW-------!!";
}
return true;
} else if (event->type() == QEvent::Wheel) {
......@@ -746,7 +746,7 @@ void Bin::deleteClip(const QString &id)
}
ProjectClip *clip = m_rootFolder->clip(id);
if (!clip) {
qWarning()<<"Cannot bin find clip to delete: "<<id;
qCWarning(KDENLIVE_LOG)<<"Cannot bin find clip to delete: "<<id;
return;
}
m_jobManager->discardJobs(id);
......@@ -888,7 +888,7 @@ void Bin::slotReloadClip()
}
QDomDocument doc;
QDomElement xml = currentItem->toXml(doc);
qDebug()<<"*****************\n"<<doc.toString()<<"\n******************";
qCDebug(KDENLIVE_LOG)<<"*****************\n"<<doc.toString()<<"\n******************";
if (!xml.isNull()) {
currentItem->setClipStatus(AbstractProjectItem::StatusWaiting);
// We need to set a temporary id before all outdated producers are replaced;
......@@ -912,7 +912,7 @@ void Bin::slotLocateClip()
bool exists = QFile(url.toLocalFile()).exists();
if (currentItem->hasUrl() && exists) {
QDesktopServices::openUrl(url);
qDebug()<<" / / "+url.toString();
qCDebug(KDENLIVE_LOG)<<" / / "+url.toString();
} else {
if(!exists){
emitMessage(i18n("Couldn't locate ") + QString(" ("+url.toString()+")"), 100, ErrorMessage);
......@@ -1184,7 +1184,7 @@ void Bin::doAddFolder(const QString &id, const QString &name, const QString &par
{
ProjectFolder *parentFolder = m_rootFolder->folder(parentId);
if (!parentFolder) {
qDebug()<<" / / ERROR IN PARENT FOLDER";
qCDebug(KDENLIVE_LOG)<<" / / ERROR IN PARENT FOLDER";
return;
}
//FIXME(style): constructor actually adds the new pointer to parent's children
......@@ -1196,7 +1196,7 @@ void Bin::renameFolder(const QString &id, const QString &name)
{
ProjectFolder *folder = m_rootFolder->folder(id);
if (!folder || !folder->parent()) {
qDebug()<<" / / ERROR IN PARENT FOLDER";
qCDebug(KDENLIVE_LOG)<<" / / ERROR IN PARENT FOLDER";
return;
}
folder->setName(name);
......@@ -1301,7 +1301,7 @@ void Bin::doRemoveFolder(const QString &id)
{
ProjectFolder *folder = m_rootFolder->folder(id);
if (!folder) {
qDebug()<<" / / FOLDER not found";
qCDebug(KDENLIVE_LOG)<<" / / FOLDER not found";
return;
}
//TODO: warn user on non-empty folders
......@@ -2003,7 +2003,7 @@ void Bin::emitRefreshPanel(const QString &id)
void Bin::setupGeneratorMenu()
{
if (!m_menu) {
qDebug()<<"Warning, menu was not created, something is wrong";
qCDebug(KDENLIVE_LOG)<<"Warning, menu was not created, something is wrong";
return;
}
......@@ -2256,7 +2256,7 @@ void Bin::slotCreateProjectClip()
QAction* act = qobject_cast<QAction *>(sender());
if (act == 0) {
// Cannot access triggering action, something is wrong
qDebug()<<"// Error in clip creation action";
qCDebug(KDENLIVE_LOG)<<"// Error in clip creation action";
return;
}
ClipType type = (ClipType) act->data().toInt();
......@@ -2416,7 +2416,7 @@ void Bin::moveEffect(const QString &id, const QList<int> &oldPos, const QList<in
void Bin::removeEffect(const QString &id, const QDomElement &effect)
{
if (effect.isNull()) {
qWarning()<<" / /ERROR, trying to remove empty effect";
qCWarning(KDENLIVE_LOG)<<" / /ERROR, trying to remove empty effect";
return;
}
ProjectClip *currentItem = m_rootFolder->clip(id);
......@@ -2635,7 +2635,7 @@ void Bin::slotExpandUrl(const ItemInfo &info, const QUrl &url, QUndoCommand *com
QString singletonId = hashToIdMap.value(hash, QString());
if (singletonId.length()) {
// map duplicate producer ID to single bin clip producer ID.
qDebug() << "found duplicate producer:" << hash << ", reusing newID:" << singletonId;
qCDebug(KDENLIVE_LOG) << "found duplicate producer:" << hash << ", reusing newID:" << singletonId;
idMap.insert(originalId, singletonId);
continue;
}
......@@ -2644,7 +2644,7 @@ void Bin::slotExpandUrl(const ItemInfo &info, const QUrl &url, QUndoCommand *com
// First occurence of a producer, so allocate new bin clip producer ID.
QString newId = QString::number(getFreeClipId());
idMap.insert(originalId, newId);
qDebug() << "originalId: " << originalId << ", newId: " << newId;
qCDebug(KDENLIVE_LOG) << "originalId: " << originalId << ", newId: " << newId;
// Ensure to register new bin clip producer ID in hash hashmap for
// those clips that MLT likes to serialize multiple times. This is
......@@ -2668,7 +2668,7 @@ void Bin::slotExpandUrl(const ItemInfo &info, const QUrl &url, QUndoCommand *com
QString resource = EffectsList::property(clone, QStringLiteral("resource"));
if (QFileInfo(resource).isRelative()) {
QFileInfo rootedResource(mltRoot, resource);
qDebug() << "fixed resource path for producer, newId:" << newId << "resource:" << rootedResource.absoluteFilePath();
qCDebug(KDENLIVE_LOG) << "fixed resource path for producer, newId:" << newId << "resource:" << rootedResource.absoluteFilePath();
EffectsList::setProperty(clone, QStringLiteral("resource"), rootedResource.absoluteFilePath());
}
}
......@@ -2719,7 +2719,7 @@ void Bin::slotStartClipJob(bool enable)
QAction* act = qobject_cast<QAction *>(sender());
if (act == 0) {
// Cannot access triggering action, something is wrong
qDebug()<<"// Error in clip job action";
qCDebug(KDENLIVE_LOG)<<"// Error in clip job action";
return;
}
startClipJob(act->data().toStringList());
......@@ -2729,7 +2729,7 @@ void Bin::startClipJob(const QStringList &params)
{
QStringList data = params;
if (data.isEmpty()) {
qDebug()<<"// Error in clip job action";
qCDebug(KDENLIVE_LOG)<<"// Error in clip job action";
return;
}
AbstractClipJob::JOBTYPE jobType = (AbstractClipJob::JOBTYPE) data.takeFirst().toInt();
......@@ -2955,7 +2955,7 @@ void Bin::slotGotFilterJobResults(const QString &id, int startPos, int track, co
QString key = filterInfo.value(QStringLiteral("key"));
int offset = filterInfo.value(QStringLiteral("offset")).toInt();
QStringList value = results.value(key).split(';', QString::SkipEmptyParts);
//qDebug()<<"// RESULT; "<<key<<" = "<<value;
//qCDebug(KDENLIVE_LOG)<<"// RESULT; "<<key<<" = "<<value;
if (filterInfo.contains(QStringLiteral("resultmessage"))) {
QString mess = filterInfo.value(QStringLiteral("resultmessage"));
mess.replace(QLatin1String("%count"), QString::number(value.count()));
......
......@@ -37,7 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QDomElement>
#include <QFile>
#include <QDir>
#include <QDebug>
#include "kdenlive_debug.h"
#include <QCryptographicHash>
#include <QtConcurrent>
#include <KLocalizedString>
......@@ -331,7 +331,7 @@ QPixmap ProjectClip::thumbnail(int width, int height)
bool ProjectClip::setProducer(ClipController *controller, bool replaceProducer)
{
if (!replaceProducer && m_controller) {
qDebug()<<"// RECEIVED PRODUCER BUT WE ALREADY HAVE ONE\n----------";
qCDebug(KDENLIVE_LOG)<<"// RECEIVED PRODUCER BUT WE ALREADY HAVE ONE\n----------";
return false;
}
bool isNewProducer = true;
......@@ -937,7 +937,7 @@ void ProjectClip::discardAudioThumb()
if (!audioThumbPath.isEmpty())
QFile::remove(audioThumbPath);
audioFrameCache.clear();
qDebug()<<"//////////////////// DISCARD AUIIO THUMBNS";
qCDebug(KDENLIVE_LOG)<<"//////////////////// DISCARD AUIIO THUMBNS";
m_controller->audioThumbCreated = false;
m_abortAudioThumb = false;
}
......
......@@ -21,7 +21,7 @@
#include "managecapturesdialog.h"
#include "doc/kthumb.h"
#include <QDebug>
#include "kdenlive_debug.h"
#include <QFontDatabase>
#include <KFileItem>
#include "klocalizedstring.h"
......@@ -108,10 +108,10 @@ void ManageCapturesDialog::slotDeleteCurrent()
if (!item) return;
const int i = m_view.treeWidget->indexOfTopLevelItem(item);
m_view.treeWidget->takeTopLevelItem(i);
//qDebug() << "DELETING FILE: " << item->text(0);
//qCDebug(KDENLIVE_LOG) << "DELETING FILE: " << item->text(0);
//KIO::NetAccess::del(QUrl(item->text(0)), this);
if (!QFile::remove(item->data(0, Qt::UserRole).toString())) {
qDebug()<<"// ERRor removing file "<<item->data(0, Qt::UserRole).toString();
qCDebug(KDENLIVE_LOG)<<"// ERRor removing file "<<item->data(0, Qt::UserRole).toString();
}
delete item;
item = Q_NULLPTR;
......
......@@ -22,7 +22,7 @@
#include <mlt++/Mlt.h>
#include <QDebug>
#include "kdenlive_debug.h"
#include <QTimer>
#include <QString>
......@@ -264,7 +264,7 @@ bool MltDeviceCapture::slotStartPreview(const QString &producer, bool xmlFormat)
delete m_mltProducer;
m_mltProducer = Q_NULLPTR;
}
//qDebug()<<"//// ERROR CREATRING PROD";
//qCDebug(KDENLIVE_LOG)<<"//// ERROR CREATRING PROD";
return false;
}
m_mltConsumer->connect(*m_mltProducer);
......@@ -423,7 +423,7 @@ bool MltDeviceCapture::slotStartCapture(const QString &params, const QString &pa
}
if (m_mltProducer == Q_NULLPTR || !m_mltProducer->is_valid()) {
//qDebug()<<"//// ERROR CREATRING PROD";
//qCDebug(KDENLIVE_LOG)<<"//// ERROR CREATRING PROD";
if (m_mltConsumer) {
delete m_mltConsumer;
m_mltConsumer = Q_NULLPTR;
......@@ -453,18 +453,18 @@ void MltDeviceCapture::setOverlay(const QString &path)
if (m_mltProducer == Q_NULLPTR || !m_mltProducer->is_valid()) return;
Mlt::Producer parentProd(m_mltProducer->parent());
if (parentProd.get_producer() == Q_NULLPTR) {
//qDebug() << "PLAYLIST BROKEN, CANNOT INSERT CLIP //////";
//qCDebug(KDENLIVE_LOG) << "PLAYLIST BROKEN, CANNOT INSERT CLIP //////";
return;
}
Mlt::Service service(parentProd.get_service());
if (service.type() != tractor_type) {
qWarning() << "// TRACTOR PROBLEM";
qCWarning(KDENLIVE_LOG) << "// TRACTOR PROBLEM";
return;
}
Mlt::Tractor tractor(service);
if ( tractor.count() < 2) {
qWarning() << "// TRACTOR PROBLEM";
qCWarning(KDENLIVE_LOG) << "// TRACTOR PROBLEM";
return;
}
mlt_service_lock(service.get_service());
......
......@@ -15,7 +15,7 @@
//#define DEBUG_CT
#ifdef DEBUG_CT
#include <QDebug>
#include "kdenlive_debug.h"
#endif
ColorTools::ColorTools(QObject *parent)
......@@ -258,9 +258,9 @@ QImage ColorTools::hsvHueShiftPlane(const QSize &size, const uint &S, const uint
QImage plane(size, QImage::Format_ARGB32);
#ifdef DEBUG_CT
qDebug() << "Requested: Saturation " << S << ", Value " << V;
qCDebug(KDENLIVE_LOG) << "Requested: Saturation " << S << ", Value " << V;
QColor colTest(-1, 256, 257);
qDebug() << "-1 mapped to " << colTest.red() << ", 256 to " << colTest.green() << ", 257 to " << colTest.blue();
qCDebug(KDENLIVE_LOG) << "-1 mapped to " << colTest.red() << ", 256 to " << colTest.green() << ", 257 to " << colTest.blue();
#endif
QColor col(0, 0, 0);
......@@ -273,7 +273,7 @@ QImage ColorTools::hsvHueShiftPlane(const QSize &size, const uint &S, const uint
float hue = x/(size.width() - 1.0) * 359;
for (int y = 0; y < size.height(); ++y) {
huediff = (1.0f - y/(size.height() - 1.0)) * hueValues + MIN;
// qDebug() << "hue: " << hue << ", huediff: " << huediff;
// qCDebug(KDENLIVE_LOG) << "hue: " << hue << ", huediff: " << huediff;
newhue = hue + huediff + 360; // Avoid negative numbers. Rest (>360) will be mapped correctly.
......
......@@ -17,7 +17,7 @@ the Free Software Foundation, either version 3 of the License, or
#include "bin/bin.h"
#include "library/librarywidget.h"
#include <QCoreApplication>
#include <QDebug>
#include "kdenlive_debug.h"
#include <locale>
#ifdef Q_OS_MAC
......@@ -136,7 +136,7 @@ void Core::initLocale()
#endif
char *separator = localeconv()->decimal_point;
if (QString::fromUtf8(separator) != QChar(systemLocale.decimalPoint())) {
//qDebug()<<"------\n!!! system locale is not similar to Qt's locale... be prepared for bugs!!!\n------";
//qCDebug(KDENLIVE_LOG)<<"------\n!!! system locale is not similar to Qt's locale... be prepared for bugs!!!\n------";
// HACK: There is a locale conflict, so set locale to C
// Make sure to override exported values or it won't work
qputenv("LANG", "C");
......
......@@ -24,7 +24,7 @@
#include "gentime.h"
#include "effectslist/effectslist.h"
#include <QDebug>
#include "kdenlive_debug.h"
#include <QTreeWidgetItem>
#include <QString>
......
......@@ -44,7 +44,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QUndoCommand>
#include <QStandardPaths>
#include <QPushButton>
#include <QDebug>
#include "kdenlive_debug.h"
#include <QDialog>
#include <QPointer>
#include <QMimeDatabase>
......@@ -546,7 +546,7 @@ void ClipCreationDialog::createClipsCommand(KdenliveDoc *doc, const QStringList
// import as sequence if we found more than one image in the sequence
QStringList list;
QString pattern = SlideshowClip::selectedPath(url, false, QString(), &list);
qDebug()<<" / // IMPORT PATTERN: "<<pattern<<" COUNT: "<<list.count();
qCDebug(KDENLIVE_LOG)<<" / // IMPORT PATTERN: "<<pattern<<" COUNT: "<<list.count();
int count = list.count();
if (count > 1) {
delete fileWidget;
......
......@@ -36,7 +36,7 @@
#include <KService>
#include <KRun>
#include <KOpenWithDialog>
#include <QDebug>
#include "kdenlive_debug.h"
#include <QDir>
#include <QTimer>
#include <QThread>
......@@ -341,7 +341,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& map
if (version.contains(' ')) version = version.section(' ', -1);
dvgrabVersion = version.toDouble();
//qDebug() << "// FOUND DVGRAB VERSION: " << dvgrabVersion;
//qCDebug(KDENLIVE_LOG) << "// FOUND DVGRAB VERSION: " << dvgrabVersion;
}
delete versionCheck;
if (dvgrabVersion < 3.3) {
......@@ -409,21 +409,21 @@ void KdenliveSettingsDialog::setupJogshuttleBtns(const QString &device)
QMap<QString, QString> mappable_actions(m_mappable_actions);
QList<QString> action_names = mappable_actions.keys();
QList<QString>::Iterator iter = action_names.begin();
//qDebug() << "::::::::::::::::";
//qCDebug(KDENLIVE_LOG) << "::::::::::::::::";
while (iter != action_names.end()) {
//qDebug() << *iter;
//qCDebug(KDENLIVE_LOG) << *iter;
++iter;
}
//qDebug() << "::::::::::::::::";
//qCDebug(KDENLIVE_LOG) << "::::::::::::::::";
qSort(action_names);
iter = action_names.begin();
while (iter != action_names.end()) {
//qDebug() << *iter;
//qCDebug(KDENLIVE_LOG) << *iter;
++iter;
}
//qDebug() << "::::::::::::::::";
//qCDebug(KDENLIVE_LOG) << "::::::::::::::::";
// Here we need to compute the action_id -> index-in-action_names. We iterate over the
// action_names, as the sorting may depend on the user-language.
......@@ -515,7 +515,7 @@ void KdenliveSettingsDialog::initDevices()
line = stream.readLine();
}
file.close();
} else qDebug()<<" / / / /CANNOT READ PCM";
} else qCDebug(KDENLIVE_LOG)<<" / / / /CANNOT READ PCM";
}
// Add pulseaudio capture option
......@@ -551,11 +551,11 @@ void KdenliveSettingsDialog::initDevices()
void KdenliveSettingsDialog::slotReadAudioDevices()
{
QString result = QString(m_readProcess.readAllStandardOutput());
//qDebug() << "// / / / / / READING APLAY: ";
//qDebug() << result;
//qCDebug(KDENLIVE_LOG) << "// / / / / / READING APLAY: ";
//qCDebug(KDENLIVE_LOG) << result;
QStringList lines = result.split('\n');
foreach(const QString & data, lines) {
////qDebug() << "// READING LINE: " << data;
////qCDebug(KDENLIVE_LOG) << "// READING LINE: " << data;
if (!data.startsWith(' ') && data.count(':') > 1) {
QString card = data.section(':', 0, 0).section(' ', -1);
QString device = data.section(':', 1, 1).section(' ', -1);
......@@ -651,7 +651,7 @@ void KdenliveSettingsDialog::slotUpdateShuttleDevice(int ix)
void KdenliveSettingsDialog::updateWidgets()
{
// Revert widgets to last saved state (for example when user pressed "Cancel")
// //qDebug() << "// // // KCONFIG Revert called";
// //qCDebug(KDENLIVE_LOG) << "// // // KCONFIG Revert called";
#ifdef USE_JOGSHUTTLE
// revert jog shuttle device
if (m_configShuttle.shuttledevicelist->count() > 0) {
......@@ -689,7 +689,7 @@ void KdenliveSettingsDialog::updateWidgets()
void KdenliveSettingsDialog::updateSettings()
{
// Save changes to settings (for example when user pressed "Apply" or "Ok")
// //qDebug() << "// // // KCONFIG UPDATE called";
// //qCDebug(KDENLIVE_LOG) << "// // // KCONFIG UPDATE called";
KdenliveSettings::setDefault_profile(m_pw->selectedProfile());
bool resetProfile = false;
......
......@@ -29,7 +29,7 @@
#include <QDir>
#include <QCloseEvent>
#include <QStandardPaths>
#include <QDebug>
#include "kdenlive_debug.h"
ProfilesDialog::ProfilesDialog(const QString &profileDescription, QWidget * parent) :
QDialog(parent),
......@@ -174,7 +174,7 @@ void ProfilesDialog::fillList(const QString &selectedProfile)
m_view.profiles_list->setCurrentIndex(ix);
} else {
// Error, profile not found
qWarning()<<"Project profile not found, disable editing";
qCWarning(KDENLIVE_LOG)<<"Project profile not found, disable editing";
}
}
int ix = m_view.profiles_list->findText(selectedProfile);
......@@ -291,7 +291,7 @@ void ProfilesDialog::slotDeleteProfile()
success = QFile::remove(path);
fillList();
}
if (!success) qDebug()<< "//// Cannot delete profile " << path << ", does not seem to be custom one";
if (!success) qCDebug(KDENLIVE_LOG)<< "//// Cannot delete profile " << path << ", does not seem to be custom one";
}
// static
......@@ -336,11 +336,11 @@ MltVideoProfile ProfilesDialog::getVideoProfile(const QString &name)
if (path.isEmpty() || !QFile::exists(path)) {
if (name == QLatin1String("dv_pal")) {
//qDebug() << "!!! WARNING, COULD NOT FIND DEFAULT MLT PROFILE";
//qCDebug(KDENLIVE_LOG) << "!!! WARNING, COULD NOT FIND DEFAULT MLT PROFILE";
return result;
}
if (name == KdenliveSettings::default_profile()) KdenliveSettings::setDefault_profile(QStringLiteral("dv_pal"));
//qDebug() << "// WARNING, COULD NOT FIND PROFILE " << name;
//qCDebug(KDENLIVE_LOG) << "// WARNING, COULD NOT FIND PROFILE " << name;
return result;
}
return getProfileFromPath(path, name);
......
......@@ -35,7 +35,7 @@
#include <qglobal.h>
#include <qstring.h>
#include <QDebug>
#include "kdenlive_debug.h"
#include <QDomDocument>
#include <QTreeWidgetItem>
#include <QHeaderView>
......@@ -1324,7 +1324,7 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut,
// rendering profile contains an MLT profile, so pass it to the running jog item, useful for dvd
QString prof = renderArgs.section(QStringLiteral("mlt_profile="), 1, 1);
prof = prof.section(' ', 0, 0);
qDebug() << "// render profile: " << prof;
qCDebug(KDENLIVE_LOG) << "// render profile: " << prof;
renderItem->setMetadata(prof);
}
}
......@@ -1713,7 +1713,7 @@ void RenderWidget::parseMltPresets()
QDir root(KdenliveSettings::mltpath());
if (!root.cd(QStringLiteral("../presets/consumer/avformat"))) {
//Cannot find MLT's presets directory
qWarning()<<" / / / WARNING, cannot find MLT's preset folder";
qCWarning(KDENLIVE_LOG)<<" / / / WARNING, cannot find MLT's preset folder";
return;
}
if (root.cd(QStringLiteral("lossless"))) {
......@@ -2261,7 +2261,7 @@ void RenderWidget::slotDeleteScript()
bool success = true;
success &= QFile::remove(path + ".mlt");
success &= QFile::remove(path);
if (!success) qWarning()<<"// Error removing script or playlist: "<<path<<", "<<path<<".mlt";
if (!success) qCWarning(KDENLIVE_LOG)<<"// Error removing script or playlist: "<<path<<", "<<path<<".mlt";
parseScriptFiles();
}
}
......@@ -2334,7 +2334,7 @@ bool RenderWidget::startWaitingRenderJobs()
QString autoscriptFile = getFreeScriptName(QUrl(), QStringLiteral("auto"));
QFile file(autoscriptFile);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
qWarning() << "////// ERROR writing to file: " << autoscriptFile;
qCWarning(KDENLIVE_LOG) << "////// ERROR writing to file: " << autoscriptFile;
KMessageBox::error(0, i18n("Cannot write to file %1", autoscriptFile));
return false;
}
......
......@@ -45,7 +45,7 @@
#include <QTimer>
#include <QStandardPaths>
#include <QMimeDatabase>
#include <QDebug>
#include "kdenlive_debug.h"
// Recommended MLT version
const int mltVersionMajor = MLT_MIN_MAJOR_VERSION;
......@@ -602,23 +602,23 @@ void Wizard::installExtraMimes(const QString &baseName, const QStringList &globs
}
if (missingGlobs.isEmpty()) return;
if (!mime.isValid() || mime.isDefault()) {
qDebug() << "mimeType " << baseName << " not found";
qCDebug(KDENLIVE_LOG) << "mimeType " << baseName << " not found";
} else {
QStringList extensions = mime.globPatterns();
QString comment = mime.comment();
foreach(const QString & glob, missingGlobs) {
if (!extensions.contains(glob)) extensions << glob;
}
//qDebug() << "EXTS: " << extensions;
//qCDebug(KDENLIVE_LOG) << "EXTS: " << extensions;
QDir mimeDir(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/mime/packages/"));
if (!mimeDir.exists()) {
mimeDir.mkpath(QStringLiteral("."));
}
QString packageFileName = mimeDir.absoluteFilePath(mimefile + ".xml");
//qDebug() << "INSTALLING NEW MIME TO: " << packageFileName;
//qCDebug(KDENLIVE_LOG) << "INSTALLING NEW MIME TO: " << packageFileName;
QFile packageFile(packageFileName);
if (!packageFile.open(QIODevice::WriteOnly)) {
qCritical() << "Couldn't open" << packageFileName << "for writing";
qCCritical(KDENLIVE_LOG) << "Couldn't open" << packageFileName << "for writing";
return;
}
QXmlStreamWriter writer(&packageFile);
......@@ -658,7 +658,7 @@ void Wizard::runUpdateMimeDatabase()
proc << localPackageDir;
const int exitCode = proc.execute();
if (exitCode) {
qWarning() << proc.program() << "exited with error code" << exitCode;
qCWarning(KDENLIVE_LOG) << proc.program() << "exited with error code" << exitCode;
}
}
......
......@@ -30,7 +30,7 @@
#include <klocalizedstring.h>
#include <KRecentDirs>
#include <QDebug>
#include "kdenlive_debug.h"
#include <QFontDatabase>
#include <QTreeWidgetItem>
#include <QFile>
......@@ -447,7 +447,7 @@ bool DocumentChecker::hasErrorInClips()
// Tell Kdenlive the source is missing
e.setAttribute(QStringLiteral("_missingsource"), QStringLiteral("1"));
QTreeWidgetItem *subitem = new QTreeWidgetItem(item, QStringList() << i18n("Source clip"));
//qDebug()<<"// Adding missing source clip: "<<realPath;
//qCDebug(KDENLIVE_LOG)<<"// Adding missing source clip: "<<realPath;
subitem->setIcon(0, KoIconUtils::themedIcon(QStringLiteral("dialog-close")));
subitem->setText(1, realPath);
subitem->setData(0, hashRole, EffectsList::property(e, QStringLiteral("kdenlive:file_hash")));
......@@ -666,7 +666,7 @@ QString DocumentChecker::searchFileRecursively(const QDir &dir, const QString &m
}
}
}
////qDebug() << filesAndDirs.at(i) << file.size() << fileHash.toHex();
////qCDebug(KDENLIVE_LOG) << filesAndDirs.at(i) << file.size() << fileHash.toHex();
}
filesAndDirs = dir.entryList(QDir::Dirs | QDir::Readable | QDir::Executable | QDir::NoDotAndDotDot);
for (int i = 0; i < filesAndDirs.size() && foundFileName.isEmpty(); ++i) {
......@@ -872,7 +872,7 @@ void DocumentChecker::fixClipItem(QTreeWidgetItem *child, const QDomNodeList &pr
}
if (!luma.isEmpty() && luma == child->data(0, idRole).toString()) {
setProperty(trans.at(i).toElement(), service == QLatin1String("luma") ? QStringLiteral("resource") : QStringLiteral("luma"), child->text(1));
//qDebug() << "replace with; " << child->text(1);
//qCDebug(KDENLIVE_LOG) << "replace with; " << child->text(1);
}
}
} else if (child->data(0, statusRole).toInt() == LUMAMISSING) {
......@@ -1032,7 +1032,7 @@ void DocumentChecker::checkMissingImagesAndFonts(const QStringList &images, cons
foreach(const QString &fontelement, fonts) {
if (m_safeFonts.contains(fontelement)) continue;
QFont f(fontelement);
////qDebug() << "/ / / CHK FONTS: " << fontelement << " = " << QFontInfo(f).family();
////qCDebug(KDENLIVE_LOG) << "/ / / CHK FONTS: " << fontelement << " = " << QFontInfo(f).family();
if (fontelement != QFontInfo(f).family()) {
m_missingFonts << fontelement;
}
......
This diff is collapsed.
......@@ -52,7 +52,7 @@
#include <QCryptographicHash>
#include <QFile>
#include <QDebug>
#include "kdenlive_debug.h"
#include <QFileDialog>
#include <QDomImplementation>
#include <QUndoGroup>
......@@ -168,7 +168,7 @@ KdenliveDoc::KdenliveDoc(const QUrl &url, const QString &projectFolder, QUndoGro
//KMessageBox::error(parent, KIO::NetAccess::lastErrorString());
}
else {
qDebug()<<" // / processing file open";
qCDebug(KDENLIVE_LOG)<<" // / processing file open";
QString errorMsg;
int line;
int col;
......@@ -215,7 +215,7 @@ KdenliveDoc::KdenliveDoc(const QUrl &url, const QString &projectFolder, QUndoGro
}
}
else {
qDebug()<<" // / processing file open: validate";
qCDebug(KDENLIVE_LOG)<<" // / processing file open: validate";
parent->slotGotProgressInfo(i18n("Validating"), 100);
qApp->processEvents();
DocumentValidator validator(m_document, url);
......@@ -237,7 +237,7 @@ KdenliveDoc::KdenliveDoc(const QUrl &url, const QString &projectFolder, QUndoGro
success = validator.checkMovit();
}
if (success) { // Let the validator handle error messages
qDebug()<<" // / processing file validate ok";
qCDebug(KDENLIVE_LOG)<<" // / processing file validate ok";
parent->slotGotProgressInfo(i18n("Check missing clips"), 100);
qApp->processEvents();
DocumentChecker d(m_url, m_document);
......@@ -302,9 +302,9 @@ KdenliveDoc::~KdenliveDoc()
}
}
delete m_commandStack;
//qDebug() << "// DEL CLP MAN";
//qCDebug(KDENLIVE_LOG) << "// DEL CLP MAN";
delete m_clipManager;
//qDebug() << "// DEL CLP MAN done";
//qCDebug(KDENLIVE_LOG) << "// DEL CLP MAN done";
if (m_autosave) {
if (!m_autosave->fileName().isEmpty()) m_autosave->remove();
delete m_autosave;
......@@ -558,9 +558,9 @@ void KdenliveDoc::slotAutoSave()
if (m_render && m_autosave) {
if (!m_autosave->isOpen() && !m_autosave->open(QIODevice::ReadWrite)) {
// show error: could not open the autosave file
qDebug() << "ERROR; CANNOT CREATE AUTOSAVE FILE";
qCDebug(KDENLIVE_LOG) << "ERROR; CANNOT CREATE AUTOSAVE FILE";
}
//qDebug() << "// AUTOSAVE FILE: " << m_autosave->fileName();
//qCDebug(KDENLIVE_LOG) << "// AUTOSAVE FILE: " << m_autosave->fileName();
QDomDocument sceneList = xmlSceneList(m_render->sceneList(m_url.adjusted(QUrl::RemoveFilename).path()));
if (sceneList.isNull()) {
//Make sure we don't save if scenelist is corrupted
......@@ -628,7 +628,7 @@ QDomDocument KdenliveDoc::xmlSceneList(const QString &scene)
// check if project contains custom effects to embed them in project file
QDomNodeList effects = mlt.elementsByTagName(QStringLiteral("filter"));
int maxEffects = effects.count();
//qDebug() << "// FOUD " << maxEffects << " EFFECTS+++++++++++++++++++++";
//qCDebug(KDENLIVE_LOG) << "// FOUD " << maxEffects << " EFFECTS+++++++++++++++++++++";
QMap <QString, QString> effectIds;