Initial TQt conversion

pull/1/head
Slávek Banko 10 years ago
parent 251c9a4397
commit 5f5e7c5455

@ -1060,7 +1060,7 @@ elif test "$kde_use_qt_emb" = "yes"; then
x_includes=""
x_libraries=""
elif test "$kde_use_qt_mac" = "yes"; then
dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
dnl We're using QT/Mac (I use QT_MAC so that ntqglobal.h doesn't *have* to
dnl be included to get the information) --Sam
CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
@ -1092,19 +1092,19 @@ AC_DEFUN([KDE_PRINT_QT_PROGRAM],
AC_REQUIRE([KDE_USE_QT])
cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <qglobal.h>
#include <qapplication.h>
#include <ntqglobal.h>
#include <ntqapplication.h>
EOF
if test "$kde_qtver" = "2"; then
cat >> conftest.$ac_ext <<EOF
#include <qevent.h>
#include <qstring.h>
#include <qstyle.h>
#include <ntqevent.h>
#include <ntqstring.h>
#include <ntqstyle.h>
EOF
if test $kde_qtsubver -gt 0; then
cat >> conftest.$ac_ext <<EOF
#if QT_VERSION < 210
#if TQT_VERSION < 210
#error 1
#endif
EOF
@ -1113,8 +1113,8 @@ fi
if test "$kde_qtver" = "3"; then
cat >> conftest.$ac_ext <<EOF
#include <qcursor.h>
#include <qstylefactory.h>
#include <ntqcursor.h>
#include <ntqstylefactory.h>
#include <private/qucomextra_p.h>
EOF
fi
@ -1201,22 +1201,22 @@ fi
if test -z "$3"; then
if test $kde_qtver = 3; then
if test $kde_qtsubver -gt 0; then
kde_qt_verstring="QT_VERSION >= 0x03@VER@00 && QT_VERSION < 0x040000"
kde_qt_verstring="TQT_VERSION >= 0x03@VER@00 && TQT_VERSION < 0x040000"
qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
else
kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000"
kde_qt_verstring="TQT_VERSION >= 300 && TQT_VERSION < 0x040000"
fi
fi
if test $kde_qtver = 2; then
if test $kde_qtsubver -gt 0; then
kde_qt_verstring="QT_VERSION >= 222"
kde_qt_verstring="TQT_VERSION >= 222"
else
kde_qt_verstring="QT_VERSION >= 200"
kde_qt_verstring="TQT_VERSION >= 200"
fi
fi
if test $kde_qtver = 1; then
kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
kde_qt_verstring="TQT_VERSION >= 142 && TQT_VERSION < 200"
fi
else
kde_qt_verstring="$3"
@ -1325,7 +1325,7 @@ AC_ARG_ENABLE(
USING_QT_MT=""
dnl ------------------------------------------------------------------------
dnl If we not get --disable-qt-mt then adjust some vars for the host.
dnl If we not get --disable-tqt-mt then adjust some vars for the host.
dnl ------------------------------------------------------------------------
KDE_MT_LDFLAGS=
@ -1383,7 +1383,7 @@ dnl ------------------------------------------------------------
fi
dnl ------------------------------------------------------------------------
dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
dnl If we got --enable-tqt-mt then adjust the Qt library name for the host.
dnl ------------------------------------------------------------------------
if test "x$kde_use_qt_mt" = "xyes"; then
@ -1449,9 +1449,9 @@ if test ! "$ac_qt_includes" = "NO"; then
fi
if test "$kde_qtver" != "1"; then
kde_qt_header=qstyle.h
kde_qt_header=ntqstyle.h
else
kde_qt_header=qglobal.h
kde_qt_header=ntqglobal.h
fi
AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
@ -2034,7 +2034,7 @@ AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
AC_TRY_LINK([
#include <qdom.h>
#include <ntqdom.h>
],
[
QDomDocument doc;
@ -2595,7 +2595,7 @@ LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
AC_TRY_LINK(
[#include <qapplication.h>],
[#include <ntqapplication.h>],
[
int argc;
char** argv;
@ -3439,7 +3439,7 @@ AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
AC_TRY_COMPILE(
[
#include <qglobal.h>
#include <ntqglobal.h>
#if Q_EXPORT - 0 != 0
/* if this compiles, then Q_EXPORT is undefined */
/* if Q_EXPORT is nonempty, this will break compilation */
@ -4689,7 +4689,7 @@ CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
AC_TRY_RUN(dnl
[
#include <qimageio.h>
#include <qstring.h>
#include <ntqstring.h>
int main() {
QString t = "hallo";
t.fill('t');
@ -5534,7 +5534,7 @@ if test "${with_qt_dir+set}" = set; then
kde_qtdir="$with_qt_dir"
fi
AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
AC_FIND_FILE(ntqsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
AC_MSG_RESULT($QTDOCDIR)
AC_SUBST(QTDOCDIR)
@ -5555,7 +5555,7 @@ AC_SUBST(DOXYGEN_PROJECT_NAME)
AC_SUBST(DOXYGEN_PROJECT_NUMBER)
KDE_HAS_DOXYGEN=no
if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/ntqsql.html; then
KDE_HAS_DOXYGEN=yes
fi
AC_SUBST(KDE_HAS_DOXYGEN)

@ -17,8 +17,8 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <qregexp.h>
#include <qstringlist.h>
#include <ntqregexp.h>
#include <ntqstringlist.h>
#include <comment.h>
#include <xsltransform.h>
@ -26,7 +26,7 @@
namespace BibTeX
{
Comment::Comment( const QString& text, bool useCommand ) : Element(), m_text( text ), m_useCommand( useCommand )
Comment::Comment( const TQString& text, bool useCommand ) : Element(), m_text( text ), m_useCommand( useCommand )
{
// nothing
}
@ -42,12 +42,12 @@ namespace BibTeX
// nothing
}
QString Comment::text() const
TQString Comment::text() const
{
return m_text;
}
void Comment::setText( const QString &text )
void Comment::setText( const TQString &text )
{
m_text = text;
}
@ -62,7 +62,7 @@ namespace BibTeX
m_useCommand = useCommand;
}
bool Comment::containsPattern( const QString& pattern, EntryField::FieldType fieldType, FilterType filterType, bool caseSensitive ) const
bool Comment::containsPattern( const TQString& pattern, EntryField::FieldType fieldType, FilterType filterType, bool caseSensitive ) const
{
if ( filterType == ftExact )
{
@ -72,9 +72,9 @@ namespace BibTeX
else
{
/** for each word in the search pattern ... */
QStringList words = QStringList::split( QRegExp( "\\s+" ), pattern );
TQStringList words = TQStringList::split( TQRegExp( "\\s+" ), pattern );
unsigned int hits = 0;
for ( QStringList::Iterator it = words.begin(); it != words.end(); ++it )
for ( TQStringList::Iterator it = words.begin(); it != words.end(); ++it )
{
/** check if word is contained in text */
if ( fieldType == EntryField::ftUnknown && m_text.contains( *it, caseSensitive ) )

@ -28,20 +28,20 @@ namespace BibTeX
class Comment : public Element
{
public:
Comment( const QString &text, bool useCommand = false );
Comment( const TQString &text, bool useCommand = false );
Comment( Comment *other );
virtual ~Comment();
QString text() const;
void setText( const QString &text );
TQString text() const;
void setText( const TQString &text );
bool useCommand() const;
void setUseCommand( bool useCommand );
bool containsPattern( const QString& pattern, EntryField::FieldType fieldType = EntryField::ftUnknown, FilterType filterType = BibTeX::Element::ftExact, bool caseSensitive = FALSE ) const;
bool containsPattern( const TQString& pattern, EntryField::FieldType fieldType = EntryField::ftUnknown, FilterType filterType = BibTeX::Element::ftExact, bool caseSensitive = FALSE ) const;
Element* clone();
private:
QString m_text;
TQString m_text;
bool m_useCommand;
};

@ -17,10 +17,10 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <qlabel.h>
#include <qmultilineedit.h>
#include <qlayout.h>
#include <qcheckbox.h>
#include <ntqlabel.h>
#include <ntqmultilineedit.h>
#include <ntqlayout.h>
#include <ntqcheckbox.h>
#include <kdialogbase.h>
#include <kglobalsettings.h>
#include <klocale.h>
@ -33,8 +33,8 @@
namespace KBibTeX
{
CommentWidget::CommentWidget( BibTeX::Comment *comment, bool isReadOnly, QWidget *parent, const char *name )
: QWidget( parent, name ), m_comment( comment ), m_isReadOnly( isReadOnly )
CommentWidget::CommentWidget( BibTeX::Comment *comment, bool isReadOnly, TQWidget *parent, const char *name )
: TQWidget( parent, name ), m_comment( comment ), m_isReadOnly( isReadOnly )
{
setupGUI();
getCommentData();
@ -50,18 +50,18 @@ namespace KBibTeX
void CommentWidget::setupGUI()
{
setMinimumWidth( 384 );
QVBoxLayout * layout = new QVBoxLayout( this, 0, KDialog::spacingHint() );
TQVBoxLayout * layout = new TQVBoxLayout( this, 0, KDialog::spacingHint() );
QLabel *label = new QLabel( i18n( "Co&mment:" ), this );
TQLabel *label = new TQLabel( i18n( "Co&mment:" ), this );
layout->addWidget( label );
m_multiLineEdit = new QMultiLineEdit( this );
m_multiLineEdit = new TQMultiLineEdit( this );
m_multiLineEdit->setFont( KGlobalSettings::fixedFont() );
layout->addWidget( m_multiLineEdit );
label->setBuddy( m_multiLineEdit );
m_multiLineEdit->setReadOnly( m_isReadOnly );
m_checkboxUseCommand = new QCheckBox( i18n( "&Use @Comment for comment instead of plain text" ), this );
m_checkboxUseCommand = new TQCheckBox( i18n( "&Use @Comment for comment instead of plain text" ), this );
layout->addWidget( m_checkboxUseCommand );
}
@ -77,14 +77,14 @@ namespace KBibTeX
m_comment->setUseCommand( m_checkboxUseCommand->isChecked() );
}
QDialog::DialogCode CommentWidget::execute( BibTeX::Comment *comment, bool isReadOnly, QWidget *parent, const char *name )
TQDialog::DialogCode CommentWidget::execute( BibTeX::Comment *comment, bool isReadOnly, TQWidget *parent, const char *name )
{
KDialogBase * dlg = new KDialogBase( parent, name, true, i18n( "Edit BibTeX Comment" ), KDialogBase::Ok | KDialogBase::Cancel );
CommentWidget* ui = new CommentWidget( comment, isReadOnly, dlg, "kbibtex::commentwidget" );
dlg->setMainWidget( ui );
QDialog::DialogCode result = ( QDialog::DialogCode ) dlg->exec();
if ( !isReadOnly && result == QDialog::Accepted )
TQDialog::DialogCode result = ( TQDialog::DialogCode ) dlg->exec();
if ( !isReadOnly && result == TQDialog::Accepted )
ui->setCommentData();
delete( ui );

@ -20,29 +20,29 @@
#ifndef COMMENTWIDGET_H
#define COMMENTWIDGET_H
#include <qwidget.h>
#include <qdialog.h>
#include <ntqwidget.h>
#include <ntqdialog.h>
#include <comment.h>
class QMultiLineEdit;
class QCheckBox;
class TQMultiLineEdit;
class TQCheckBox;
namespace KBibTeX
{
class CommentWidget : public QWidget
class CommentWidget : public TQWidget
{
Q_OBJECT
public:
CommentWidget( BibTeX::Comment *comment, bool isReadOnly, QWidget *parent = 0, const char *name = 0 );
CommentWidget( BibTeX::Comment *comment, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 );
~CommentWidget();
static QDialog::DialogCode execute( BibTeX::Comment *comment, bool isReadOnly, QWidget *parent = 0, const char *name = 0 );
static TQDialog::DialogCode execute( BibTeX::Comment *comment, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 );
private:
BibTeX::Comment* m_comment;
QCheckBox *m_checkboxUseCommand;
QMultiLineEdit *m_multiLineEdit;
TQCheckBox *m_checkboxUseCommand;
TQMultiLineEdit *m_multiLineEdit;
bool m_isReadOnly;
void setupGUI();

@ -21,17 +21,17 @@
#include <config.h>
#endif
#include <qevent.h>
#include <qdragobject.h>
#include <qfile.h>
#include <qvaluelist.h>
#include <qcursor.h>
#include <qbuffer.h>
#include <qlistview.h>
#include <qclipboard.h>
#include <qheader.h>
#include <qtextstream.h>
#include <qtimer.h>
#include <ntqevent.h>
#include <ntqdragobject.h>
#include <ntqfile.h>
#include <ntqvaluelist.h>
#include <ntqcursor.h>
#include <ntqbuffer.h>
#include <ntqlistview.h>
#include <ntqclipboard.h>
#include <ntqheader.h>
#include <ntqtextstream.h>
#include <ntqtimer.h>
#include <kapplication.h>
#include <kio/netaccess.h>
@ -69,12 +69,12 @@
namespace KBibTeX
{
DocumentListView::DocumentListView( KBibTeX::DocumentWidget *docWidget, bool isReadOnly, QWidget *parent, const char *name )
DocumentListView::DocumentListView( KBibTeX::DocumentWidget *docWidget, bool isReadOnly, TQWidget *parent, const char *name )
: KListView( parent, name ), m_docWidget( docWidget ), m_bibtexFile( NULL ), m_contextMenu( NULL ), m_headerMenu( NULL ), m_isReadOnly( isReadOnly ), m_newElementCounter( 1 )
{
setAllColumnsShowFocus( true );
setShowSortIndicator( true );
setSelectionMode( QListView::Extended );
setSelectionMode( TQListView::Extended );
header() ->setClickEnabled( TRUE );
header() ->setMovingEnabled( TRUE );
buildColumns();
@ -85,9 +85,9 @@ namespace KBibTeX
setDropVisualizer( TRUE );
connect( header(), SIGNAL( clicked( int ) ), this, SLOT( setSortingColumn( int ) ) );
connect( this, SIGNAL( contextMenu( KListView *, QListViewItem *, const QPoint & ) ), this, SLOT( showBibtexListContextMenu( KListView *, QListViewItem *, const QPoint & ) ) );
connect( this, SIGNAL( doubleClicked( QListViewItem*, const QPoint&, int ) ), this, SLOT( slotDoubleClick( QListViewItem* ) ) );
connect( this, SIGNAL( dropped( QDropEvent*, QListViewItem* ) ), this, SLOT( slotDropped( QDropEvent*, QListViewItem* ) ) );
connect( this, SIGNAL( contextMenu( KListView *, TQListViewItem *, const TQPoint & ) ), this, SLOT( showBibtexListContextMenu( KListView *, TQListViewItem *, const TQPoint & ) ) );
connect( this, SIGNAL( doubleClicked( TQListViewItem*, const TQPoint&, int ) ), this, SLOT( slotDoubleClick( TQListViewItem* ) ) );
connect( this, SIGNAL( dropped( TQDropEvent*, TQListViewItem* ) ), this, SLOT( slotDropped( TQDropEvent*, TQListViewItem* ) ) );
}
DocumentListView::~DocumentListView()
@ -115,7 +115,7 @@ namespace KBibTeX
void DocumentListView::setItems()
{
QApplication::setOverrideCursor( Qt::waitCursor );
TQApplication::setOverrideCursor( TQt::waitCursor );
KProgressDialog *prgDlg = new KProgressDialog( this, "prgDlg", i18n( "List View" ), i18n( "Updating main view ..." ), TRUE );
prgDlg->show();
@ -145,7 +145,7 @@ namespace KBibTeX
updateVisiblity();
QApplication::restoreOverrideCursor();
TQApplication::restoreOverrideCursor();
}
void DocumentListView::insertItems( BibTeX::File *items, KBibTeX::DocumentListViewItem *after )
@ -167,9 +167,9 @@ namespace KBibTeX
if ( m_bibtexFile->containsKey( newEntry->id() ) )
{
int counter = 0;
QString newId = QString( newEntry->id() ).append( '_' ).append( QString::number( ++counter ) );
TQString newId = TQString( newEntry->id() ).append( '_' ).append( TQString::number( ++counter ) );
while ( m_bibtexFile->containsKey( newId ) )
newId = QString( newEntry->id() ).append( '_' ).append( QString::number( ++counter ) );
newId = TQString( newEntry->id() ).append( '_' ).append( TQString::number( ++counter ) );
newEntry->setId( newId );
}
element = newEntry;
@ -185,7 +185,7 @@ namespace KBibTeX
m_unreadItems.append( after );
emit modified();
QTimer::singleShot( 3500, this, SLOT( makeNewItemsUnread() ) );
TQTimer::singleShot( 3500, this, SLOT( makeNewItemsUnread() ) );
return after;
}
@ -197,7 +197,7 @@ namespace KBibTeX
void DocumentListView::updateVisiblity()
{
QListViewItemIterator it( this );
TQListViewItemIterator it( this );
while ( it.current() )
{
DocumentListViewItem * kblvi = dynamic_cast<DocumentListViewItem*>( it.current() );
@ -263,7 +263,7 @@ namespace KBibTeX
for ( int i = 0; i <= ( int ) BibTeX::EntryField::ftYear - ( int ) BibTeX::EntryField::ftAbstract; i++ )
{
BibTeX::EntryField::FieldType fieldType = ( BibTeX::EntryField::FieldType )( i + ( int ) BibTeX::EntryField::ftAbstract );
QString label = Settings::fieldTypeToI18NString( fieldType );
TQString label = Settings::fieldTypeToI18NString( fieldType );
item = m_headerMenu->insertItem( label, ( int ) fieldType + 2 );
m_headerMenu->setItemChecked( item, settings->editing_MainListColumnsWidth[ i + 2 ] > 0 );
}
@ -272,11 +272,11 @@ namespace KBibTeX
void DocumentListView::deleteSelected()
{
QListViewItemIterator it( this, QListViewItemIterator::Selected | QListViewItemIterator::Visible );
TQListViewItemIterator it( this, TQListViewItemIterator::Selected | TQListViewItemIterator::Visible );
if ( it.current() == NULL ) return;
QListViewItem *above = it.current() ->itemAbove();
QValueList<DocumentListViewItem*> toBeDeleted;
TQListViewItem *above = it.current() ->itemAbove();
TQValueList<DocumentListViewItem*> toBeDeleted;
while ( it.current() )
{
DocumentListViewItem * kblvi = dynamic_cast<DocumentListViewItem*>( it.current() );
@ -284,7 +284,7 @@ namespace KBibTeX
it++;
}
for ( QValueList<DocumentListViewItem*>::Iterator it = toBeDeleted.begin(); it != toBeDeleted.end(); ++it )
for ( TQValueList<DocumentListViewItem*>::Iterator it = toBeDeleted.begin(); it != toBeDeleted.end(); ++it )
{
m_bibtexFile->deleteElement(( *it )->element() );
takeItem( *it );
@ -297,11 +297,11 @@ namespace KBibTeX
emit modified();
}
const QValueList<BibTeX::Element*> DocumentListView::selectedItems()
const TQValueList<BibTeX::Element*> DocumentListView::selectedItems()
{
QValueList<BibTeX::Element*> result;
TQValueList<BibTeX::Element*> result;
QListViewItemIterator it( this, QListViewItemIterator::Selected );
TQListViewItemIterator it( this, TQListViewItemIterator::Selected );
while ( it.current() )
{
DocumentListViewItem * kblvi = dynamic_cast<DocumentListViewItem*>( it.current() );
@ -313,33 +313,33 @@ namespace KBibTeX
return result;
}
QString DocumentListView::selectedToBibTeXText()
TQString DocumentListView::selectedToBibTeXText()
{
BibTeX::FileExporterBibTeX *exporter = new BibTeX::FileExporterBibTeX();
exporter->setEncoding( "latex" );
QBuffer buffer;
TQBuffer buffer;
buffer.open( IO_WriteOnly );
QValueList<BibTeX::Element*> selectedElements = selectedItems();
for ( QValueList<BibTeX::Element*>::iterator it = selectedElements.begin(); it != selectedElements.end(); ++it )
TQValueList<BibTeX::Element*> selectedElements = selectedItems();
for ( TQValueList<BibTeX::Element*>::iterator it = selectedElements.begin(); it != selectedElements.end(); ++it )
exporter->save( &buffer, *it );
buffer.close();
delete exporter;
buffer.open( IO_ReadOnly );
QTextStream in( &buffer );
in.setEncoding( QTextStream::UnicodeUTF8 );
QString result = in.read();
TQTextStream in( &buffer );
in.setEncoding( TQTextStream::UnicodeUTF8 );
TQString result = in.read();
buffer.close();
return result;
}
QString DocumentListView::selectedToBibTeXRefs()
TQString DocumentListView::selectedToBibTeXRefs()
{
QString refs;
QValueList<BibTeX::Element*> selectedElements = selectedItems();
for ( QValueList<BibTeX::Element*>::iterator it = selectedElements.begin(); it != selectedElements.end(); ++it )
TQString refs;
TQValueList<BibTeX::Element*> selectedElements = selectedItems();
for ( TQValueList<BibTeX::Element*>::iterator it = selectedElements.begin(); it != selectedElements.end(); ++it )
{
BibTeX::Entry *entry = dynamic_cast<BibTeX::Entry*>( *it );
if ( entry == NULL ) continue;
@ -348,7 +348,7 @@ namespace KBibTeX
refs.append( "," );
refs.append( entry->id() );
}
return QString( "\\cite{%1}" ).arg( refs );
return TQString( "\\cite{%1}" ).arg( refs );
}
void DocumentListView::copy()
@ -373,11 +373,11 @@ namespace KBibTeX
if ( dlvi == NULL )
dlvi = dynamic_cast<KBibTeX::DocumentListViewItem *>( currentItem() );
QString clipboardText = kapp->clipboard() ->text();
TQString clipboardText = kapp->clipboard() ->text();
return paste( clipboardText, dlvi );
}
bool DocumentListView::paste( const QString& text, DocumentListViewItem *at )
bool DocumentListView::paste( const TQString& text, DocumentListViewItem *at )
{
Settings * settings = Settings::self( m_bibtexFile );
@ -454,11 +454,11 @@ namespace KBibTeX
popup->insertItem( Settings::fieldTypeToI18NString( ft ), i );
}
popup->insertSeparator();
QIconSet cancelPixmap = KGlobal::iconLoader() ->loadIconSet( "cancel", KIcon::Small );
TQIconSet cancelPixmap = KGlobal::iconLoader() ->loadIconSet( "cancel", KIcon::Small );
int cancelId = popup->insertItem( cancelPixmap, i18n( "Cancel" ) );
// show popup menu
int selectedId = popup->exec( QCursor::pos() );
int selectedId = popup->exec( TQCursor::pos() );
if ( selectedId == cancelId || selectedId == -1 )
return FALSE; // cancel menu
@ -473,7 +473,7 @@ namespace KBibTeX
else if ( field->value() != NULL )
delete field->value();
QString encodedText = BibTeX::EncoderLaTeX::currentEncoderLaTeX() ->encode( text );
TQString encodedText = BibTeX::EncoderLaTeX::currentEncoderLaTeX() ->encode( text );
// create new value from clipboard's content
BibTeX::Value * value = new BibTeX::Value();
@ -495,13 +495,13 @@ namespace KBibTeX
void DocumentListView::selectAll()
{
QListView::selectAll( true );
TQListView::selectAll( true );
}
/* void DocumentListView::sendSelectedToLyx()
{
QStringList refsToSend;
QListViewItemIterator it( this, QListViewItemIterator::Selected );
TQStringList refsToSend;
TQListViewItemIterator it( this, TQListViewItemIterator::Selected );
while ( it.current() )
{
DocumentListViewItem * kblvi = dynamic_cast<DocumentListViewItem*>( it.current() );
@ -512,28 +512,28 @@ namespace KBibTeX
}
Settings * settings = Settings::self( m_bibtexFile );
QString lyxPipeFilename = settings->detectLyXInPipe();
TQString lyxPipeFilename = settings->detectLyXInPipe();
kdDebug() << "sendSelectedToLyx: lyxPipeFilename= " << lyxPipeFilename << endl;
QFile pipe( lyxPipeFilename );
TQFile pipe( lyxPipeFilename );
if ( pipe.exists() && pipe.open( IO_WriteOnly ) )
{
QTextStream * writer = new QTextStream( &pipe );
QString msg = "LYXCMD:kbibtex:citation-insert:" + refsToSend.join( "," );
TQTextStream * writer = new TQTextStream( &pipe );
TQString msg = "LYXCMD:kbibtex:citation-insert:" + refsToSend.join( "," );
*writer << msg << endl;
delete writer;
pipe.close();
}
else
KMessageBox::error( this, ( lyxPipeFilename.isEmpty() ? i18n( "Cannot establish a link to LyX" ) : QString( i18n( "Cannot establish a link to LyX using the pipe \"%1\"" ) ).arg( lyxPipeFilename ) ) + i18n( "\nMaybe LyX is not running?" ), i18n( "Error communicating with LyX" ) );
KMessageBox::error( this, ( lyxPipeFilename.isEmpty() ? i18n( "Cannot establish a link to LyX" ) : TQString( i18n( "Cannot establish a link to LyX using the pipe \"%1\"" ) ).arg( lyxPipeFilename ) ) + i18n( "\nMaybe LyX is not running?" ), i18n( "Error communicating with LyX" ) );
}*/
void DocumentListView::slotDoubleClick( QListViewItem *item )
void DocumentListView::slotDoubleClick( TQListViewItem *item )
{
DocumentListViewItem *dlvi = dynamic_cast<DocumentListViewItem*>( item );
if ( dlvi != NULL ) emit executed( dlvi );
}
void DocumentListView::filter( const QString & text, BibTeX::Element::FilterType filterType, BibTeX::EntryField::FieldType fieldType )
void DocumentListView::filter( const TQString & text, BibTeX::Element::FilterType filterType, BibTeX::EntryField::FieldType fieldType )
{
m_filter = text;
m_filterType = filterType;
@ -563,7 +563,7 @@ namespace KBibTeX
}
}
void DocumentListView::showBibtexListContextMenu( KListView *, QListViewItem *, const QPoint & p )
void DocumentListView::showBibtexListContextMenu( KListView *, TQListViewItem *, const TQPoint & p )
{
if ( m_contextMenu != NULL )
{
@ -576,25 +576,25 @@ namespace KBibTeX
{
Settings * settings = Settings::self( m_bibtexFile );
settings->editing_MainListSortingColumn = column;
settings->editing_MainListSortingOrder = ( sortOrder() == Qt::Ascending ) ? 1 : -1;
settings->editing_MainListSortingOrder = ( sortOrder() == TQt::Ascending ) ? 1 : -1;
}
bool DocumentListView::acceptDrag( QDropEvent * event ) const
bool DocumentListView::acceptDrag( TQDropEvent * event ) const
{
if ( event->source() == this ) return false;
return QTextDrag::canDecode( event ) || QUriDrag::canDecode( event );
return TQTextDrag::canDecode( event ) || TQUriDrag::canDecode( event );
}
void DocumentListView::startDrag()
{
Settings * settings = Settings::self( m_bibtexFile );
QDragObject *d = new QTextDrag( settings->editing_DragAction == Settings::COPYREFERENCE ? selectedToBibTeXRefs() : selectedToBibTeXText(), this );
TQDragObject *d = new TQTextDrag( settings->editing_DragAction == Settings::COPYREFERENCE ? selectedToBibTeXRefs() : selectedToBibTeXText(), this );
d->dragCopy();
}
void DocumentListView::saveColumnIndex()
{
Settings * settings = Settings::self( m_bibtexFile );
QHeader *hdr = header();
TQHeader *hdr = header();
for ( int i = 0; i < columns(); i++ )
settings->editing_MainListColumnsIndex[ i ] = hdr->mapToIndex( i );
@ -603,7 +603,7 @@ namespace KBibTeX
void DocumentListView::restoreColumnIndex()
{
Settings * settings = Settings::self( m_bibtexFile );
QHeader *hdr = header();
TQHeader *hdr = header();
for ( int i = 0; i < columns(); i++ )
hdr->moveSection( i, settings->editing_MainListColumnsIndex[ i ] );
@ -617,7 +617,7 @@ namespace KBibTeX
for ( int i = from; i < to; i++ )
{
if ( columnWidthMode( i ) == QListView::Manual )
if ( columnWidthMode( i ) == TQListView::Manual )
settings->editing_MainListColumnsWidth[ i ] = columnWidth( i );
else
settings->editing_MainListColumnsWidth[ i ] = 0xffff;
@ -639,12 +639,12 @@ namespace KBibTeX
{
Settings * settings = Settings::self( m_bibtexFile );
setSortColumn( settings->editing_MainListSortingColumn );
setSortOrder( settings->editing_MainListSortingOrder > 0 ? Qt::Ascending : Qt::Descending );
setSortOrder( settings->editing_MainListSortingOrder > 0 ? TQt::Ascending : TQt::Descending );
}
void DocumentListView::makeNewItemsUnread()
{
for ( QValueList<DocumentListViewItem*>::ConstIterator it = m_unreadItems.begin() ; it != m_unreadItems.end(); ++it )
for ( TQValueList<DocumentListViewItem*>::ConstIterator it = m_unreadItems.begin() ; it != m_unreadItems.end(); ++it )
{
( *it ) ->setUnreadStatus( FALSE );
( *it ) ->repaint();
@ -653,36 +653,36 @@ namespace KBibTeX
m_unreadItems.clear();
}
void DocumentListView::slotDropped( QDropEvent * event, QListViewItem * item )
void DocumentListView::slotDropped( TQDropEvent * event, TQListViewItem * item )
{
QString text;
QStrList urlList;
TQString text;
TQStrList urlList;
if ( QTextDrag::decode( event, text ) && KURL( text ).isValid() )
if ( TQTextDrag::decode( event, text ) && KURL( text ).isValid() )
urlList.append( text );
if ( !urlList.isEmpty() || QUriDrag::decode( event, urlList ) )
if ( !urlList.isEmpty() || TQUriDrag::decode( event, urlList ) )
{
QString url = urlList.at( 0 );
QString tmpFile;
TQString url = urlList.at( 0 );
TQString tmpFile;
if ( ! KIO::NetAccess::download( url, tmpFile, 0 ) )
{
KMessageBox::error( this, KIO::NetAccess::lastErrorString() );
return ;
}
QFile f( tmpFile );
TQFile f( tmpFile );
if ( ! f.open( IO_ReadOnly ) )
{
KMessageBox::error( this, f.errorString() );
KIO::NetAccess::removeTempFile( tmpFile );
return ;
}
QByteArray ba = f.readAll();
text = QString( ba );
TQByteArray ba = f.readAll();
text = TQString( ba );
f.close();
KIO::NetAccess::removeTempFile( tmpFile );
}
else if ( !QTextDrag::decode( event, text ) )
else if ( !TQTextDrag::decode( event, text ) )
return;
event->accept( TRUE );
@ -691,16 +691,16 @@ namespace KBibTeX
paste( text, dlvi );
}
bool DocumentListView::eventFilter( QObject * watched, QEvent * e )
bool DocumentListView::eventFilter( TQObject * watched, TQEvent * e )
{
if ( watched == header() )
{
switch ( e->type() )
{
case QEvent::MouseButtonPress:
case TQEvent::MouseButtonPress:
{
if ( static_cast<QMouseEvent *>( e ) ->button() == RightButton && m_headerMenu != NULL )
m_headerMenu->popup( QCursor::pos() );
if ( static_cast<TQMouseEvent *>( e ) ->button() == RightButton && m_headerMenu != NULL )
m_headerMenu->popup( TQCursor::pos() );
break;
}
@ -713,9 +713,9 @@ namespace KBibTeX
return KListView::eventFilter( watched, e );
}
void DocumentListView::keyPressEvent( QKeyEvent *e )
void DocumentListView::keyPressEvent( TQKeyEvent *e )
{
if ( e->key() == QKeyEvent::Key_Enter || e->key() == QKeyEvent::Key_Return )
if ( e->key() == TQKeyEvent::Key_Enter || e->key() == TQKeyEvent::Key_Return )
{
DocumentListViewItem *item = dynamic_cast<DocumentListViewItem*>( selectedItem() );
if ( item == NULL )
@ -742,7 +742,7 @@ namespace KBibTeX
setColumnWidth( col, colWidth );
header() ->setResizeEnabled( colWidth > 0, col );
setColumnWidthMode( col, colWidth < 0xffff ? QListView::Manual : QListView::Maximum );
setColumnWidthMode( col, colWidth < 0xffff ? TQListView::Manual : TQListView::Maximum );
saveColumnWidths( col );
}
@ -759,7 +759,7 @@ namespace KBibTeX
for ( int i = 0; i <= ( int ) BibTeX::EntryField::ftYear - ( int ) BibTeX::EntryField::ftAbstract; i++ )
{
BibTeX::EntryField::FieldType fieldType = ( BibTeX::EntryField::FieldType )( i + ( int ) BibTeX::EntryField::ftAbstract );
QString label = Settings::fieldTypeToI18NString( fieldType );
TQString label = Settings::fieldTypeToI18NString( fieldType );
addColumn( label );
}
}

@ -27,7 +27,7 @@
#include <settings.h>
#include <file.h>
class QString;
class TQString;
class KURL;
class KActionMenu;
class KPopupMenu;
@ -41,7 +41,7 @@ namespace KBibTeX
{
Q_OBJECT
public:
DocumentListView( KBibTeX::DocumentWidget *docWidget, bool isReadOnly, QWidget *parent = 0, const char *name = 0 );
DocumentListView( KBibTeX::DocumentWidget *docWidget, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 );
~DocumentListView();
void setFactory( KXMLGUIFactory *factory, KXMLGUIClient *client );
@ -52,7 +52,7 @@ namespace KBibTeX
KBibTeX::DocumentListViewItem *insertItem( BibTeX::Element *item, KBibTeX::DocumentListViewItem *after );
void deleteSelected();
const QValueList<BibTeX::Element*> selectedItems();
const TQValueList<BibTeX::Element*> selectedItems();
// void sendSelectedToLyx();
void updateVisiblity();
@ -70,9 +70,9 @@ namespace KBibTeX
void copyReferences();
void cut();
bool paste();
bool paste( const QString& text, DocumentListViewItem *at );
bool paste( const TQString& text, DocumentListViewItem *at );
void selectAll();
void filter( const QString& text, BibTeX::Element::FilterType filterType, BibTeX::EntryField::FieldType fieldType );
void filter( const TQString& text, BibTeX::Element::FilterType filterType, BibTeX::EntryField::FieldType fieldType );
void setReadOnly( bool isReadOnly );
void activateShowColumnMenu( int id );
@ -80,10 +80,10 @@ namespace KBibTeX
void insertItem( BibTeX::Element *item );
private slots:
void slotDoubleClick( QListViewItem * item = NULL );
void slotDoubleClick( TQListViewItem * item = NULL );
void setSortingColumn( int column );
void showBibtexListContextMenu( KListView *, QListViewItem *, const QPoint &p );
void slotDropped( QDropEvent* event, QListViewItem* item );
void showBibtexListContextMenu( KListView *, TQListViewItem *, const TQPoint &p );
void slotDropped( TQDropEvent* event, TQListViewItem* item );
void saveColumnIndex();
void restoreColumnIndex();
void saveColumnWidths( int col = -1 );
@ -92,12 +92,12 @@ namespace KBibTeX
void makeNewItemsUnread();
protected:
bool acceptDrag( QDropEvent* e ) const;
bool acceptDrag( TQDropEvent* e ) const;
void startDrag();
virtual bool eventFilter( QObject *watched, QEvent *e );
virtual bool eventFilter( TQObject *watched, TQEvent *e );
virtual void keyPressEvent( QKeyEvent *e );
virtual void keyPressEvent( TQKeyEvent *e );
private:
static const int maxColumns = 256;
@ -107,16 +107,16 @@ namespace KBibTeX
KPopupMenu *m_headerMenu;
KActionMenu *m_columnVisibleAction;
bool m_isReadOnly;
QValueList<DocumentListViewItem*> m_unreadItems;
TQValueList<DocumentListViewItem*> m_unreadItems;
QString m_filter;
TQString m_filter;
BibTeX::Element::FilterType m_filterType;
BibTeX::EntryField::FieldType m_filterFieldType;
int m_newElementCounter;
void setItems();
QString selectedToBibTeXText();
QString selectedToBibTeXRefs();
TQString selectedToBibTeXText();
TQString selectedToBibTeXRefs();
void showColumn( int col, int colWidth = 0xffff );
void hideColumn( int col );

@ -17,9 +17,9 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <qlistview.h>
#include <qpainter.h>
#include <qpen.h>
#include <ntqlistview.h>
#include <ntqpainter.h>
#include <ntqpen.h>
#include <klocale.h>
@ -36,7 +36,7 @@ namespace KBibTeX
setTexts();
}
DocumentListViewItem::DocumentListViewItem( BibTeX::File *file, BibTeX::Element *element, DocumentListView *parent, QListViewItem *after ) : KListViewItem( parent, after ), m_element( element ), m_bibtexFile( file ), m_parent( parent )
DocumentListViewItem::DocumentListViewItem( BibTeX::File *file, BibTeX::Element *element, DocumentListView *parent, TQListViewItem *after ) : KListViewItem( parent, after ), m_element( element ), m_bibtexFile( file ), m_parent( parent )
{
setTexts();
}
@ -61,7 +61,7 @@ namespace KBibTeX
m_unreadStatus = unread;
}
void DocumentListViewItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align )
void DocumentListViewItem::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align )
{
if ( !p )
return ;
@ -69,7 +69,7 @@ namespace KBibTeX
// make unread items bold
if ( m_unreadStatus )
{
QFont f = p->font();
TQFont f = p->font();
f.setBold( TRUE );
p->setFont( f );
}
@ -112,7 +112,7 @@ namespace KBibTeX
if ( comment )
{
setText( 0, i18n( "Comment" ) );
QString text = comment->text();
TQString text = comment->text();
text.replace( '\n', ' ' );
setText(( int ) BibTeX::EntryField::ftTitle - ( int ) BibTeX::EntryField::ftAbstract + 2, text );
}

@ -31,7 +31,7 @@ namespace KBibTeX
{
public:
DocumentListViewItem( BibTeX::File *file, BibTeX::Element *element, DocumentListView *parent );
DocumentListViewItem( BibTeX::File *file, BibTeX::Element *element, DocumentListView *parent, QListViewItem *after );
DocumentListViewItem( BibTeX::File *file, BibTeX::Element *element, DocumentListView *parent, TQListViewItem *after );
~DocumentListViewItem();
@ -40,7 +40,7 @@ namespace KBibTeX
void setUnreadStatus( bool unread );
protected:
void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align );
void paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align );
private:
BibTeX::Element *m_element;

@ -17,9 +17,9 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <qbuffer.h>
#include <qlayout.h>
#include <qfile.h>
#include <ntqbuffer.h>
#include <ntqlayout.h>
#include <ntqfile.h>
#include <klibloader.h>
#include <kxmlguifactory.h>
@ -46,8 +46,8 @@
namespace KBibTeX
{
DocumentSourceView::DocumentSourceView( KBibTeX::DocumentWidget *docWidget, bool isReadOnly, QWidget *parent, const char *name )
: QWidget( parent, name ), m_isReadOnly( isReadOnly ), m_docWidget( docWidget ), m_bibtexFile( NULL ), m_document( NULL ), m_view( NULL ), m_progDlg( NULL )
DocumentSourceView::DocumentSourceView( KBibTeX::DocumentWidget *docWidget, bool isReadOnly, TQWidget *parent, const char *name )
: TQWidget( parent, name ), m_isReadOnly( isReadOnly ), m_docWidget( docWidget ), m_bibtexFile( NULL ), m_document( NULL ), m_view( NULL ), m_progDlg( NULL )
{
setupGUI();
@ -97,7 +97,7 @@ namespace KBibTeX
/**
* Paste a line of text into the document at the designated position
*/
void DocumentSourceView::insertLines( const QString& text, int line )
void DocumentSourceView::insertLines( const TQString& text, int line )
{
m_editInterface->insertLine( line < 0 ? m_editInterface->numLines() : ( uint ) line, text );
@ -122,7 +122,7 @@ namespace KBibTeX
void DocumentSourceView::setFactory( KXMLGUIFactory *factory, KXMLGUIClient * client )
{
KTextEditor::PopupMenuInterface * popupInterface = dynamic_cast<KTextEditor::PopupMenuInterface*>( m_view );
popupInterface->installPopup(( QPopupMenu* )( factory ->container( "ktexteditor_popup", client ) ) );
popupInterface->installPopup(( TQPopupMenu* )( factory ->container( "ktexteditor_popup", client ) ) );
}
void DocumentSourceView::configureEditor()
@ -159,7 +159,7 @@ namespace KBibTeX
dlg.setSupportsCaseSensitiveFind( FALSE );
dlg.setSupportsRegularExpressionFind( FALSE );
#endif
if ( dlg.exec() == QDialog::Accepted )
if ( dlg.exec() == TQDialog::Accepted )
{
m_lastSearchTerm = dlg.pattern();
m_findHistory = dlg.findHistory();
@ -215,7 +215,7 @@ namespace KBibTeX
m_progDlg->setAllowCancel( false );
kapp->processEvents();
QBuffer buffer;
TQBuffer buffer;
buffer.open( IO_WriteOnly );
BibTeX::FileExporterBibTeX * exporter = new BibTeX::FileExporterBibTeX();
connect( exporter, SIGNAL( progress( int, int ) ), this, SLOT( updateProgress( int, int ) ) );
@ -231,9 +231,9 @@ namespace KBibTeX
{
kapp->processEvents();
buffer.open( IO_ReadOnly );
QTextStream in( &buffer );
in.setEncoding( QTextStream::UnicodeUTF8 );
QString text = in.read();
TQTextStream in( &buffer );
in.setEncoding( TQTextStream::UnicodeUTF8 );
TQString text = in.read();
buffer.close();
if ( m_editInterface )
@ -259,11 +259,11 @@ namespace KBibTeX
{
if ( m_editInterface )
{
QBuffer buffer;
TQBuffer buffer;
buffer.open( IO_WriteOnly );
QTextStream stream( &buffer );
stream.setEncoding( QTextStream::UnicodeUTF8 );
TQTextStream stream( &buffer );
stream.setEncoding( TQTextStream::UnicodeUTF8 );
stream << m_editInterface->text();
buffer.close();
@ -281,7 +281,7 @@ namespace KBibTeX
return NULL;
}
void DocumentSourceView::focusInEvent( QFocusEvent* /*event*/ )
void DocumentSourceView::focusInEvent( TQFocusEvent* /*event*/ )
{
if ( m_view != NULL )
m_view->setFocus();
@ -297,8 +297,8 @@ namespace KBibTeX
m_document->setReadWrite( !m_isReadOnly );
if ( !m_isReadOnly )
connect( m_document, SIGNAL( textChanged() ), this, SIGNAL( modified() ) );
QBoxLayout * layout = new QVBoxLayout( this );
layout->addWidget( static_cast<QWidget*>( m_view ) );
TQBoxLayout * layout = new TQVBoxLayout( this );
layout->addWidget( static_cast<TQWidget*>( m_view ) );
int c = m_document->hlModeCount() ;
int hlIdx = -1;
@ -366,7 +366,7 @@ namespace KBibTeX
fromLine = 0;
fromCol = 0;
}
while ( KMessageBox::questionYesNo( this, QString( i18n( "Could not find text '%1' in the document.\nStart from the beginning?" ) ).arg( m_lastSearchTerm ), i18n( "Find text in source view" ), KGuiItem( i18n( "Restart search" ) ) ) == KMessageBox::Yes );
while ( KMessageBox::questionYesNo( this, TQString( i18n( "Could not find text '%1' in the document.\nStart from the beginning?" ) ).arg( m_lastSearchTerm ), i18n( "Find text in source view" ), KGuiItem( i18n( "Restart search" ) ) ) == KMessageBox::Yes );
}
void DocumentSourceView::updateProgress( int current, int total )

@ -20,7 +20,7 @@
#ifndef KBIBTEXDOCUMENTSOURCEVIEW_H
#define KBIBTEXDOCUMENTSOURCEVIEW_H
#include <qwidget.h>
#include <ntqwidget.h>
#include <file.h>
@ -37,11 +37,11 @@ namespace KBibTeX
/**
* @author Thomas Fischer <fischer@unix-ag.uni-kl.de>
*/
class DocumentSourceView : public QWidget
class DocumentSourceView : public TQWidget
{
Q_OBJECT
public:
DocumentSourceView( KBibTeX::DocumentWidget *docWidget, bool isReadOnly, QWidget *parent = 0, const char *name = 0 );
DocumentSourceView( KBibTeX::DocumentWidget *docWidget, bool isReadOnly, TQWidget *parent = 0, const char *name = 0 );
~DocumentSourceView();
bool setBibTeXFile( BibTeX::File *bibtexFile );
@ -50,7 +50,7 @@ namespace KBibTeX
void copy();
void cut();
bool paste();
void insertLines( const QString& text, int line = -1 );
void insertLines( const TQString& text, int line = -1 );
void selectAll();
void setReadOnly( bool isReadOnly );
@ -66,7 +66,7 @@ namespace KBibTeX
void modified();
protected:
virtual void focusInEvent( QFocusEvent* event );
virtual void focusInEvent( TQFocusEvent* event );
private:
bool m_isReadOnly;
@ -75,8 +75,8 @@ namespace KBibTeX
Kate::Document* m_document;
Kate::View* m_view;
KTextEditor::EditInterface* m_editInterface;
QString m_lastSearchTerm;
QStringList m_findHistory;
TQString m_lastSearchTerm;
TQStringList m_findHistory;
KProgressDialog *m_progDlg;
void setupGUI();

@ -19,19 +19,19 @@
***************************************************************************/
#include <cmath>
#include <qlayout.h>
#include <qfile.h>