summaryrefslogtreecommitdiff
path: root/libopie2/opieui/ofontselector.cpp
authorzecke <zecke>2004-09-10 11:06:50 (UTC)
committer zecke <zecke>2004-09-10 11:06:50 (UTC)
commit00b7879d0d886b642b1f1102e3a811e67f928df7 (patch) (side-by-side diff)
tree15a9a6b1ba3ddf64a94265556cd9140916a47811 /libopie2/opieui/ofontselector.cpp
parentd416ff23ea50303173d07ea243498a163f5995b5 (diff)
downloadopie-00b7879d0d886b642b1f1102e3a811e67f928df7.zip
opie-00b7879d0d886b642b1f1102e3a811e67f928df7.tar.gz
opie-00b7879d0d886b642b1f1102e3a811e67f928df7.tar.bz2
Fix warnings about unused parameters and no newline at the end of file
Diffstat (limited to 'libopie2/opieui/ofontselector.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/ofontselector.cpp1
1 files changed, 1 insertions, 0 deletions
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