From db05f326a4e98069ab685b3447a3e87037d1b7d8 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 13 May 2007 14:35:54 +0000 Subject: [PATCH] Kludge joblist to include all jobs git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4768 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/qt-console/joblist/joblist.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/bacula/src/qt-console/joblist/joblist.cpp b/bacula/src/qt-console/joblist/joblist.cpp index 17a0686e36..a9bf18e034 100644 --- a/bacula/src/qt-console/joblist/joblist.cpp +++ b/bacula/src/qt-console/joblist/joblist.cpp @@ -111,15 +111,26 @@ void JobList::populateTable() /* Set up query QString and header QStringList */ QString query(""); - query += "SELECT DISTINCT Job.Jobid AS Id, Job.Name AS JobName, Client.Name AS Client," + /* + * ***FIXME*** + * NB temporarily remove Media and JobMedia, because one cannot include + * those items if one wants to list all jobs. Some jobs never write + * to Volumes. To correct this one needs two different SELECT statements + * depending on the filter. + * Also, note that DISTINCT doesn't work as one intuitively think it + * will on PostgreSQL. I believe the use here was incorrect so I + * removed it -- at least temporarily. + * This comment should be removed when fixed. + */ + query += "SELECT Job.Jobid AS Id, Job.Name AS JobName, Client.Name AS Client," " Job.Starttime AS JobStart, Job.Type AS JobType," " Job.Level AS BackupLevel, Job.Jobfiles AS FileCount," " Job.JobBytes AS Bytes," " Job.JobStatus AS Status, Status.JobStatusLong AS Status," " Job.PurgedFiles AS Purged" - " FROM Job, JobMedia, Media, Client, Status" - " WHERE JobMedia.JobId=Job.JobId AND JobMedia.MediaId=Media.MediaId" - " AND Client.ClientId=Job.ClientId AND Job.JobStatus=Status.JobStatus"; + " FROM Job,Client,Status" + " WHERE Client.ClientId=Job.ClientId AND Job.JobStatus=Status.JobStatus"; +#ifdef xxx int volumeIndex = volumeComboBox->currentIndex(); if (volumeIndex != -1) m_mediaName = volumeComboBox->itemText(volumeIndex); @@ -127,6 +138,7 @@ void JobList::populateTable() query += " AND Media.VolumeName='" + m_mediaName + "'"; m_closeable=true; } +#endif int clientIndex = clientsComboBox->currentIndex(); if (clientIndex != -1) m_clientName = clientsComboBox->itemText(clientIndex); -- 2.39.5