You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kbarcode/kbarcode/encodingcombo.cpp

48 lines
1.8 KiB

/***************************************************************************
encodingcombo.h - description
-------------------
begin : Fri Dec 23 2005
copyright : (C) 2005 by Dominik Seichter
email : domseichter@web.de
***************************************************************************/
/***************************************************************************
* *
* 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 "encodingcombo.h"
#include <kcharsets.h>
#include <kglobal.h>
#include <klocale.h>
#include <tqtextcodec.h>
EncodingCombo::EncodingCombo( TQWidget* parent )
: KComboBox( parent )
{
TQString sEncoding = TQString( KGlobal::locale()->encoding() );
TQStringList encodings (KGlobal::charsets()->availableEncodingNames());
this->insertStringList( encodings );
for (int i=0; i < encodings.count(); i++)
{
bool found = false;
TQTextCodec *codecForEnc = KGlobal::charsets()->codecForName(encodings[i], found);
if (found && ( (codecForEnc->name() == sEncoding) || (encodings[i] == sEncoding) ) )
{
this->setCurrentItem(i);
break;
}
}
}
EncodingCombo::~EncodingCombo()
{
}