summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tableviewer/db/common.cpp2
-rw-r--r--noncore/apps/tableviewer/db/csvsource.cpp1
-rw-r--r--noncore/apps/tableviewer/ui/commonwidgets.cpp6
-rw-r--r--noncore/apps/tableviewer/ui/tvbrowseview.cpp4
-rw-r--r--noncore/apps/tableviewer/ui/tveditview.cpp4
-rw-r--r--noncore/apps/tableviewer/ui/tvfilterview.cpp4
-rw-r--r--noncore/apps/tableviewer/ui/tvkeyedit.cpp4
-rw-r--r--noncore/apps/tableviewer/ui/tvlistview.cpp4
8 files changed, 15 insertions, 14 deletions
diff --git a/noncore/apps/tableviewer/db/common.cpp b/noncore/apps/tableviewer/db/common.cpp
index 71844a5..dbf9370 100644
--- a/noncore/apps/tableviewer/db/common.cpp
+++ b/noncore/apps/tableviewer/db/common.cpp
@@ -658,49 +658,49 @@ bool TVVariant::close(TVVariant n)
return FALSE;
return TRUE;
}
case Int:
case Date:
case Time:
return TRUE;
default:
/* don't know how to do 'closer' on this type, hence never closer
* or even close */
break;
}
return FALSE;
}
/*!
\class Key
\brief document me!
document me!
*/
Key::Key() : kname(), kexample(), kflags(0) { }
-Key::Key(QString name, TVVariant example, int flags = 0) :
+Key::Key(QString name, TVVariant example, int flags) :
kname(name), kexample(example), kflags(flags) { }
Key::Key(const Key &other)
{
kname = other.kname;
kexample = other.kexample;
kflags = other.kflags;
}
Key& Key::operator=(const Key& key)
{
kname = key.kname;
kexample = key.kexample;
kflags = key.kflags;
return *this;
}
QString Key::name() const
{
return QString(kname);
}
TVVariant Key::example() const
{
diff --git a/noncore/apps/tableviewer/db/csvsource.cpp b/noncore/apps/tableviewer/db/csvsource.cpp
index 2561b4b..ea36300 100644
--- a/noncore/apps/tableviewer/db/csvsource.cpp
+++ b/noncore/apps/tableviewer/db/csvsource.cpp
@@ -77,48 +77,49 @@ QStringList readElem(QString in)
} else {
while(index < in.length() && in[index] != ',') {
if (in[index] == '\\') {
if (index++ < in.length()) {
elem.append(in[index]);
index++;
}
} else {
elem.append(in[index]);
index++;
}
}
}
/* we have our current elem */
out << elem.stripWhiteSpace();
firstChar = TRUE;
quotedElem = FALSE;
/* skip till a , or end of line */
while (index < in.length() && in[index] != ',') index++;
if(index == in.length())
return out;
else
index++;
}
+ return out;
}
bool DBCsv::openSource(QIODevice *inDev)
{
QTextStream tsIn(inDev);
QString in = tsIn.readLine().stripWhiteSpace();
QStringList keys;
keys = readElem(in);
QMap<int,int> keyIndexes;
KeyList *keyR = new KeyList();
QStringList::Iterator i = keys.begin();
uint fileIndex = 0;
while(i != keys.end()) {
if ((*i).isEmpty())
keyIndexes.insert(fileIndex, keyR->addKey("Unamed", TVVariant::String));
else
keyIndexes.insert(fileIndex, keyR->addKey(*i, TVVariant::String));
i++;
fileIndex++;
}
diff --git a/noncore/apps/tableviewer/ui/commonwidgets.cpp b/noncore/apps/tableviewer/ui/commonwidgets.cpp
index bf4c36f..4c47951 100644
--- a/noncore/apps/tableviewer/ui/commonwidgets.cpp
+++ b/noncore/apps/tableviewer/ui/commonwidgets.cpp
@@ -7,49 +7,49 @@
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include <qlineedit.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qcombobox.h>
#include <qpe/datebookmonth.h>
#include <qpopupmenu.h>
#include <qspinbox.h>
#include "commonwidgets.h"
-DateEdit::DateEdit( QWidget *parent = 0, const char *name = 0, WFlags f = 0 )
+DateEdit::DateEdit( QWidget *parent, const char *name, WFlags f )
: QToolButton(parent, name)
{
QPopupMenu *m1 = new QPopupMenu(this);
dateSelector = new DateBookMonth(m1, 0, TRUE);
m1->insertItem(dateSelector);
setPopup(m1);
setPopupDelay(0);
connect(dateSelector, SIGNAL(dateClicked(int, int, int)),
this, SLOT(subValueChanged()));
setText(dateSelector->selectedDate().toString());
}
DateEdit::~DateEdit() {}
QDate DateEdit::date() const
{
return dateSelector->selectedDate();
}
void DateEdit::setDate(QDate d)
{
@@ -61,49 +61,49 @@ QSizePolicy DateEdit::sizePolicy() const
{
QSizePolicy sp;
sp.setHorData(QToolButton::sizePolicy().horData());
sp.setVerData(QSizePolicy::Fixed);
return sp;
}
void DateEdit::clear()
{
QDate today = QDate::currentDate();
dateSelector->setDate(today.year(), today.month(), today.day());
setText(today.toString());
}
void DateEdit::subValueChanged()
{
QDate current = dateSelector->selectedDate();
setText(current.toString());
emit valueChanged(current);
}
-TimeEdit::TimeEdit( QWidget *parent = 0, const char *name = 0, WFlags f = 0 )
+TimeEdit::TimeEdit( QWidget *parent, const char *name, WFlags f )
: QWidget(parent, name, f)
{
QHBoxLayout *layout = new QHBoxLayout(this, 0);
layout->addWidget(hourKey = new QSpinBox(1, 12, 1, this));
hourKey->setWrapping(true);
hourKey->setMinimumWidth(30);
hourKey->setMaximumWidth(35);
layout->addWidget(new QLabel(" : ", this));
layout->addWidget(minuteKey = new QSpinBox(0, 59, 1, this));
minuteKey->setWrapping(true);
minuteKey->setMinimumWidth(30);
minuteKey->setMaximumWidth(35);
layout->addWidget(new QLabel(" : ", this));
layout->addWidget(secondKey = new QSpinBox(0, 59, 1, this, 0));
secondKey->setWrapping(true);
secondKey->setMinimumWidth(30);
secondKey->setMaximumWidth(35);
layout->addWidget(ampm = new QComboBox(this));
ampm->insertItem("AM");
ampm->insertItem("PM");
@@ -169,42 +169,42 @@ void TimeEdit::setTime(QTime t)
QSizePolicy TimeEdit::sizePolicy() const
{
QSizePolicy sp;
sp.setHorData(QSizePolicy::Preferred);
sp.setVerData(QSizePolicy::Fixed);
return sp;
}
void TimeEdit::clear()
{
secondKey->setValue(0);
minuteKey->setValue(0);
hourKey->setValue(12);
ampm->setCurrentItem(0);
}
void TimeEdit::subValueChanged()
{
emit valueChanged(time());
}
-IntEdit::IntEdit( QWidget *parent = 0, const char *name = 0, WFlags f = 0 )
+IntEdit::IntEdit( QWidget *parent, const char *name, WFlags f )
: QSpinBox(INT_MIN, INT_MAX, 1, parent, name)
{
setValue(0);
}
IntEdit::~IntEdit() {}
int IntEdit::value()
{
return cleanText().toInt();
}
void IntEdit::clear()
{
setValue(0);
}
diff --git a/noncore/apps/tableviewer/ui/tvbrowseview.cpp b/noncore/apps/tableviewer/ui/tvbrowseview.cpp
index 9bfc791..f5f2555 100644
--- a/noncore/apps/tableviewer/ui/tvbrowseview.cpp
+++ b/noncore/apps/tableviewer/ui/tvbrowseview.cpp
@@ -16,50 +16,50 @@
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "tvbrowseview.h"
#include "browsekeyentry.h"
#include <qtoolbutton.h>
#include <qtextview.h>
#include <qtextbrowser.h>
#include <qlayout.h>
/*!
\class TVBrowseView
\brief The widget describing how to draw the browse view user interface
This widget allows for the user to browse through the table, one element
at a time, or search on a single key. Its main goal is to show a
single element in a readable format and make it easy for the user to
rapidly find specific elements in the table.
*/
/*!
Constructs a new TVBrowseView widget
*/
-TVBrowseView::TVBrowseView(TableState *t, QWidget* parent = 0, const char *name = 0,
- WFlags fl =0)
+TVBrowseView::TVBrowseView(TableState *t, QWidget* parent, const char *name,
+ WFlags fl )
{
if (!name)
setName("BrowseView");
// setSizePolicy(QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding, 0, 0, sizePolicy().hasHeightForWidth() ) );
QVBoxLayout *vlayout = new QVBoxLayout(this);
textViewDisplay = new QTextBrowser(this, "textViewDisplay");
vlayout->addWidget( textViewDisplay );
keyEntry = new TVBrowseKeyEntry(this, "keyEntry");
vlayout->addWidget( keyEntry );
/* connect the signals down */
connect(keyEntry, SIGNAL(searchOnKey(int, TVVariant)),
this, SIGNAL(searchOnKey(int, TVVariant)));
connect(keyEntry, SIGNAL(sortChanged(int)),
this, SIGNAL(sortChanged(int)));
ts = t;
keyEntry->setTableState(t);
}
/*!
diff --git a/noncore/apps/tableviewer/ui/tveditview.cpp b/noncore/apps/tableviewer/ui/tveditview.cpp
index ba2bd06..23e2b42 100644
--- a/noncore/apps/tableviewer/ui/tveditview.cpp
+++ b/noncore/apps/tableviewer/ui/tveditview.cpp
@@ -19,50 +19,50 @@
**********************************************************************/
/* The edit view widget. For each key in the DB display an
* appropriate edit box, and a 'key' button to change that particular
* key information (delete or edit).
*
* Bottem line should be a 'new key' button. Should be able to scroll
* in both directions.
*/
#include "tveditview.h"
#include "commonwidgets.h"
#include <qlayout.h>
#include <qgrid.h>
#include <qvbox.h>
#include <qlineedit.h>
#include <qcheckbox.h>
#include <qlist.h>
#include <qlabel.h>
#include <qscrollview.h>
#include <qsignalmapper.h>
-TVEditView::TVEditView(TableState *s, DataElem *d, QWidget* parent = 0,
- const char *name = 0, WFlags fl =0) : QDialog(parent, name, true, fl)
+TVEditView::TVEditView(TableState *s, DataElem *d, QWidget* parent,
+ const char *name, WFlags fl ) : QDialog(parent, name, true, fl)
{
if (!name)
setName("TVEditView");
QVBoxLayout *layout = new QVBoxLayout(this, 0); /* only so that will resize
correctly in other
widgets */
toggles = new QSignalMapper(this);
QScrollView *sv = new QScrollView(this, 0);
sv->setResizePolicy(QScrollView::AutoOneFit);
layout->addWidget(sv);
editDisplay = new QGrid(3, sv, 0);
editDisplay->setSpacing(3);
sv->addChild(editDisplay);
connect(toggles, SIGNAL(mapped(int)), this, SLOT(toggleEnabled(int)));
setData(s, d);
#ifdef Q_WS_QWS
showMaximized();
#endif
diff --git a/noncore/apps/tableviewer/ui/tvfilterview.cpp b/noncore/apps/tableviewer/ui/tvfilterview.cpp
index 72d39d6..0182127 100644
--- a/noncore/apps/tableviewer/ui/tvfilterview.cpp
+++ b/noncore/apps/tableviewer/ui/tvfilterview.cpp
@@ -5,50 +5,50 @@
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "tvfilterview.h"
#include <qtoolbutton.h>
#include <qcombobox.h>
#include <qlistview.h>
#include <qlayout.h>
#include <qheader.h>
#include <qpushbutton.h>
#include <qlabel.h>
-TVFilterView::TVFilterView(TableState *t, QWidget* parent = 0,
- const char *name = 0, WFlags fl =0) : QDialog(parent, name, TRUE, fl)
+TVFilterView::TVFilterView(TableState *t, QWidget* parent,
+ const char *name, WFlags fl ) : QDialog(parent, name, TRUE, fl)
{
if ( !name )
setName( "Filter View" );
QVBoxLayout *vlayout = new QVBoxLayout(this);
display = new QListView(this, "display");
display->addColumn("Key");
display->addColumn("Constraint");
display->addColumn("Value");
display->header()->setClickEnabled(FALSE);
display->header()->setResizeEnabled(FALSE);
vlayout->addWidget(display);
QHBoxLayout *hlayout = new QHBoxLayout;
hlayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
newFilterButton = new QPushButton(this, "new Filter");
newFilterButton->setMaximumSize(QSize(50, 32767));
newFilterButton->setText("New");
hlayout->addWidget(newFilterButton);
deleteFilterButton = new QPushButton(this, "delete Filter");
diff --git a/noncore/apps/tableviewer/ui/tvkeyedit.cpp b/noncore/apps/tableviewer/ui/tvkeyedit.cpp
index fb7b7fe..4849e87 100644
--- a/noncore/apps/tableviewer/ui/tvkeyedit.cpp
+++ b/noncore/apps/tableviewer/ui/tvkeyedit.cpp
@@ -71,50 +71,50 @@ public:
}
TVVariant::KeyType getKeyType() const
{
return keyType;
}
void setKeyType(TVVariant::KeyType k)
{
keyType = k;
repaint();
}
inline int getPos() const
{
return position;
}
private:
QString name;
TVVariant::KeyType keyType;
int position;
};
-TVKeyEdit::TVKeyEdit(TableState *t, QWidget* parent = 0, const char *name = 0,
- WFlags fl = 0) : TVKeyEdit_gen(parent, name, true, fl)
+TVKeyEdit::TVKeyEdit(TableState *t, QWidget* parent, const char *name,
+ WFlags fl) : TVKeyEdit_gen(parent, name, true, fl)
{
int i;
ts = t;
if(!ts) return;
if(!ts->kRep) return;
working_state = *ts->kRep;
i = 1;
keyTypeEdit->insertItem(TVVariant::typeToName((TVVariant::KeyType)i));
i++;
keyTypeEdit->insertItem(TVVariant::typeToName((TVVariant::KeyType)i));
i++;
keyTypeEdit->insertItem(TVVariant::typeToName((TVVariant::KeyType)i));
i++;
keyTypeEdit->insertItem(TVVariant::typeToName((TVVariant::KeyType)i));
KeyListIterator it(*ts->kRep);
while(it.current()) {
if(t->kRep->validIndex(it.currentKey())) {
new TVKEListViewItem(it.current()->name(),
it.current()->type(),
it.currentKey(),
diff --git a/noncore/apps/tableviewer/ui/tvlistview.cpp b/noncore/apps/tableviewer/ui/tvlistview.cpp
index 82d67c6..b25e813 100644
--- a/noncore/apps/tableviewer/ui/tvlistview.cpp
+++ b/noncore/apps/tableviewer/ui/tvlistview.cpp
@@ -64,50 +64,50 @@ public:
void setDataElem(DataElem *d)
{
data_reference = d;
}
DataElem *getDataElem() {
return data_reference;
}
private:
DataElem *data_reference;
};
TVListViewItem::TVListViewItem(QListView *parent, DataElem *d)
: QListViewItem(parent)
{
data_reference = d;
}
TVListViewItem::~TVListViewItem()
{
data_reference = 0;
}
-TVListView::TVListView(TableState *t, QWidget* parent = 0,
- const char *name = 0, WFlags fl =0) : QWidget(parent, name, fl)
+TVListView::TVListView(TableState *t, QWidget* parent,
+ const char *name, WFlags fl ) : QWidget(parent, name, fl)
{
if (!name)
setName("TVListView");
// the next two lines need to be rationalized.
resize(318,457);
setSizePolicy(QSizePolicy((QSizePolicy::SizeType)7,
(QSizePolicy::SizeType)7, sizePolicy().hasHeightForWidth()));
setCaption(tr("List View"));
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setSpacing(0);
layout->setMargin(0);
listViewDisplay = new TVListViewPrivate(this, "listViewDisplay");
layout->addWidget(listViewDisplay);
connect(listViewDisplay, SIGNAL(currentChanged(QListViewItem *)), this,
SLOT(setCurrent(QListViewItem *)));
connect(listViewDisplay, SIGNAL(sortChanged(int)), this,
SLOT(setSorting(int)));
listViewDisplay->setShowSortIndicator(true);