From b0ee8cf2eb21e08f4866b99f2701b6570182074d Mon Sep 17 00:00:00 2001 From: Dirk H Bartley Date: Thu, 4 Mar 2010 23:30:30 -0500 Subject: [PATCH] This adds sql debugging to these classes that Eric wrote. --- bacula/src/qt-console/mediainfo/mediainfo.cpp | 6 ++++++ bacula/src/qt-console/medialist/mediaview.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bacula/src/qt-console/mediainfo/mediainfo.cpp b/bacula/src/qt-console/mediainfo/mediainfo.cpp index 1f11f12c4f..8673d7d783 100644 --- a/bacula/src/qt-console/mediainfo/mediainfo.cpp +++ b/bacula/src/qt-console/mediainfo/mediainfo.cpp @@ -144,6 +144,9 @@ void MediaInfo::populateForm() "LEFT JOIN Location ON (Media.LocationId=Location.LocationId) " "WHERE Media.VolumeName='" + m_mediaName + "'"; + if (mainWin->m_sqlDebug) { + Pmsg1(000, "MediaInfo query cmd : %s\n",query.toUtf8().data()); + } QStringList results; if (m_console->sql_cmd(query, results)) { QString resultline; @@ -211,6 +214,9 @@ void MediaInfo::populateForm() "FROM Job JOIN JobMedia USING (JobId) JOIN Media USING (MediaId) " "WHERE Media.VolumeName = '" + m_mediaName + "'"; + if (mainWin->m_sqlDebug) { + Pmsg1(000, "MediaInfo query cmd : %s\n",query.toUtf8().data()); + } results.clear(); if (m_console->sql_cmd(query, results)) { QString resultline; diff --git a/bacula/src/qt-console/medialist/mediaview.cpp b/bacula/src/qt-console/medialist/mediaview.cpp index edcc55a1cf..b3fb58c7ee 100644 --- a/bacula/src/qt-console/medialist/mediaview.cpp +++ b/bacula/src/qt-console/medialist/mediaview.cpp @@ -287,6 +287,9 @@ void MediaView::populateTable() "WHERE VolStatus IN ('Full', 'Used') " "GROUP BY MediaType"; + if (mainWin->m_sqlDebug) { + Pmsg1(000, "MediaView query cmd : %s\n",query.toUtf8().data()); + } if (m_console->sql_cmd(query, results)) { foreach (resultline, results) { fieldlist = resultline.split("\t"); @@ -308,9 +311,11 @@ void MediaView::populateTable() + cmd + " ORDER BY VolumeName LIMIT " + m_sbLimit->cleanText(); -// Pmsg1(000, "MediaView query cmd : %s\n",query.toUtf8().data()); m_tableMedia->setSortingEnabled(false); /* Don't sort during insert */ results.clear(); + if (mainWin->m_sqlDebug) { + Pmsg1(000, "MediaView query cmd : %s\n",query.toUtf8().data()); + } if (m_console->sql_cmd(query, results)) { int row=0; filterExipired(results); -- 2.39.5