Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: rghetta <birrachiara@ti...> - 2008-05-17 17:51:04
Attachments:
jobsort.patch
|
Hello Dirk and Kern, attached you find the sorting patch we discussed. To recap: - change joblist ordering to jobid descending. - enable column sorting as suggested by Marc Schiffbauer Listing of Job files was very slow on my machine, so I added a buffer of about 8KB to console::displayToPrompt() to speed thing up. Regards, Riccardo |
From: Dirk Bartley <bartleyd2@ch...> - 2008-05-17 21:04:58
|
This patch has been applied to the svn. Kern, If you would be willing to view the changes to the console class, that would be apprecieated. On Sat, 2008-05-17 at 19:50 +0200, rghetta wrote: > Hello Dirk and Kern, > attached you find the sorting patch we discussed. > To recap: > - change joblist ordering to jobid descending. > - enable column sorting as suggested by Marc Schiffbauer > > Listing of Job files was very slow on my machine, so I added a buffer of > about 8KB to console::displayToPrompt() to speed thing up. > > Regards, > Riccardo > plain text document attachment (jobsort.patch) > Index: bacula/src/qt-console/console/console.cpp > =================================================================== > --- bacula/src/qt-console/console/console.cpp (revision 6980) > +++ bacula/src/qt-console/console/console.cpp (working copy) > @@ -585,12 +585,18 @@ > void Console::displayToPrompt() > { > int stat = 0; > + QString buf; > if (mainWin->m_commDebug) Pmsg0(000, "DisplaytoPrompt\n"); > while (!m_at_prompt) { > if ((stat=read()) > 0) { > - display_text(msg()); > + buf += msg(); > + if (buf.size() >= 8196) { > + display_text(buf); > + buf.clear(); > + } > } > } > + display_text(buf); > if (mainWin->m_commDebug) Pmsg1(000, "endDisplaytoPrompt=%d\n", stat); > } > > @@ -598,12 +604,14 @@ > { > int stat = 0; > if (mainWin->m_commDebug) Pmsg0(000, "discardToPrompt\n"); > - while (!m_at_prompt) { > - if ((stat=read()) > 0) { > - if (mainWin->m_displayAll) display_text(msg()); > + if (mainWin->m_displayAll) { > + displayToPrompt(); > + } else { > + while (!m_at_prompt) { > + stat=read(); > } > } > - if (mainWin->m_commDebug) Pmsg1(000, "endDisplayToPrompt=%d\n", stat); > + if (mainWin->m_commDebug) Pmsg1(000, "endDiscardToPrompt=%d\n", stat); > } > > > Index: bacula/src/qt-console/joblist/joblist.cpp > =================================================================== > --- bacula/src/qt-console/joblist/joblist.cpp (revision 6980) > +++ bacula/src/qt-console/joblist/joblist.cpp (working copy) > @@ -138,6 +138,7 @@ > mp_tableWidget->setColumnCount(headerlist.size()); > mp_tableWidget->setHorizontalHeaderLabels(headerlist); > mp_tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows); > + mp_tableWidget->setSortingEnabled(false); /* rows move on insert if sorting enabled */ > > if (mainWin->m_sqlDebug) { > Pmsg1(000, "Query cmd : %s\n",query.toUtf8().data()); > @@ -205,6 +206,10 @@ > row++; > } > } > + /* set default sorting */ > + mp_tableWidget->sortByColumn(m_jobIdIndex, Qt::DescendingOrder); > + mp_tableWidget->setSortingEnabled(true); > + > /* Resize the columns */ > mp_tableWidget->resizeColumnsToContents(); > mp_tableWidget->resizeRowsToContents(); > @@ -329,7 +334,7 @@ > } > } > /* Descending */ > - query += " ORDER BY Job.Starttime=0 DESC, Job.Starttime DESC, Job.JobId DESC"; > + query += " ORDER BY Job.JobId DESC"; > /* If Limit check box for limit records returned is checked */ > if (limitCheckBox->checkState() == Qt::Checked) { > QString limit; |
From: Kern Sibbald <kern@si...> - 2008-05-17 21:18:48
|
On Saturday 17 May 2008 17:05:03 Dirk Bartley wrote: > This patch has been applied to the svn. Kern, If you would be willing > to view the changes to the console class, that would be apprecieated. It looks fine to me on a quick look, but I will check more in detail on my return home I leave tomorrow morning early (Monday) and arrive the next day (Tue). Best regards, Kern > > On Sat, 2008-05-17 at 19:50 +0200, rghetta wrote: > > Hello Dirk and Kern, > > attached you find the sorting patch we discussed. > > To recap: > > - change joblist ordering to jobid descending. > > - enable column sorting as suggested by Marc Schiffbauer > > > > Listing of Job files was very slow on my machine, so I added a buffer of > > about 8KB to console::displayToPrompt() to speed thing up. > > > > Regards, > > Riccardo > > plain text document attachment (jobsort.patch) > > Index: bacula/src/qt-console/console/console.cpp > > =================================================================== > > --- bacula/src/qt-console/console/console.cpp (revision 6980) > > +++ bacula/src/qt-console/console/console.cpp (working copy) > > @@ -585,12 +585,18 @@ > > void Console::displayToPrompt() > > { > > int stat = 0; > > + QString buf; > > if (mainWin->m_commDebug) Pmsg0(000, "DisplaytoPrompt\n"); > > while (!m_at_prompt) { > > if ((stat=read()) > 0) { > > - display_text(msg()); > > + buf += msg(); > > + if (buf.size() >= 8196) { > > + display_text(buf); > > + buf.clear(); > > + } > > } > > } > > + display_text(buf); > > if (mainWin->m_commDebug) Pmsg1(000, "endDisplaytoPrompt=%d\n", > > stat); } > > > > @@ -598,12 +604,14 @@ > > { > > int stat = 0; > > if (mainWin->m_commDebug) Pmsg0(000, "discardToPrompt\n"); > > - while (!m_at_prompt) { > > - if ((stat=read()) > 0) { > > - if (mainWin->m_displayAll) display_text(msg()); > > + if (mainWin->m_displayAll) { > > + displayToPrompt(); > > + } else { > > + while (!m_at_prompt) { > > + stat=read(); > > } > > } > > - if (mainWin->m_commDebug) Pmsg1(000, "endDisplayToPrompt=%d\n", > > stat); + if (mainWin->m_commDebug) Pmsg1(000, > > "endDiscardToPrompt=%d\n", stat); } > > > > > > Index: bacula/src/qt-console/joblist/joblist.cpp > > =================================================================== > > --- bacula/src/qt-console/joblist/joblist.cpp (revision 6980) > > +++ bacula/src/qt-console/joblist/joblist.cpp (working copy) > > @@ -138,6 +138,7 @@ > > mp_tableWidget->setColumnCount(headerlist.size()); > > mp_tableWidget->setHorizontalHeaderLabels(headerlist); > > mp_tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows); > > + mp_tableWidget->setSortingEnabled(false); /* rows move on insert if > > sorting enabled */ > > > > if (mainWin->m_sqlDebug) { > > Pmsg1(000, "Query cmd : %s\n",query.toUtf8().data()); > > @@ -205,6 +206,10 @@ > > row++; > > } > > } > > + /* set default sorting */ > > + mp_tableWidget->sortByColumn(m_jobIdIndex, Qt::DescendingOrder); > > + mp_tableWidget->setSortingEnabled(true); > > + > > /* Resize the columns */ > > mp_tableWidget->resizeColumnsToContents(); > > mp_tableWidget->resizeRowsToContents(); > > @@ -329,7 +334,7 @@ > > } > > } > > /* Descending */ > > - query += " ORDER BY Job.Starttime=0 DESC, Job.Starttime DESC, > > Job.JobId DESC"; + query += " ORDER BY Job.JobId DESC"; > > /* If Limit check box for limit records returned is checked */ > > if (limitCheckBox->checkState() == Qt::Checked) { > > QString limit; |
From: rghetta <birrachiara@ti...> - 2008-05-17 22:36:47
Attachments:
nosort.patch
|
Hello, I made the most stupid mistake with the sorting patch. QT sorts only alphabetically, so all numeric fields are messed up, including obviously the jobid. I suppose there is a way to have QT sort properly, but at this time I haven't found one, so perhaps the best solution is to disable column sorting. Dirk, please apply the attached patch until a better solution comes up. I'm terribly sorry for all the trouble. Riccardo Dirk Bartley wrote: > This patch has been applied to the svn. Kern, If you would be willing > to view the changes to the console class, that would be apprecieated. > > > On Sat, 2008-05-17 at 19:50 +0200, rghetta wrote: >> Hello Dirk and Kern, >> attached you find the sorting patch we discussed. >> To recap: >> - change joblist ordering to jobid descending. >> - enable column sorting as suggested by Marc Schiffbauer >> >> Listing of Job files was very slow on my machine, so I added a buffer of >> about 8KB to console::displayToPrompt() to speed thing up. >> >> Regards, >> Riccardo |
From: Dirk Bartley <bartleyd2@ch...> - 2008-05-18 13:08:44
|
This patch is committed. It looks like it functions quite well. Dirk On Sun, 2008-05-18 at 11:07 +0200, rghetta wrote: > Ok, this new patch should fix the sorting. > Dirk, please discard the "nosort.patch" I've sent yesterday and apply > this instead. > > I apologize again for the inconvenience. > Ciao, > Riccardo |
From: rghetta <birrachiara@ti...> - 2008-05-18 14:27:00
|
Oh, good. Thank you very much. Riccardo Dirk Bartley wrote: > This patch is committed. It looks like it functions quite well. > > Dirk > |
From: Kern Sibbald <kern@si...> - 2008-05-17 21:10:14
|
Hello Riccardo, Nice. Your 8K buffer is a great and simple idea for speeding things up! I'll leave it to Dirk to commit your patch as he has been doing. Best regards, Kern On Saturday 17 May 2008 13:50:41 rghetta wrote: > Hello Dirk and Kern, > attached you find the sorting patch we discussed. > To recap: > - change joblist ordering to jobid descending. > - enable column sorting as suggested by Marc Schiffbauer > > Listing of Job files was very slow on my machine, so I added a buffer of > about 8KB to console::displayToPrompt() to speed thing up. > > Regards, > Riccardo |
From: rghetta <birrachiara@ti...> - 2008-05-18 09:07:25
Attachments:
revisesort.patch
|
Ok, this new patch should fix the sorting. Dirk, please discard the "nosort.patch" I've sent yesterday and apply this instead. I apologize again for the inconvenience. Ciao, Riccardo rghetta wrote: > Hello, > I made the most stupid mistake with the sorting patch. > QT sorts only alphabetically, so all numeric fields are messed up, > including obviously the jobid. > I suppose there is a way to have QT sort properly, but at this time I > haven't found one, so perhaps the best solution is to disable column > sorting. > Dirk, please apply the attached patch until a better solution comes up. > > I'm terribly sorry for all the trouble. > Riccardo |