Bug#216225: Bug in g++ 3.3.2
Package: g++
Version: 3.3.2 20031005 Debian pre-release
We had a syntax error in a class definition in the .h which wasn't
reported by the GNU C++ compiler. I attach the header and the source
files.
Note line the header file, at line 45.
Thanks,
Pablo Fernández.
/***************************************************************************
bslproductinsertwidget.cpp - description
-------------------
begin : jue oct 16 2003
copyright : (C) 2003 by BSTeam
email : bsteam@bluesock.net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "bslproductinsertwidget.h"
#include "../../productsmodule/productmodule.h"
#include <qdatastream.h>
#include <qlineedit.h>
#include <qcombobox.h>
#include <qgroupbox.h>
#include <qmessagebox.h>
#include <qfile.h>
#include <qstring.h>
#include <qstringlist.h>
#include <qregexp.h>
#include <qpixmap.h>
#include <qlabel.h>
#include <qbuttongroup.h>
#include <qiconview.h>
#include <qcolor.h>
#include <qtable.h>
#include <qwidgetstack.h>
#include <qcheckbox.h>
#include <qradiobutton.h>
#include <qtextedit.h>
#include <qlayout.h>
#include <qfiledialog.h>
#include <qpushbutton.h>
#include <libbslxml/xmlconfig.h>
#include <qimage.h>
#include <qwmatrix.h>
#include <dcopclient.h>
#include <kapplication.h>
#include <iostream>
namespace std{};
using namespace std;
//const QCString& FINGERPRINT_DCOP_MODULE = "dcopfx2000";
const int PRODUCT_PROPERTIES_STACK = 0;
const int PRODUCT_COMPOSTION_STACK = 1;
const int PRODUCT_OPTIONS_PAGE = 0;
const int PRODUCT_OFFERS_PAGE = 1;
const QString INSERT_PRODUCT = "A�r Producto";
const QString INSERT_COMPOSITION = "A�r Combinaci�
const QString UPDATE_PRODUCT = "Modificar Producto";
const QString UPDATE_COMPOSITION = "Modificar Combinaci�
const QString DELETE_PRODUCT = "Borrar Producto";
const QString DELETE_COMPOSITION = "Borrar Combinaci�
#define SIZE_ICON 32.00
const QString action = "A�r Combinaci�
BslProductInsertWidget::BslProductInsertWidget(QString _action, ProductModule *_product_mod,
QWidget *parent, const char *name):
ProductInsertWidget(parent,name),
product_mod(0)
{
QStringList *col_names = 0;
QHBoxLayout *layout = 0;
action = _action;
product_mod = _product_mod;
tax_group->setExclusive(true);
table = new BslDDTable(ddtable_frame, "table");
table->setNumCols(3);
col_names = new QStringList();
col_names->append("Logo");
col_names->append("Producto");
col_names->append("Cantidad");
table->setColumnLabels(*col_names);
delete col_names;
if(!(layout =(QHBoxLayout *) ddtable_frame->layout())){
layout = new QHBoxLayout(ddtable_frame);
}
layout->addWidget(table);
layout = 0;
//compose and fill the iconview frame
iconview = new BslDDIconView(ddiconview_frame,"iconview");
if (!(layout =(QHBoxLayout *) ddiconview_frame->layout())){
layout = new QHBoxLayout(ddiconview_frame);
}
layout->addWidget(iconview);
// layout = 0;
// //compose and fill the iconview frame
// logo_view = new BslDDIconView(logo_frame,"logo_view");
// if (!(layout =(QHBoxLayout *) logo_frame->layout())){
// layout = new QHBoxLayout(logo_frame);
// }
// layout->addWidget(logo_view);
iconview->setGridX(70);
iconview->setGridY(70);
// logo_view->setGridX(60);
// logo_view->setGridY(60);
layout = 0;
float_keyboard_product = new FloatKeyboardBox(numblock_product_frame, "float_keyboard_product");
if(!(layout = (QHBoxLayout *) numblock_product_frame->layout())){
layout = new QHBoxLayout(numblock_product_frame);
}
layout->addWidget(float_keyboard_product);
layout = 0;
float_keyboard_option = 0;
float_keyboard_option = new FloatKeyboardBox(numblock_option_frame, "float_keyboard_option");
if(!(layout = (QHBoxLayout *) numblock_option_frame->layout())){
layout = new QHBoxLayout(numblock_option_frame);
}
layout->addWidget(float_keyboard_option);
layout = 0;
float_keyboard_offer = new FloatKeyboardBox(numblock_offer_frame, "float_keyboard_offer");
if(!(layout = (QHBoxLayout *) numblock_offer_frame->layout())){
layout = new QHBoxLayout(numblock_offer_frame);
}
layout->addWidget(float_keyboard_offer);
tax_group->setOrientation(Qt::Horizontal);
// //prepare the connections
// connect(accept_button,SIGNAL(released()),this,SLOT(acceptSlot()));
// connect(delete_button,SIGNAL(released()),this,SLOT(clear()));
// connect(previous_button, SIGNAL(released()), this, SLOT(showProductProperties()));
// //previousSlot()));
// connect(next_button, SIGNAL(released()), this, SLOT(showProductComposition()));
// //nextSlot()));
//product
connect(product_name,SIGNAL(textChanged(const QString&)),this,SLOT(productNameChanged(const QString&)));
// //options
// connect(option_type_combo, SIGNAL(activated(const QString&)), this, SLOT(optionTypeActivated(const QString&)));
// connect(save_option_button, SIGNAL(clicked()), this, SLOT(saveOptionButtonClicked()));
//
// //offers
// connect(offer_type_combo, SIGNAL(activated(const QString&)), this, SLOT(offerTypeActivated(const QString&)));
// connect(save_offer_button, SIGNAL(clicked()), this, SLOT(saveOfferButtonClicked()));
// connect(enter_price, SIGNAL(stateChanged(int)), this, SLOT(enterPriceChanged(int)));
//
// connect(table,SIGNAL(textEnter(const QString&)),this,SLOT(draggedText(const QString&)));
//
// connect(search_button, SIGNAL(clicked()), this, SLOT(searchButtonClicked()));
// connect(search_edit, SIGNAL(textChanged(const QString &)),this, SLOT(searchEditChanged(const QString &)));
//
// connect(search_product_button, SIGNAL(clicked()), this, SLOT(searchButtonClicked()));
// connect(search_product, SIGNAL(textChanged(const QString &)), this, SLOT(searchEditChanged(const QString &)));
//
// connect(accept_product, SIGNAL(clicked()), this, SLOT(acceptProduct()));
// connect(products_list, SIGNAL(currentChanged(QListBoxItem *)), this, SLOT(productSelected(QListBoxItem *)));
//
// connect(delete_product_button, SIGNAL(released()), this, SLOT(deleteProductClicked()));
// connect(cancel_button, SIGNAL(released()), this, SLOT(showWidgetAction()));
//
init();
}
BslProductInsertWidget::~BslProductInsertWidget(){
}
void BslProductInsertWidget::init(){
clear();
product_stack->raiseWidget(PRODUCT_PROPERTIES_STACK);
tab_options_offers->setCurrentPage(PRODUCT_OPTIONS_PAGE);
if(action == "Product"){
previous_button->hide();
next_button->hide();
accept_button->setEnabled(false);
accept_button->show();
cancel_button->show();
}
if(action == "Composition"){
previous_button->hide();
next_button->setEnabled(false);
next_button->show();
accept_button->hide();
cancel_button->show();
}
}
void BslProductInsertWidget::clear(){
product_name->clear();
code->clear();
family->clear();
initFamilies();
description_text->clear();
// initLogos();
// initOptionTypes();
option_default->setChecked(true);
save_option_button->setEnabled(false);
// initOfferTypes();
offer_default->setChecked(true);
save_offer_button->setEnabled(false);
calculate_price->setChecked(true);
}
void BslProductInsertWidget::initFamilies(){
QStringList *families = 0;
QString xml_string;
XmlConfig *xml = 0;
int index, count;
family->clear();
if(!product_mod)
product_mod = new ProductModule();
xml_string = product_mod->getFamilies();
xml = new XmlConfig();
if(!xml->readXmlFromString(xml_string)){
cerr << "No se pudo convertir el string en xml " << __PRETTY_FUNCTION__ << ": " << __LINE__ << endl;
delete xml;
return;
}
families = new QStringList();
xml->delDomain();
xml->setDomain("families");
count = xml->howManyTags("family");
for(index = 0; index < count; index++)
families->append(xml->readString("family[" + QString::number(index) + "]"));
delete xml;
family->insertStringList(*families);
delete families;
}
void BslProductInsertWidget::productNameChanged(const QString &text){
QString aux;
aux = text;
if (action == INSERT_PRODUCT){
aux = aux.replace(QRegExp(" "),"_");
if(!aux.isEmpty()){
accept_button->setEnabled(true);
save_option_button->setEnabled(true);
save_offer_button->setEnabled(true);
}
}
else
activeButtons();
}
/***************************************************************************
bslproductinsertwidget.h - description
-------------------
begin : jue oct 16 2003
copyright : (C) 2003 by BSTeam
email : bsteam@bluesock.net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef BSLPRODUCTINSERTWIDGET_H
#define BSLPRODUCTINSERTWIDGET_H
#include <qptrlist.h>
#include <qobject.h>
#include <qstringlist.h>
#include "productinsertwidget.h"
#include "../menuelements/bsldragobjects.h"
#include "../menuelements/floatkeyboardbox.h"
#include "../../productsmodule/productmodule.h"
/**
*@author BSTeam
*/
class BslProductInsertWidget : public ProductInsertWidget{
Q_OBJECT
public:
BslProductInsertWidget(QString _action = "Product", ProductModule *_product_mod =0 ,QWidget *parent=0, const char *name=0);
~BslProductInsertWidget();
private slots:
// void acceptSlot();
// void cancelSlot();
void clear();
void productNameChanged(const QString &text){
private:
void init();
void initFamilies();
ProductModule *product_mod;
QString action;
BslDDIconView *iconview;
BslDDIconView *logo_view;
QStringList *code_list;
BslDDListBox *listbox;
BslDDTable *table;
//keyboards
FloatKeyboardBox *float_keyboard_product;
FloatKeyboardBox *float_keyboard_option;
FloatKeyboardBox *float_keyboard_offer;
QPtrList<QPushButton> *button_list;
};
#endif
Reply to: