m_dir = dir;
}
-QStringList* Console::dosql(QString* sqlcmd)
+void Console::dosql(QString* sqlcmd, QStringList& strlstret)
{
int stat;
/* don't effect the string coming in */
QString cmd(*sqlcmd);
- QStringList* strlstret = new QStringList;
cmd = ".sql \"" + cmd + "\"";
QString line = msg();
QRegExp regex("^Using Catalog");
if ( regex.indexIn(line) < 0 ){
- strlstret->append(line);
+ strlstret.append(line);
}
}
- return strlstret;
}
#include "mediaedit/mediaedit.h"
#include "joblist/joblist.h"
#include <QMenu>
-//#include <QSize>
MediaList::MediaList(QStackedWidget *parent, Console *console, QTreeWidgetItem *treeItem)
{
topItem->setText(0, "Pools");
topItem->setData(0, Qt::UserRole, 0);
topItem->setExpanded( true );
- //topItem->setSizeHint(0,QSize(1050,50));
+#ifdef xxx
+#include <QSize>
+***** FIXME *****
+//how to get the size of a column to be larger
+//topItem->setSizeHint(0,QSize(1050,50));
+#endif
/* Start with a list of pools */
m_poollist->clear();
- QStringList *results=m_console->dosql(m_cmd);
- int recordcounter=0;
m_headerlist->append("Volume Name");
m_headerlist->append("Media Id");
m_headerlist->append("Type");
m_treeWidget->setHeaderLabels(*m_headerlist);
+
QString currentpool("");
- for ( QStringList::Iterator resultline = results->begin(); resultline != results->end(); ++resultline ) {
- QStringList recorditemlist = resultline->split("\t");
+ QString resultline;
+ QStringList results;
+ m_console->dosql(m_cmd,results);
+ int recordcounter=0;
+ foreach( resultline, results ){
+ QStringList recorditemlist = resultline.split("\t");
int recorditemcnter=0;
/* Iterate through items in the record */
- for ( QStringList::Iterator mediarecorditem = recorditemlist.begin(); mediarecorditem != recorditemlist.end(); ++mediarecorditem ) {
- QString trimmeditem = mediarecorditem->trimmed();
+ QString mediarecorditem;
+ foreach( mediarecorditem, recorditemlist ){
+ QString trimmeditem = mediarecorditem.trimmed();
if( trimmeditem != "" ){
if ( recorditemcnter == 0 ){
if ( currentpool != trimmeditem.toUtf8().data() ){