author | zecke <zecke> | 2004-09-10 11:06:50 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-09-10 11:06:50 (UTC) |
commit | 00b7879d0d886b642b1f1102e3a811e67f928df7 (patch) (side-by-side diff) | |
tree | 15a9a6b1ba3ddf64a94265556cd9140916a47811 /libopie2 | |
parent | d416ff23ea50303173d07ea243498a163f5995b5 (diff) | |
download | opie-00b7879d0d886b642b1f1102e3a811e67f928df7.zip opie-00b7879d0d886b642b1f1102e3a811e67f928df7.tar.gz opie-00b7879d0d886b642b1f1102e3a811e67f928df7.tar.bz2 |
Fix warnings about unused parameters and no newline at the end of file
-rw-r--r-- | libopie2/opieui/big-screen/owidgetstack.cpp | 0 | ||||
-rw-r--r-- | libopie2/opieui/ofontselector.cpp | 1 | ||||
-rw-r--r-- | libopie2/opieui/olistview.cpp | 4 | ||||
-rw-r--r-- | libopie2/opieui/oselector.cpp | 2 | ||||
-rw-r--r-- | libopie2/opieui/owait.cpp | 1 |
5 files changed, 8 insertions, 0 deletions
diff --git a/libopie2/opieui/big-screen/owidgetstack.cpp b/libopie2/opieui/big-screen/owidgetstack.cpp index de7f83f..9c9f7ec 100644 --- a/libopie2/opieui/big-screen/owidgetstack.cpp +++ b/libopie2/opieui/big-screen/owidgetstack.cpp diff --git a/libopie2/opieui/ofontselector.cpp b/libopie2/opieui/ofontselector.cpp index 6763ee6..4870cd9 100644 --- a/libopie2/opieui/ofontselector.cpp +++ b/libopie2/opieui/ofontselector.cpp @@ -148,96 +148,97 @@ OFontSelector::OFontSelector( bool withpreview, QWidget *parent, const char *nam connect( d->m_font_size_list, SIGNAL( activated(int) ), this, SLOT( fontSizeClicked(int) ) ); gridLayout->addWidget( d->m_font_size_list, 3, 1 ); d->m_pointbug = ( qt_version() <= 233 ); if ( withpreview ) { d->m_preview = new QMultiLineEdit ( this, "Preview" ); d->m_preview->setAlignment ( AlignCenter ); d->m_preview->setWordWrap ( QMultiLineEdit::WidgetWidth ); d->m_preview->setMargin ( 3 ); d->m_preview->setText ( tr( "The Quick Brown Fox Jumps Over The Lazy Dog" )); gridLayout->addRowSpacing ( 5, 4 ); gridLayout->addMultiCellWidget ( d->m_preview, 6, 6, 0, 1 ); gridLayout->setRowStretch ( 6, 5 ); } else d->m_preview = 0; loadFonts ( d->m_font_family_list ); } OFontSelector::~OFontSelector() { delete d; } /** * This methods tries to set the font * @param f The wishes font * @return success or failure */ bool OFontSelector::setSelectedFont ( const QFont &f ) { return setSelectedFont ( f. family(), d->m_fdb. styleString ( f ), f. pointSize(), QFont::encodingName ( f. charSet())); } /** * This is an overloaded method @see setSelectedFont * @param familyStr The family of the font * @param styleStr The style of the font * @param sizeVal The size of font * @param charset The charset to be used. Will be deprecated by QT3 */ bool OFontSelector::setSelectedFont( const QString &familyStr, const QString &styleStr, int sizeVal, const QString & charset ) { + Q_CONST_UNUSED( charset ) QString sizeStr = QString::number ( sizeVal ); QListBoxItem *family = d->m_font_family_list->findItem ( familyStr ); if ( !family ) family = d->m_font_family_list->findItem ( "Helvetica" ); if ( !family ) family = d->m_font_family_list->firstItem(); d->m_font_family_list->setCurrentItem ( family ); fontFamilyClicked ( d->m_font_family_list->index ( family )); int style = findItemCB ( d->m_font_style_list, styleStr ); if ( style < 0 ) style = findItemCB ( d->m_font_style_list, "Regular" ); if ( style < 0 && d->m_font_style_list->count() > 0 ) style = 0; d->m_font_style_list->setCurrentItem ( style ); fontStyleClicked ( style ); int size = findItemCB ( d->m_font_size_list, sizeStr ); if ( size < 0 ) size = findItemCB ( d->m_font_size_list, "10" ); if ( size < 0 && d->m_font_size_list->count() > 0 ) size = 0; d->m_font_size_list->setCurrentItem ( size ); fontSizeClicked ( size ); return (( family ) && ( style >= 0 ) && ( size >= 0 )); } /** * This method returns the name, style and size of the currently selected * font or false if no font is selected * @param family The font family will be written there * @param style The style will be written there * @param size The size will be written there * @return success or failure */ bool OFontSelector::selectedFont ( QString &family, QString &style, int &size ) { QString dummy; return selectedFont ( family, style, size, dummy ); } /** * This method does return the font family or QString::null if there is * no font item selected * @return the font family diff --git a/libopie2/opieui/olistview.cpp b/libopie2/opieui/olistview.cpp index b90c786..67b4b83 100644 --- a/libopie2/opieui/olistview.cpp +++ b/libopie2/opieui/olistview.cpp @@ -187,101 +187,103 @@ void OListView::serializeFrom( QDataStream& s ) { QString coltext; s >> coltext; odebug << "read text '" << coltext << "' for column " << i << "" << oendl; setColumnText( i, coltext ); } int items; s >> items; odebug << "read number of items = " << items << oendl; for ( int i = 0; i < items; ++i ) { OListViewItem* item = childFactory(); s >> *item; } odebug << "OListView loaded." << oendl; } void OListView::expand() { odebug << "OListView::expand" << oendl; QListViewItemIterator it( this ); while ( it.current() ) { it.current()->setOpen( true ); ++it; } } void OListView::collapse() { odebug << "OListView::collapse" << oendl; QListViewItemIterator it( this ); while ( it.current() ) { it.current()->setOpen( false ); ++it; } } QDataStream& operator<<( QDataStream& s, const OListView& lv ) { lv.serializeTo( s ); + return s; } QDataStream& operator>>( QDataStream& s, OListView& lv ) { lv.serializeFrom( s ); + return s; } #endif // QT_NO_DATASTREAM /*====================================================================================== * OListViewItem *======================================================================================*/ OListViewItem::OListViewItem(QListView *parent) : QListViewItem(parent) { init(); } OListViewItem::OListViewItem(QListViewItem *parent) : QListViewItem(parent) { init(); } OListViewItem::OListViewItem(QListView *parent, QListViewItem *after) : QListViewItem(parent, after) { init(); } OListViewItem::OListViewItem(QListViewItem *parent, QListViewItem *after) : QListViewItem(parent, after) { init(); } OListViewItem::OListViewItem(QListView *parent, QString label1, QString label2, QString label3, QString label4, QString label5, QString label6, QString label7, QString label8) : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) { init(); } OListViewItem::OListViewItem(QListViewItem *parent, QString label1, QString label2, QString label3, QString label4, QString label5, QString label6, QString label7, QString label8) : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) @@ -418,102 +420,104 @@ void OListViewItem::serializeTo( QDataStream& s ) const { item = item->nextSibling(); items++; } // store number of items and the items itself s << items; item = firstChild(); for ( int i = 0; i < items; ++i ) { s << *static_cast<OListViewItem*>( item ); item = item->nextSibling(); } odebug << "OListviewItem stored." << oendl; } void OListViewItem::serializeFrom( QDataStream& s ) { #warning Caution... the binary format is still under construction... odebug << "loading OListViewItem..." << oendl; for ( int i = 0; i < listView()->columns(); ++i ) { QString coltext; s >> coltext; odebug << "read text '" << coltext << "' for column " << i << "" << oendl; setText( i, coltext ); } int items; s >> items; odebug << "read number of items = " << items << "" << oendl; for ( int i = 0; i < items; ++i ) { OListViewItem* item = childFactory(); s >> (*item); } odebug << "OListViewItem loaded." << oendl; } QDataStream& operator<<( QDataStream& s, const OListViewItem& lvi ) { lvi.serializeTo( s ); + return s; } QDataStream& operator>>( QDataStream& s, OListViewItem& lvi ) { lvi.serializeFrom( s ); + return s; } #endif // QT_NO_DATASTREAM /*====================================================================================== * OCheckListItem *======================================================================================*/ OCheckListItem::OCheckListItem( QCheckListItem* parent, const QString& text, Type t ) :QCheckListItem( parent, text, t ) { init(); } OCheckListItem::OCheckListItem( QListViewItem* parent, const QString& text, Type t) :QCheckListItem( parent, text, t ) { init(); } OCheckListItem::OCheckListItem( QListView* parent, const QString& text, Type t ) :QCheckListItem( parent, text, t ) { init(); } OCheckListItem::OCheckListItem( QListViewItem* parent, const QString& text, const QPixmap& p ) :QCheckListItem( parent, text, p ) { init(); } OCheckListItem::OCheckListItem( QListView* parent, const QString& text, const QPixmap& p ) :QCheckListItem( parent, text, p ) { init(); } OCheckListItem::~OCheckListItem() { } void OCheckListItem::init() diff --git a/libopie2/opieui/oselector.cpp b/libopie2/opieui/oselector.cpp index 5f6f10f..05543c5 100644 --- a/libopie2/opieui/oselector.cpp +++ b/libopie2/opieui/oselector.cpp @@ -101,96 +101,98 @@ void OXYSelector::paintEvent( QPaintEvent *ev ) painter.begin( this ); QBrush brush; qDrawShadePanel( &painter, 0, 0, width(), height(), colorGroup(), TRUE, 2, &brush ); drawContents( &painter ); if (paintRect.contains(cursorRect)) { bitBlt( &store, 0, 0, this, px - STORE_W, py - STORE_W, STORE_W2, STORE_W2, CopyROP ); drawCursor( &painter, px, py ); } else if (paintRect.intersects(cursorRect)) { repaint( cursorRect, false); } painter.end(); } void OXYSelector::mousePressEvent( QMouseEvent *e ) { int xVal, yVal; valuesFromPosition( e->pos().x() - 2, e->pos().y() - 2, xVal, yVal ); setValues( xVal, yVal ); emit valueChanged( xPos, yPos ); } void OXYSelector::mouseMoveEvent( QMouseEvent *e ) { int xVal, yVal; valuesFromPosition( e->pos().x() - 2, e->pos().y() - 2, xVal, yVal ); setValues( xVal, yVal ); emit valueChanged( xPos, yPos ); } void OXYSelector::wheelEvent( QWheelEvent *e ) { #if QT_VERSION > 290 if ( e->orientation() == Qt::Horizontal ) setValues( xValue() + e->delta()/120, yValue() ); else setValues( xValue(), yValue() + e->delta()/120 ); emit valueChanged( xPos, yPos ); + #else + Q_UNUSED( e ) #endif } void OXYSelector::valuesFromPosition( int x, int y, int &xVal, int &yVal ) const { xVal = ( (maxX-minX) * (x-2) ) / ( width()-4 ); yVal = maxY - ( ( (maxY-minY) * (y-2) ) / ( height()-4 ) ); if ( xVal > maxX ) xVal = maxX; else if ( xVal < minX ) xVal = minX; if ( yVal > maxY ) yVal = maxY; else if ( yVal < minY ) yVal = minY; } void OXYSelector::setPosition( int xp, int yp ) { if ( xp < 2 ) xp = 2; else if ( xp > width() - 2 ) xp = width() - 2; if ( yp < 2 ) yp = 2; else if ( yp > height() - 2 ) yp = height() - 2; QPainter painter; painter.begin( this ); bitBlt( this, px - STORE_W, py - STORE_W, &store, 0, 0, STORE_W2, STORE_W2, CopyROP ); bitBlt( &store, 0, 0, this, xp - STORE_W, yp - STORE_W, STORE_W2, STORE_W2, CopyROP ); drawCursor( &painter, xp, yp ); px = xp; py = yp; painter.end(); } void OXYSelector::drawContents( QPainter * ) {} diff --git a/libopie2/opieui/owait.cpp b/libopie2/opieui/owait.cpp index 9519888..ec1f25a 100644 --- a/libopie2/opieui/owait.cpp +++ b/libopie2/opieui/owait.cpp @@ -10,96 +10,97 @@ .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "owait.h" /* OPIE */ #include <qpe/qpeapplication.h> #include <qpe/resource.h> /* QT */ #include <qlayout.h> #include <qpainter.h> using namespace Opie::Ui; static int frame = 0; /** * This will construct a modal dialog. * * The default timer length is 10. * * @param parent The parent of the widget * @param msg The name of the object * @param dispIcon Display Icon? */ OWait::OWait( QWidget *parent, const char* msg, bool dispIcon ) :QDialog( parent, msg, TRUE, WStyle_Customize ) { + Q_UNUSED( dispIcon ) QHBoxLayout * hbox = new QHBoxLayout( this ); m_lb = new QLabel( this ); m_lb->setBackgroundMode ( NoBackground ); hbox->addWidget( m_lb ); hbox->activate(); m_pix = Resource::loadPixmap( "BigBusy" ); m_aniSize = m_pix.height(); resize( m_aniSize, m_aniSize ); m_timerLength = 10; m_waitTimer = new QTimer( this ); connect( m_waitTimer, SIGNAL( timeout() ), this, SLOT( hide() ) ); } void OWait::timerEvent( QTimerEvent * ) { frame = ( ++frame ) % 4; repaint(); } void OWait::paintEvent( QPaintEvent * ) { QPainter p( m_lb ); p.drawPixmap( 0, 0, m_pix, m_aniSize * frame, 0, m_aniSize, m_aniSize ); } void OWait::show() { move( ( ( qApp->desktop() ->width() ) / 2 ) - ( m_aniSize / 2 ), ( ( qApp->desktop() ->height() ) / 2 ) - ( m_aniSize / 2 ) ); startTimer( 300 ); m_waitTimer->start( m_timerLength * 1000, true ); QDialog::show(); } void OWait::hide() { killTimers(); m_waitTimer->stop(); frame = 0; QDialog::hide(); } |