From: <sv...@va...> - 2010-03-12 02:33:31
|
Author: cerion Date: 2010-03-12 02:33:11 +0000 (Fri, 12 Mar 2010) New Revision: 493 Log: cleaned up the valgrind::suppressions options stuff - no more 'dirs' + auto-scanning dirs to provide 'available', etc. crap. - just a simple multiple-file listbox is just fine, and there's much less to go wrong. Modified: branches/valkyrie_qt4port/objects/valgrind_object.cpp branches/valkyrie_qt4port/objects/valgrind_object.h branches/valkyrie_qt4port/objects/valkyrie_object.cpp branches/valkyrie_qt4port/options/valgrind_options_page.cpp branches/valkyrie_qt4port/options/valgrind_options_page.h branches/valkyrie_qt4port/options/widgets/opt_base_widget.cpp branches/valkyrie_qt4port/options/widgets/opt_cb_widget.cpp branches/valkyrie_qt4port/options/widgets/opt_ck_widget.cpp branches/valkyrie_qt4port/options/widgets/opt_lb_widget.cpp branches/valkyrie_qt4port/options/widgets/opt_lb_widget.h branches/valkyrie_qt4port/options/widgets/opt_le_widget.cpp branches/valkyrie_qt4port/options/widgets/opt_sp_widget.cpp branches/valkyrie_qt4port/toolview/helgrindview.cpp branches/valkyrie_qt4port/utils/vk_config.cpp branches/valkyrie_qt4port/utils/vk_config.h Modified: branches/valkyrie_qt4port/objects/valgrind_object.cpp =================================================================== --- branches/valkyrie_qt4port/objects/valgrind_object.cpp 2010-03-12 00:30:43 UTC (rev 492) +++ branches/valkyrie_qt4port/objects/valgrind_object.cpp 2010-03-12 02:33:11 UTC (rev 493) @@ -385,38 +385,6 @@ // ------------------------------------------------------------ - /* list of dirs holding suppression files */ - options.addOpt( - VALGRIND::SUPPS_DIRS, - this->objectName(), - "supps-dirs", - '\0', - "", - "", - VkConfig::vkSuppsDir(), - "Suppression Dirs:", - "", - urlValkyrie::suppsTab, - VkOPT::NOT_POPT, - VkOPT::WDG_LISTBOX - ); - - /* list of all suppression files found in option SUPP_DIRS */ - options.addOpt( - VALGRIND::SUPPS_AVAIL, - this->objectName(), - "supps-avail", - '\0', - "", - "", - "", - "Available error-suppression file(s):", - "", - urlValkyrie::suppsTab, - VkOPT::NOT_POPT, - VkOPT::WDG_LISTBOX - ); - /* list of selected suppression files */ options.addOpt( VALGRIND::SUPPS_SEL, @@ -426,7 +394,7 @@ "<file1,...>", "", "", - "Selected error-suppression file(s):", + "Error-suppression file(s):", "suppress errors described in suppressions file(s)", urlValkyrie::suppsTab, VkOPT::ARG_STRING, @@ -515,27 +483,7 @@ - - - /*! - Update config - special cases -*/ -void Valgrind::updateConfig( int optid, QString& argval ) -{ - // exception: multiple suppressions are allowed - if ( optid == VALGRIND::SUPPS_SEL ) { - //TODO: concat supps, don't overwrite - // vkConfig->value( vk_opt->configKey() ); - // argval = cfg_argval + argval - } - - VkObject::updateConfig( optid, argval ); -} - - - -/*! Check \a argval for the option given by \a optid, updating if necessary. */ int Valgrind::checkOptArg( int optid, QString& argval ) @@ -587,32 +535,6 @@ argval = escapeEntities( argval ); break; - case VALGRIND::SUPPS_DIRS: { - // not popt: only reaches here from gui - vk_assert( opt->argType == VkOPT::NOT_POPT ); - - // check all entries are valid dirs, - // and update dirs to absolute paths - QStringList dirs = argval.split( sep, QString::SkipEmptyParts ); - - QStringList::iterator it = dirs.begin(); - for ( ; it != dirs.end(); ++it ) { - // check dir ok and has at least RX permissions - *it = dirCheck( &errval, *it, true, false, true ); - - if ( errval != PARSED_OK ) { - break; - } - } - - argval = dirs.join( sep ); - } - break; - - case VALGRIND::SUPPS_AVAIL: { - // not popt: only reaches here from gui - vk_assert( opt->argType == VkOPT::NOT_POPT ); - } // fall through to next case. case VALGRIND::SUPPS_SEL: { QStringList files = argval.split( sep, QString::SkipEmptyParts ); @@ -746,8 +668,6 @@ // we never want these included case VALGRIND::TOOL: /* tool set by valkyrie */ - case VALGRIND::SUPPS_DIRS: /* false option */ - case VALGRIND::SUPPS_AVAIL: /* false option */ // ignore these opts break; Modified: branches/valkyrie_qt4port/objects/valgrind_object.h =================================================================== --- branches/valkyrie_qt4port/objects/valgrind_object.h 2010-03-12 00:30:43 UTC (rev 492) +++ branches/valkyrie_qt4port/objects/valgrind_object.h 2010-03-12 02:33:11 UTC (rev 493) @@ -59,9 +59,7 @@ SHOW_BELOW, // --show-below-main // suppressions hackery - SUPPS_DIRS, // list of suppfile dirs - feeds SUPPS_AVAIL list - SUPPS_AVAIL, // fake opt: dyname list of available supp files - SUPPS_SEL, // the currently selected suppression(s) + SUPPS_SEL, // selected suppression files // misc GEN_SUPP, // --gen-suppressions @@ -89,8 +87,6 @@ int checkOptArg( int optid, QString& argval ); - void updateConfig( int optid, QString& argval ); - VkOptionsPage* createVkOptionsPage(); public: Modified: branches/valkyrie_qt4port/objects/valkyrie_object.cpp =================================================================== --- branches/valkyrie_qt4port/objects/valkyrie_object.cpp 2010-03-12 00:30:43 UTC (rev 492) +++ branches/valkyrie_qt4port/objects/valkyrie_object.cpp 2010-03-12 02:33:11 UTC (rev 493) @@ -505,7 +505,7 @@ void Valkyrie::updateConfig( int optid, QString& argval ) { // Load config settings from project file - // - load these first before + // - load these first before updating the rest if ( optid == VALKYRIE::PROJ_FILE ) { QString proj_filename = argval; Modified: branches/valkyrie_qt4port/options/valgrind_options_page.cpp =================================================================== --- branches/valkyrie_qt4port/options/valgrind_options_page.cpp 2010-03-12 00:30:43 UTC (rev 492) +++ branches/valkyrie_qt4port/options/valgrind_options_page.cpp 2010-03-12 02:33:11 UTC (rev 493) @@ -221,32 +221,13 @@ supp_vbox->setObjectName( QString::fromUtf8( "supp_vbox" ) ); // tabErep - options - insertOptionWidget( VALGRIND::SUPPS_DIRS, tabSupps, true ); // listbox - insertOptionWidget( VALGRIND::SUPPS_AVAIL, tabSupps, true ); // listbox - insertOptionWidget( VALGRIND::SUPPS_SEL, tabSupps, true ); // listbox + insertOptionWidget( VALGRIND::SUPPS_SEL, tabSupps, true ); // listbox - /* FIXME: suppression listbox widgets have far too much knowledge - about what they're used for. */ - LbWidget* lbDirs = ( LbWidget* )m_itemList[VALGRIND::SUPPS_DIRS]; - LbWidget* lbAvail = ( LbWidget* )m_itemList[VALGRIND::SUPPS_AVAIL]; - LbWidget* lbSel = ( LbWidget* )m_itemList[VALGRIND::SUPPS_SEL]; + LbWidget* lbSel = ( LbWidget* )m_itemList[VALGRIND::SUPPS_SEL]; + supp_vbox->addLayout( lbSel->vlayout() ); - // lbDirs updates lbAvail - connect( lbDirs, SIGNAL( listChanged() ), - this, SLOT( suppDirsChanged() ) ); - - // lbSel and lbAvail update each other - connect( lbAvail, SIGNAL( itemSelected( const QString& ) ), - this, SLOT( updateSuppsSel( const QString& ) ) ); - connect( lbSel, SIGNAL( listChanged() ), - this, SLOT( updateSuppsAvail() ) ); - - supp_vbox->addLayout( m_itemList[VALGRIND::SUPPS_DIRS ]->vlayout(), 1 ); - supp_vbox->addLayout( m_itemList[VALGRIND::SUPPS_AVAIL]->vlayout(), 2 ); - supp_vbox->addLayout( m_itemList[VALGRIND::SUPPS_SEL ]->vlayout(), 1 ); - // ============================================================ // Disabled Widgets /* These widgets are disabled because Valkyrie uses @@ -289,109 +270,14 @@ } - - -#if 1 -/* Called from OptionsDialog::categoryClicked() */ -void ValgrindOptionsPage::init() -{ - /* if usr gave suppfile on cmdline (updating lbSel) - - update suppDirs, suppsAvail from each path in lbSel */ - QChar sep = vkConfig->vkSepChar; - LbWidget* lbSel = ( LbWidget* )m_itemList[Valgrind::SUPPS_SEL ]; - QStringList currSupps = QStringList::split( sep, lbSel->currValue() ); //, QString::SkipEmptyParts - LbWidget* lbDirs = ( LbWidget* )m_itemList[Valgrind::SUPPS_DIRS]; - QStringList suppDirs = QStringList::split( sep, lbDirs->currValue() ); //, QString::SkipEmptyParts - - for ( unsigned int i = 0; i < currSupps.count(); i++ ) { - QFileInfo fi( currSupps[i] ); - QString path = fi.dirPath(); - - if ( suppDirs.find( path ) == suppDirs.end() ) { - suppDirs << path; - } - } - - lbDirs->setCurrValue( suppDirs.join( sep ) ); - - /* apply changes to lbDirs */ - applyEdits(); - - /* init suppsAvail */ - suppDirsChanged(); -} -#endif - - void ValgrindOptionsPage::getDbBin() { vkPrintErr( "TODO: ValgrindOptionsPage::getDbBin()\n" ); } -/*! - Scan dirs set in option "valgrind::supps-dirs" for available - suppression files. - Update other widgets with result. -*/ -void ValgrindOptionsPage::suppDirsChanged() +#if 0 //TODO { - m_allAvailSuppFiles = QStringList(); - LbWidget* lbDirs = ( LbWidget* )m_itemList[VALGRIND::SUPPS_DIRS]; - QChar sep = vkConfig->vkSepChar; - - // Get list of dirs from "valgrind::supps-dirs" - QStringList suppDirs = lbDirs->currValue().split( sep, QString::SkipEmptyParts ); - - for ( int i = 0; i < suppDirs.count(); i++ ) { - - // for each suppDir, find all supp files - QDir suppDir( suppDirs[i] ); - QString path = suppDir.absolutePath() + '/'; - QStringList entries = suppDir.entryList( QStringList( "*.supp" ), QDir::Files ); - - for ( int i = 0; i < entries.count(); i++ ) { - m_allAvailSuppFiles += ( path + entries[i] ); - } - } - - updateSuppsAvail(); -} - - -/*! - Given available suppfiles from dirscan, - remove those already selected in option "valgrind::supps-sel" - Set suppsAvail list with result. -*/ -void ValgrindOptionsPage::updateSuppsAvail() -{ - QChar sep = vkConfig->vkSepChar; - LbWidget* lbAvail = ( LbWidget* )m_itemList[VALGRIND::SUPPS_AVAIL]; - LbWidget* lbSel = ( LbWidget* )m_itemList[VALGRIND::SUPPS_SEL ]; - QStringList suppsAvail = m_allAvailSuppFiles; - QStringList currSupps = lbSel->currValue().split( sep, QString::SkipEmptyParts ); - - for ( int i = 0; i < currSupps.count(); i++ ) { - int idx = suppsAvail.indexOf( currSupps[i] ); - - if ( idx != -1 ) { - suppsAvail.removeAt( idx ); - } - } - - lbAvail->setCurrValue( suppsAvail.join( sep ) ); -} - - -/*! - Called by selecting an item in suppsAvail listbox. - Adds item to selected supps listbox (up to limit) -*/ -void ValgrindOptionsPage::updateSuppsSel( const QString& suppr ) -{ - LbWidget* lbSel = ( LbWidget* )m_itemList[VALGRIND::SUPPS_SEL]; - if ((( QListWidget* )lbSel->widget() )->count() < VG_CLO_MAX_SFILES ) { lbSel->insertItem( suppr ); } @@ -402,3 +288,4 @@ VG_CLO_MAX_SFILES ); } } +#endif Modified: branches/valkyrie_qt4port/options/valgrind_options_page.h =================================================================== --- branches/valkyrie_qt4port/options/valgrind_options_page.h 2010-03-12 00:30:43 UTC (rev 492) +++ branches/valkyrie_qt4port/options/valgrind_options_page.h 2010-03-12 02:33:11 UTC (rev 493) @@ -34,22 +34,10 @@ public: ValgrindOptionsPage( VkObject* obj ); -#if 0 - - void init(); -#endif - private slots: void getDbBin(); - void suppDirsChanged(); - void updateSuppsAvail(); - void updateSuppsSel( const QString& ); private: - // hold on to these, so don't have to rescan dirs all the time - QStringList m_allAvailSuppFiles; - -private: void setupOptions(); private: Modified: branches/valkyrie_qt4port/options/widgets/opt_base_widget.cpp =================================================================== --- branches/valkyrie_qt4port/options/widgets/opt_base_widget.cpp 2010-03-12 00:30:43 UTC (rev 492) +++ branches/valkyrie_qt4port/options/widgets/opt_base_widget.cpp 2010-03-12 02:33:11 UTC (rev 493) @@ -32,6 +32,8 @@ OptionWidget::OptionWidget( QWidget* parent, VkOption* vkopt, bool mklabel ) : QObject( parent ) { + this->setObjectName( "option_widget" ); + m_opt = vkopt; m_widg = 0; m_wLabel = 0; Modified: branches/valkyrie_qt4port/options/widgets/opt_cb_widget.cpp =================================================================== --- branches/valkyrie_qt4port/options/widgets/opt_cb_widget.cpp 2010-03-12 00:30:43 UTC (rev 492) +++ branches/valkyrie_qt4port/options/widgets/opt_cb_widget.cpp 2010-03-12 02:33:11 UTC (rev 493) @@ -37,6 +37,8 @@ CbWidget::CbWidget( QWidget* parent, VkOption* vkopt, bool mklabel ) : OptionWidget( parent, vkopt, mklabel ) { + this->setObjectName( "cb_widget" ); + m_currIdx = 0; m_combo = new QComboBox( parent ); // true m_widg = m_combo; Modified: branches/valkyrie_qt4port/options/widgets/opt_ck_widget.cpp =================================================================== --- branches/valkyrie_qt4port/options/widgets/opt_ck_widget.cpp 2010-03-12 00:30:43 UTC (rev 492) +++ branches/valkyrie_qt4port/options/widgets/opt_ck_widget.cpp 2010-03-12 02:33:11 UTC (rev 493) @@ -32,6 +32,8 @@ CkWidget::CkWidget( QWidget* parent, VkOption* vkopt, bool mklabel ) : OptionWidget( parent, vkopt, mklabel ) { + this->setObjectName( "ck_widget" ); + m_cbox = new QCheckBox( m_opt->shortHelp, parent ); m_widg = m_cbox; Modified: branches/valkyrie_qt4port/options/widgets/opt_lb_widget.cpp =================================================================== --- branches/valkyrie_qt4port/options/widgets/opt_lb_widget.cpp 2010-03-12 00:30:43 UTC (rev 492) +++ branches/valkyrie_qt4port/options/widgets/opt_lb_widget.cpp 2010-03-12 02:33:11 UTC (rev 493) @@ -66,7 +66,7 @@ LbWidget::LbWidget( QWidget* parent, VkOption* vkopt, bool mklabel ) : OptionWidget( parent, vkopt, mklabel ) { - // "lb_widget" + this->setObjectName( "lb_widget" ); m_lbox = new QListWidget( parent ); m_lbox->setObjectName( QString::fromUtf8( "list_box" ) ); @@ -75,28 +75,10 @@ m_sep = vkConfig->vkSepChar; - // horrible hack alert! - vk_assert( m_opt->configGrp == "valgrind" ); - - if ( m_opt->longFlag == "supps-dirs" ) { - m_mode = LbWidget::LB_SUPPDIRS; - } - else if ( m_opt->longFlag == "supps-avail" ) { - m_mode = LbWidget::LB_SUPPAVAIL; - } - else if ( m_opt->longFlag == "suppressions" ) { - m_mode = LbWidget::LB_SUPPSEL; - } - else { - vk_assert_never_reached(); - } - - lbLoad(); + reset(); m_lbox->setContextMenuPolicy( Qt::CustomContextMenu ); connect( m_lbox, SIGNAL( customContextMenuRequested( const QPoint& ) ), this, SLOT( popupMenu( const QPoint& ) ) ); - connect( m_lbox, SIGNAL( itemDoubleClicked( QListWidgetItem* ) ), - this, SLOT( selectItem( QListWidgetItem* ) ) ); // not added if the url is empty ContextHelp::addHelp( m_widg, m_opt->urlAddress ); @@ -112,35 +94,29 @@ } - -/* load items from m_currentValue to listbox */ -void LbWidget::lbLoad() +/*! + reset lbox to m_currentValue + called from OptionWidget::cancelEdit(), after m_currentValue reset. + */ +void LbWidget::reset() { m_lbox->clear(); QStringList sfiles = m_currentValue.split( m_sep, QString::SkipEmptyParts ); - + for ( int i = 0; i < sfiles.count(); i++ ) { m_lbox->addItem( sfiles[i] ); } } -/* reset lbox to m_currentValue - called from OptionWidget::cancelEdit(), after m_currentValue reset. +/*! + called from OptionsPage::resetDefaults() + reset to installation defaults */ -void LbWidget::reset() -{ - lbLoad(); - emit listChanged(); -} - -/* called from OptionsPage::resetDefaults() - reset to installation defaults - */ void LbWidget::resetDefault() { m_currentValue = m_opt->dfltValue.toString(); - lbLoad(); + reset(); lbChanged(); } @@ -148,16 +124,19 @@ void LbWidget::setCurrValue( const QString& txt ) { m_currentValue = txt; - lbLoad(); + reset(); lbChanged(); } -/* return all contents concat'd with m_sep */ +/*! + return all contents concat'd with m_sep +*/ QString LbWidget::lbText() { QStringList items; - + for ( int i = 0; i < m_lbox->count(); i++ ) { + m_lbox->removeItemWidget( m_lbox->item( i ) ); items += m_lbox->item( i )->text(); } @@ -165,201 +144,61 @@ } -/* emit signals to indicate widget content has changed */ +/*! + emit signals to indicate widget content has changed +*/ void LbWidget::lbChanged() { - switch ( m_mode ) { - case LbWidget::LB_SUPPAVAIL: - // Never test this widget's editedness - holds a dynamic list - break; - - case LbWidget::LB_SUPPDIRS: - case LbWidget::LB_SUPPSEL: { - bool edited = m_currentValue != m_initialValue; - emit valueChanged( edited, this ); - emit listChanged(); - } - break; - - default: - vk_assert_never_reached(); - break; - } + emit valueChanged( (m_currentValue != m_initialValue), this ); } -/* insert new list item. - only valid mode is LB_SUPPSEL +/*! + different menus and stuff for the different modes */ -void LbWidget::insertItem( const QString& entry ) -{ - switch ( m_mode ) { - case LbWidget::LB_SUPPSEL: - m_lbox->addItem( entry ); - m_currentValue = lbText(); - lbChanged(); - break; - - case LbWidget::LB_SUPPDIRS: - case LbWidget::LB_SUPPAVAIL: - default: - vk_assert_never_reached(); - break; - } -} - - -/* double clicked item, or via right-click menu - for a single-entry menu, do the only thing possible - else do nothing -*/ -void LbWidget::selectItem( QListWidgetItem* lb_item ) -{ - if ( !lb_item ) { - return; - } - - switch ( m_mode ) { - case LbWidget::LB_SUPPDIRS: - break; - - case LbWidget::LB_SUPPSEL: - emit itemSelected( lb_item->text() ); - m_lbox->removeItemWidget( lb_item ); - m_currentValue = lbText(); - lbChanged(); - break; - - case LbWidget::LB_SUPPAVAIL: - emit itemSelected( lb_item->text() ); - // Not removing item - list recalculated in valgrind opts page - break; - - default: - vk_assert_never_reached(); - break; - } -} - - -/* different menus and stuff for the different modes */ void LbWidget::popupMenu( const QPoint& pos ) { QListWidgetItem* lb_item = m_lbox->itemAt( pos ); - switch ( m_mode ) { - case LbWidget::LB_SUPPDIRS: - popupSuppDirs( lb_item, pos ); - break; - case LbWidget::LB_SUPPAVAIL: - popupSuppAvail( lb_item, pos ); - break; - case LbWidget::LB_SUPPSEL: - popupSuppSel( lb_item, pos ); - break; - default: - vk_assert_never_reached(); - break; - } -} + QAction actRemove( QPixmap( sel_supp_xpm ), "Remove File", this ); + QAction actAdd( QPixmap( sel_supp_xpm ), "Add File", this ); - -void LbWidget::popupSuppSel( QListWidgetItem* lb_item, const QPoint& pos ) -{ - vk_assert( m_mode == LbWidget::LB_SUPPSEL ); - - if ( !lb_item ) { // m_lbox is empty, so nothing to do - return; + if ( !lb_item ) { + actRemove.setEnabled( false ); } - QAction deselectAct( "Deselect File", this ); - -//TODO: check this - if ( !( lb_item->isSelected() ) ) { // || lb_item->isCurrent()) ) { - deselectAct.setEnabled( false ); - } - QMenu menu( m_lbox ); - menu.addAction( &deselectAct ); + menu.addAction( &actRemove ); + menu.addAction( &actAdd ); QAction* act = menu.exec( m_lbox->mapToGlobal( pos ) ); - if ( act == &deselectAct ) { - selectItem( lb_item ); + if ( act == &actRemove ) { + vk_assert( lb_item ); + m_lbox->takeItem( m_lbox->row( lb_item ) ); + // update currentvalue, and emit signal + m_currentValue = lbText(); + lbChanged(); } -} - - -void LbWidget::popupSuppAvail( QListWidgetItem* lb_item, const QPoint& pos ) -{ - vk_assert( m_mode == LbWidget::LB_SUPPAVAIL ); - - QAction selectAct( QPixmap( sel_supp_xpm ), "Select File", this ); - - if ( !lb_item || !( lb_item->isSelected() || - ( m_lbox->currentItem() == lb_item ) ) ) { - selectAct.setEnabled( false ); - } - - QMenu menu( m_lbox ); - menu.addAction( &selectAct ); - QAction* act = menu.exec( m_lbox->mapToGlobal( pos ) ); - - if ( act == &selectAct ) { - selectItem( lb_item ); - } -} - - -void LbWidget::popupSuppDirs( QListWidgetItem* lb_item, const QPoint& pos ) -{ - vk_assert( m_mode == LbWidget::LB_SUPPDIRS ); - - QAction rmDirAct( QPixmap( sel_supp_xpm ), "Remove Dir", this ); - QAction addDirAct( QPixmap( sel_supp_xpm ), "Add Dir", this ); - - if ( !lb_item/* empty */ ) { - rmDirAct.setEnabled( false ); - } - - QMenu menu( m_lbox ); - menu.addAction( &rmDirAct ); - menu.addAction( &addDirAct ); - QAction* act = menu.exec( m_lbox->mapToGlobal( pos ) ); - - bool changed = false; - - if ( act == &rmDirAct ) { - m_lbox->removeItemWidget( lb_item ); - changed = true; - } - else if ( act == &addDirAct ) { - QString startdir = m_currentValue.isEmpty() ? - QDir::currentPath() : - m_currentValue.split( m_sep, QString::SkipEmptyParts ).first(); - - QString supp_dir = QFileDialog::getExistingDirectory( - m_lbox, - tr( "Choose Suppressions Directory" ), - startdir, - QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks ); + else if ( act == &actAdd ) { + QString supp_file = + QFileDialog::getOpenFileName( m_lbox, + tr( "Choose Suppression File" ), + "./", tr("Suppression Files (*.supp)") ); - if ( ! supp_dir.isEmpty() ) { // user clicked Cancel ? + if ( ! supp_file.isEmpty() ) { // user clicked Cancel ? // check not a duplicate entry - if ( ! m_lbox->findItems( supp_dir, Qt::MatchExactly ).isEmpty() ) { - + if ( ! m_lbox->findItems( supp_file, Qt::MatchExactly ).isEmpty() ) { + vkInfo( m_lbox, "Duplicate Entry", "The entry '%s' is already in the list.", - qPrintable( supp_dir ) ); + qPrintable( supp_file ) ); } else { - m_lbox->addItem( supp_dir ); - changed = true; + m_lbox->addItem( supp_file ); + // update currentvalue, and emit signal + m_currentValue = lbText(); + lbChanged(); } } } - - if ( changed ) { - m_currentValue = lbText(); - lbChanged(); - } } Modified: branches/valkyrie_qt4port/options/widgets/opt_lb_widget.h =================================================================== --- branches/valkyrie_qt4port/options/widgets/opt_lb_widget.h 2010-03-12 00:30:43 UTC (rev 492) +++ branches/valkyrie_qt4port/options/widgets/opt_lb_widget.h 2010-03-12 02:33:11 UTC (rev 493) @@ -26,7 +26,7 @@ // ============================================================ -// listbox widget - specificly for suppression files +// listbox widget - for lists of files class LbWidget : public OptionWidget { Q_OBJECT @@ -37,35 +37,16 @@ void resetDefault(); void setCurrValue( const QString& ); -public slots: - void insertItem( const QString& ); -signals: - void itemSelected( const QString& ); - void listChanged(); - private slots: void popupMenu( const QPoint& ); - void selectItem( QListWidgetItem* lb_item ); - void popupSuppDirs( QListWidgetItem*, const QPoint& pos ); - void popupSuppAvail( QListWidgetItem*, const QPoint& pos ); - void popupSuppSel( QListWidgetItem*, const QPoint& pos ); private: QString lbText(); void lbChanged(); - void lbLoad(); private: QListWidget* m_lbox; - QChar m_sep; // so we don't have to keep asking vkConfig - - /* Note: - LB_SUPPDIRS = valgrind::supps-dirs = dirs to scan for supps - LB_SUPPAVAIL = valgrind::supps-avail = available supps to use - LB_SUPPSEL = valgrind::suppressions = selected supps - */ - enum LBMode { LB_SUPPDIRS, LB_SUPPAVAIL, LB_SUPPSEL }; - LBMode m_mode; + QChar m_sep; }; #endif // __VK_OPTION_LB_WIDGET_H Modified: branches/valkyrie_qt4port/options/widgets/opt_le_widget.cpp =================================================================== --- branches/valkyrie_qt4port/options/widgets/opt_le_widget.cpp 2010-03-12 00:30:43 UTC (rev 492) +++ branches/valkyrie_qt4port/options/widgets/opt_le_widget.cpp 2010-03-12 02:33:11 UTC (rev 493) @@ -30,6 +30,8 @@ LeWidget::LeWidget( QWidget* parent, VkOption* vkopt, bool mklabel ) : OptionWidget( parent, vkopt, mklabel ) { + this->setObjectName( "le_widget" ); + m_pb = 0; m_ledit = new QLineEdit( parent ); m_widg = m_ledit; Modified: branches/valkyrie_qt4port/options/widgets/opt_sp_widget.cpp =================================================================== --- branches/valkyrie_qt4port/options/widgets/opt_sp_widget.cpp 2010-03-12 00:30:43 UTC (rev 492) +++ branches/valkyrie_qt4port/options/widgets/opt_sp_widget.cpp 2010-03-12 02:33:11 UTC (rev 493) @@ -34,6 +34,8 @@ bool mklabel, int num_sections ) : OptionWidget( parent, vkopt, mklabel ) { + this->setObjectName( "sp_widget" ); + m_intspin = new IntSpin( parent ); m_widg = m_intspin; Modified: branches/valkyrie_qt4port/toolview/helgrindview.cpp =================================================================== --- branches/valkyrie_qt4port/toolview/helgrindview.cpp 2010-03-12 00:30:43 UTC (rev 492) +++ branches/valkyrie_qt4port/toolview/helgrindview.cpp 2010-03-12 02:33:11 UTC (rev 493) @@ -69,7 +69,7 @@ } -void HelgrindView::setState( bool run ) +void HelgrindView::setState( bool /*run*/ ) { } Modified: branches/valkyrie_qt4port/utils/vk_config.cpp =================================================================== --- branches/valkyrie_qt4port/utils/vk_config.cpp 2010-03-12 00:30:43 UTC (rev 492) +++ branches/valkyrie_qt4port/utils/vk_config.cpp 2010-03-12 02:33:11 UTC (rev 493) @@ -609,10 +609,3 @@ return QDir::homePath() + "/" + VK_CFG_GLBL_DIR + "/" + QString( VK_CFG_GLBL ) + "." + QString( VK_CFG_EXT ); } - -QString VkConfig::vkSuppsDir() -{ - return QDir::homePath() + "/" + VK_CFG_GLBL_DIR - + "/" + QString( VK_SUPPS_DIR ); -} - Modified: branches/valkyrie_qt4port/utils/vk_config.h =================================================================== --- branches/valkyrie_qt4port/utils/vk_config.h 2010-03-12 00:30:43 UTC (rev 492) +++ branches/valkyrie_qt4port/utils/vk_config.h 2010-03-12 02:33:11 UTC (rev 493) @@ -60,7 +60,6 @@ #define VK_INSTALL_PREFIX "./" //"$VK_INSTALL_PREFIX" #define VK_DOC_PATH "/doc/" #define VK_DBASE_DIR "dbase/" -#define VK_SUPPS_DIR "suppressions/" #define VK_BIN_VALGRIND "valgrind" #define VK_BIN_EDITOR "vi" #define VK_COPYRIGHT "(c) 2003-2010" @@ -101,7 +100,6 @@ // util functions static bool strToBool( QString str ); static QString vkCfgGlblFilename(); - static QString vkSuppsDir(); static QString vkTmpDir(); #if 0 |